scidavis  2.3.0
About: SciDAVis is a free application for Scientific Data Analysis and Visualization (a fork off of QtiPlot).
  Fossies Dox: scidavis-2.3.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

Graph3D.cpp
Go to the documentation of this file.
1 
11 
29 #include "Graph3D.h"
30 #include "Bar.h"
31 #include "Cone3D.h"
32 #include "MyParser.h"
33 #include "ColorButton.h"
34 #include "core/column/Column.h"
35 
36 #include <QApplication>
37 #include <QMessageBox>
38 #include <QFileDialog>
39 #include <QPrinter>
40 #include <QPrintDialog>
41 #include <QClipboard>
42 #include <QPixmap>
43 #include <QBitmap>
44 #include <QDateTime>
45 #include <QCursor>
46 #include <QImageWriter>
47 
48 #include <qwt3d_io_gl2ps.h>
49 #include <qwt3d_coordsys.h>
50 
51 #include <gsl/gsl_vector.h>
52 #include <fstream>
53 #include <stdexcept>
54 using namespace std;
55 
56 UserFunction::UserFunction(const QString& s, SurfacePlot& pw)
57 : Function(pw)
58 {
59  formula=s;
60 }
61 
62 double UserFunction::operator()(double x, double y)
63 {
64  if (formula.isEmpty())
65  return 0.0;
66 
67  MyParser parser;
68  double result=0.0;
69  try
70  {
71  parser.DefineVar(_T("x"), &x);
72  parser.DefineVar(_T("y"), &y);
73 
74  parser.SetExpr(formula);
75  result=parser.Eval();
76  }
77  catch(mu::ParserError &e)
78  {
79  QMessageBox::critical(0,"Input function error",QStringFromString(e.GetMsg()));
80  }
81  return result;
82 }
83 
85 {
86 }
87 
88  Graph3D::Graph3D(const QString& label, QWidget* parent, const char* name, Qt::WindowFlags f)
89 : MyWidget(label,parent,name,f)
90 {
91  initPlot();
92 }
93 
95 {
96  worksheet = 0;
97  d_matrix = 0;
98  plotAssociation = QString();
99 
100  QDateTime dt = QDateTime::currentDateTime ();
101  setBirthDate(dt.toString(Qt::LocalDate));
102 
103  color_map = QString();
105  d_timer = new QTimer(this);
106  connect(d_timer, SIGNAL(timeout()), this, SLOT(rotate()) );
107  ignoreFonts = false;
108 
109  QWidget* d_main_widget = new QWidget();
110  sp = new SurfacePlot(d_main_widget);
111  sp->resize(500,400);
112  sp->installEventFilter(this);
113  sp->setRotation(30,0,15);
114  sp->setScale(1,1,1);
115  sp->setShift(0.15,0,0);
116  sp->setZoom(0.9);
117  sp->setOrtho(false);
118 
119  smoothMesh = true;
120  sp->setSmoothMesh(smoothMesh);
121 
122  d_autoscale = true;
123 
124  title = QString();
125  sp->setTitle(title);
126 
127  titleCol = QColor(Qt::black);
128  sp->setTitleColor(Qt2GL(titleCol));
129 
130  titleFnt = QFont("Times New Roman",14);
131  titleFnt.setBold(true);
132 
133  sp->setTitleFont(titleFnt.family(),titleFnt.pointSize(),
134  titleFnt.weight(),titleFnt.italic());
135 
136  axesCol=QColor(Qt::black);
137  labelsCol=QColor(Qt::black);
138  numCol=QColor(Qt::black);
139  meshCol=QColor(Qt::black);
140  gridCol=QColor(Qt::black);
141  bgCol=QColor(255, 255, 255);
142  fromColor=QColor(Qt::red);
143  toColor=QColor(Qt::blue);
144 
145  col_ = 0;
146 
147  legendOn = false;
148  legendMajorTicks = 5;
149  sp->showColorLegend(legendOn);
150  sp->legend()->setAutoScale(true);
151  sp->legend()->setMajors (legendMajorTicks) ;
152 
153  labelsDist=0;
154 
155  scaleType=QVector<int>(3);
156  for (int j=0;j<3;j++)
157  scaleType[j]=0;
158 
159  pointStyle = None;
160  func = 0;
161  alpha = 1.0;
162  barsRad = 0.007;
163  pointSize = 5; smooth = false;
164  crossHairRad = 0.03, crossHairLineWidth = 2;
165  crossHairSmooth = true, crossHairBoxed = false;
166  conesQuality = 32; conesRad = 0.5;
167 
168  style_ = NOPLOT;
169  this->setWidget(d_main_widget);
170  initCoord();
171 
172  connect(sp,SIGNAL(rotationChanged(double, double, double)),this,SLOT(rotationChanged(double, double, double)));
173  connect(sp,SIGNAL(zoomChanged(double)),this,SLOT(zoomChanged(double)));
174  connect(sp,SIGNAL(scaleChanged(double, double, double)),this,SLOT(scaleChanged(double, double, double)));
175  connect(sp,SIGNAL(shiftChanged(double, double, double)),this,SLOT(shiftChanged(double, double, double)));
176 }
177 
179 {
180  sp->makeCurrent();
181  for (unsigned i=0; i!=sp->coordinates()->axes.size(); ++i)
182  {
183  sp->coordinates()->axes[i].setMajors(5);
184  sp->coordinates()->axes[i].setMinors(5);
185  }
186 
187  QString s = tr("X axis");
188  sp->coordinates()->axes[X1].setLabelString(s);
189  sp->coordinates()->axes[X2].setLabelString(s);
190  sp->coordinates()->axes[X3].setLabelString(s);
191  sp->coordinates()->axes[X4].setLabelString(s);
192  labels<<s;
193 
194  s = tr("Y axis");
195  sp->coordinates()->axes[Y1].setLabelString(s);
196  sp->coordinates()->axes[Y2].setLabelString(s);
197  sp->coordinates()->axes[Y3].setLabelString(s);
198  sp->coordinates()->axes[Y4].setLabelString(s);
199  labels<<s;
200 
201  s = tr("Z axis");
202  sp->coordinates()->axes[Z1].setLabelString(s);
203  sp->coordinates()->axes[Z2].setLabelString(s);
204  sp->coordinates()->axes[Z3].setLabelString(s);
205  sp->coordinates()->axes[Z4].setLabelString(s);
206  labels<<s;
207 
208  sp->setCoordinateStyle(BOX);
209  sp->coordinates()->setAutoScale(false);
210 }
211 
212 void Graph3D::addFunction(const QString& s,double xl,double xr,double yl,
213  double yr,double zl,double zr)
214 {
215  sp->makeCurrent();
216  sp->resize(this->size());
217 
218  func= new UserFunction(s, *sp);
219 
220  func->setMesh(41,31);
221  func->setDomain(xl,xr,yl,yr);
222  func->setMinZ(zl);
223  func->setMaxZ(zr);
224  func->create();
225 
226  sp->legend()->setLimits(zl,zr);
227 
228  if (sp->plotStyle() == NOPLOT)
229  {
230  sp->setPlotStyle(FILLED);
231  style_=FILLED;
232  pointStyle = None;
233  }
234  sp->createCoordinateSystem(Triple(xl, yl, zl), Triple(xr, yr, zr));
235  findBestLayout();
236 }
237 
238 void Graph3D::insertFunction(const QString& s,double xl,double xr,double yl,
239  double yr,double zl,double zr)
240 {
241  addFunction(s,xl,xr,yl,yr,zl,zr);
242  update();
243 }
244 
245 void Graph3D::addData(Table* table, int xcol, int ycol)
246 {
247  worksheet=table;
248  int r=table->numRows();
249  int i, xmesh=0, ymesh=2;
250  for (i = 0; i < r; i++)
251  {
252  if (!table->column(xcol)->isInvalid(i) && !table->column(ycol)->isInvalid(i))
253  xmesh++;
254  }
255 
256  if (xmesh == 0)
257  xmesh++;
258 
259  double **data = Matrix::allocateMatrixData(xmesh, ymesh);
260  gsl_vector * x = gsl_vector_alloc (xmesh);
261  gsl_vector * y = gsl_vector_alloc (xmesh);
262 
263  for (int j = 0; j < ymesh; j++)
264  {
265  int k=0;
266  for (i = 0; i < r; i++)
267  {
268  if (!table->column(xcol)->isInvalid(i) && !table->column(ycol)->isInvalid(i))
269  {
270  gsl_vector_set (x, k, table->cell(i, xcol));
271 
272  double yv = table->cell(i, ycol);
273  gsl_vector_set (y, k, yv);
274  data[k][j] = yv;
275  k++;
276  }
277  }
278  }
279 
280  double maxy=gsl_vector_max(y);
281  double maxz=0.6*maxy;
282  sp->makeCurrent();
283  sp->legend()->setLimits(gsl_vector_min(y),maxy);
284  sp->loadFromData(data, xmesh, ymesh, gsl_vector_min(x),gsl_vector_max(x),0,maxz);
285 
286  if (d_autoscale)
287  findBestLayout();
288 
289  gsl_vector_free (x);
290  gsl_vector_free (y);
292 }
293 
294 void Graph3D::addData(Table* table,const QString& colName)
295 {
296  int ycol = table->colIndex(colName);
297  int xcol=table->colX(ycol);
298  plotAssociation = table->colName(xcol)+"(X)," + colName + "(Y)";
299 
300  addData(table, xcol, ycol);
301 }
302 
303 void Graph3D::addData(Table* table,const QString& xColName,const QString& yColName)
304 {
305  int xcol=table->colIndex(xColName);
306  plotAssociation = table->colName(xcol)+"(X)," + yColName+"(Y)";
307 
308  addData(table, xcol, table->colIndex(yColName));
309 }
310 
312 {
313  if (d_matrix == m)
314  return;
315 
316  addMatrixData(m);
317 }
318 
320 {
321  if (d_matrix == m)
322  return;
323 
324  bool first_time = false;
325  if(!d_matrix)
326  first_time = true;
327 
328  d_matrix = m;
329  plotAssociation = "matrix<" + QString(m->name()) + ">";
330 
331  int cols = m->numCols();
332  int rows = m->numRows();
333  double **data_matrix = Matrix::allocateMatrixData(rows, cols);
334  for (int i = 0; i < rows; i++ )
335  {
336  for (int j = 0; j < cols; j++)
337  data_matrix[i][j] = m->cell(i,j);
338  }
339 
340  sp->makeCurrent();
341  sp->loadFromData(data_matrix, rows, cols, m->xStart(), m->xEnd(),
342  m->yStart(), m->yEnd());
343 
344  double start, end;
345  sp->coordinates()->axes[Z1].limits (start, end);
346  sp->legend()->setLimits(start, end);
347  sp->legend()->setMajors(legendMajorTicks);
348 
349  Matrix::freeMatrixData(data_matrix, rows);
350 
351  if (d_autoscale || first_time)
352  findBestLayout();
353  update();
354 }
355 
356 void Graph3D::addMatrixData(Matrix* m, double xl, double xr,
357  double yl, double yr, double zl, double zr)
358 {
359  d_matrix = m;
360  plotAssociation = "matrix<" + QString(m->name()) + ">";
361 
362  updateScalesFromMatrix(xl, xr, yl, yr, zl, zr);
363 }
364 
365 void Graph3D::addData(Table* table,const QString& xColName,const QString& yColName,
366  double xl, double xr, double yl, double yr, double zl, double zr)
367 {
368  worksheet=table;
369  int r=table->numRows();
370  int xcol=table->colIndex(xColName);
371  int ycol=table->colIndex(yColName);
372 
373  QString s=table->colName(xcol)+"(X),";
374  s+=yColName+"(Y)";
375  plotAssociation = s;
376 
377  int i, j, xmesh=0, ymesh=2;
378  double xv, yv;
379 
380  for (i = 0; i < r; i++)
381  {
382  if (!table->column(xcol)->isInvalid(i) && !table->column(ycol)->isInvalid(i))
383  {
384  xv=table->cell(i, xcol);
385  if (xv>=xl && xv <= xr)
386  xmesh++;
387  }
388  }
389 
390  if (xmesh == 0)
391  xmesh++;
392 
393  double **data = Matrix::allocateMatrixData(xmesh, ymesh);
394  for ( j = 0; j < ymesh; j++)
395  {
396  int k=0;
397  for ( i = 0; i < r; i++)
398  {
399  if (!table->column(xcol)->isInvalid(i) && !table->column(ycol)->isInvalid(i))
400  {
401  xv=table->cell(i,xcol);
402  if (xv>=xl && xv <= xr)
403  {
404  yv=table->cell(i,ycol);
405  if (yv > zr)
406  data[k][j] = zr;
407  else if (yv < zl)
408  data[k][j] = zl;
409  else
410  data[k][j] = yv;
411  k++;
412  }
413  }
414  }
415  }
416  sp->makeCurrent();
417  sp->loadFromData(data, xmesh, ymesh, xl, xr, yl, yr);
418  sp->createCoordinateSystem(Triple(xl, yl, zl), Triple(xr, yr, zr));
419  sp->legend()->setLimits(zl, zr);
420  sp->legend()->setMajors(legendMajorTicks);
421 
423 }
424 
425 void Graph3D::insertNewData(Table* table, const QString& colName)
426 {
427  int zCol=table->colIndex(colName);
428  int yCol=table->colY(zCol);
429  int xCol=table->colX(zCol);
430 
431  addData(table, xCol, yCol, zCol, Trajectory);
432  update();
433 }
434 
435 void Graph3D::changeDataColumn(Table* table, const QString& colName)
436 {
437  int zCol=table->colIndex(colName);
438  int yCol=table->colY(zCol);
439  int xCol=table->colX(zCol);
440 
441  plotAssociation = table->colName(xCol)+"(X)," + table->colName(yCol)+"(Y),";
442  plotAssociation += colName+"(Z)";
443 
444  updateDataXYZ(table, xCol, yCol, zCol);
445  if (d_autoscale)
446  findBestLayout();
447 }
448 
449 void Graph3D::addData(Table* table, int xCol,int yCol,int zCol, int type)
450 {
451  worksheet=table;
452  int r=table->numRows();
453 
454  QString s=table->colName(xCol)+"(X),";
455  s+=table->colName(yCol)+"(Y),";
456  s+=table->colName(zCol)+"(Z)";
457  plotAssociation = s;
458 
459  int i,j,columns=0;
460  for ( i = 0; i < r; i++)
461  {
462  if (!table->column(xCol)->isInvalid(i) && !table->column(yCol)->isInvalid(i) && !table->column(zCol)->isInvalid(i))
463  columns++;
464  }
465 
466  if (columns == 0)
467  columns++;
468 
469  Qwt3D::Triple **data=allocateData(columns,columns);
470  for (j = 0; j < columns; j++)
471  {
472  int k=0;
473  for ( i = 0; i < r; i++)
474  {
475  if (!table->column(xCol)->isInvalid(i) && !table->column(yCol)->isInvalid(i) && !table->column(zCol)->isInvalid(i))
476  {
477  double xv=table->cell(i,xCol);
478  double yv=table->cell(i,yCol);
479  double zv=table->cell(i,zCol);
480 
481  data[k][j] = Triple(xv,yv,zv);
482  k++;
483  }
484  }
485  }
486 
487  sp->makeCurrent();
488  sp->loadFromData (data, columns, columns, false,false);
489 
490  double start, end;
491  sp->coordinates()->axes[Z1].limits (start, end);
492  sp->legend()->setLimits(start, end);
493  sp->legend()->setMajors(legendMajorTicks);
494 
495  if (type == Scatter)
496  {
497  Dot d(pointSize, smooth);
498  sp->setPlotStyle(d);
500  style_ = Qwt3D::USER;
501  }
502  else if (type == Trajectory)
503  {
504  legendOn=false;
505  sp->showColorLegend(legendOn);
506  }
507  else
508  {
509  sp->setPlotStyle(Bar(barsRad));
511  style_ = Qwt3D::USER;
512  }
513 
514  if (d_autoscale)
515  findBestLayout();
516  deleteData(data,columns);
517 }
518 
519 void Graph3D::addData(Table* table, int xCol,int yCol,int zCol,
520  double xl, double xr, double yl, double yr, double zl, double zr)
521 {
522  worksheet=table;
523  int r=table->numRows();
524 
525  QString s=table->colName(xCol)+"(X),";
526  s+=table->colName(yCol)+"(Y),";
527  s+=table->colName(zCol)+"(Z)";
528  plotAssociation = s;
529 
530  int i,j,columns=0;
531  double xv,yv;
532  for ( i = 0; i < r; i++)
533  {
534  if (!table->column(xCol)->isInvalid(i) && !table->column(yCol)->isInvalid(i) && !table->column(zCol)->isInvalid(i))
535  {
536  xv=table->cell(i,xCol);
537  yv=table->cell(i,yCol);
538  if (xv >= xl && xv <= xr && yv >= yl && yv <= yr)
539  columns++;
540  }
541  }
542 
543  if (columns == 0)
544  columns++;
545 
546  Qwt3D::Triple **data=allocateData(columns,columns);
547  for (j = 0; j < columns; j++)
548  {
549  int k=0;
550  for ( i = 0; i < r; i++)
551  {
552  if (!table->column(xCol)->isInvalid(i) && !table->column(yCol)->isInvalid(i) && !table->column(zCol)->isInvalid(i))
553  {
554  xv=table->cell(i,xCol);
555  yv=table->cell(i,yCol);
556  if (xv >= xl && xv <= xr && yv >= yl && yv <= yr)
557  {
558  double zv=table->cell(i,zCol);
559  if (zv > zr)
560  data[k][j] = Triple(xv,yv,zr);
561  else if (zv < zl)
562  data[k][j] = Triple(xv,yv,zl);
563  else
564  data[k][j] = Triple(xv,yv,zv);
565  k++;
566  }
567  }
568  }
569  }
570  sp->makeCurrent();
571  sp->loadFromData (data, columns, columns, false, false);
572  sp->createCoordinateSystem(Triple(xl, yl, zl), Triple(xr, yr, zr));
573  sp->legend()->setLimits(zl, zr);
574  sp->legend()->setMajors(legendMajorTicks);
575 
576  deleteData(data,columns);
577 }
578 
580 {
581  if (func)// function plot
582  return;
583 
584  QString name = plotAssociation;
585  int pos=name.indexOf("_",0);
586  int posX=name.indexOf("(",pos);
587  QString xColName=name.mid(pos+1,posX-pos-1);
588 
589  pos=name.indexOf(",",posX);
590  posX=name.indexOf("(",pos);
591  QString yColName=name.mid(pos+1,posX-pos-1);
592 
593  int xCol=table->colIndex(xColName);
594  int yCol=table->colIndex(yColName);
595 
596  if (name.contains("(Z)",Qt::CaseSensitive))
597  {
598  pos=name.indexOf(",",posX);
599  posX=name.indexOf("(",pos);
600  QString zColName=name.mid(pos+1,posX-pos-1);
601  int zCol=table->colIndex(zColName);
602  updateDataXYZ(table, xCol, yCol, zCol);
603  }
604  else
605  updateDataXY(table, xCol, yCol);
606 
607  if (d_autoscale)
608  findBestLayout();
609  update();
610 }
611 
612 void Graph3D::updateDataXY(Table* table, int xCol, int yCol)
613 {
614  int r=table->numRows();
615  int i, j, xmesh=0, ymesh=2;
616 
617  for (i = 0; i < r; i++)
618  {
619  if (!table->column(xCol)->isInvalid(i) && !table->column(yCol)->isInvalid(i))
620  xmesh++;
621  }
622 
623  if (xmesh<2)
624  {
625  sp->setPlotStyle(NOPLOT);
626  update();
627  return;
628  }
629 
630  double **data = Matrix::allocateMatrixData(xmesh, ymesh);
631  gsl_vector * x = gsl_vector_alloc (xmesh);
632  gsl_vector * y = gsl_vector_alloc (xmesh);
633 
634  for ( j = 0; j < ymesh; j++)
635  {
636  int k=0;
637  for ( i = 0; i < r; i++)
638  {
639  if (!table->column(xCol)->isInvalid(i) && !table->column(yCol)->isInvalid(i))
640  {
641  double xv=table->cell(i,xCol);
642  double yv=table->cell(i,yCol);
643 
644  gsl_vector_set (x, k, xv);
645  gsl_vector_set (y, k, yv);
646 
647  data[k][j] =yv;
648  k++;
649  }
650  }
651  }
652 
653  double minx=gsl_vector_min (x);
654  double maxx=gsl_vector_max(x);
655  double minz=gsl_vector_min (y);
656  double maxz=gsl_vector_max(y);
657  double miny, maxy;
658 
659  sp->makeCurrent();
661  sp->coordinates()->axes[Y1].limits (miny,maxy); //actual Y scale limits
662  sp->loadFromData(data, xmesh, ymesh, minx, maxx, miny, maxy);
663  sp->legend()->setLimits(minz,maxz);
664  sp->legend()->setMajors(legendMajorTicks);
665 
666  gsl_vector_free (x);gsl_vector_free (y);
668 }
669 
670 void Graph3D::updateDataXYZ(Table* table, int xCol, int yCol, int zCol)
671 {
672  int r=table->numRows();
673  int i,j,columns=0;
674 
675  for ( i = 0; i < r; i++)
676  {
677  if (!table->column(xCol)->isInvalid(i) && !table->column(yCol)->isInvalid(i) && !table->column(zCol)->isInvalid(i))
678  columns++;
679  }
680 
681  if (columns<2)
682  {
683  sp->setPlotStyle(NOPLOT);
684  update();
685  return;
686  }
687 
688  Qwt3D::Triple **data=allocateData(columns,columns);
689  gsl_vector * z = gsl_vector_alloc (columns);
690 
691  for ( j = 0; j < columns; j++)
692  {
693  int k=0;
694  for ( i = 0; i < r; i++)
695  {
696  if (!table->column(xCol)->isInvalid(i) && !table->column(yCol)->isInvalid(i) && !table->column(zCol)->isInvalid(i))
697  {
698  double xv=table->cell(i,xCol);
699  double yv=table->cell(i,yCol);
700  double zv=table->cell(i,zCol);
701 
702  gsl_vector_set (z, k, zv);
703  data[k][j] = Triple(xv,yv,zv);
704  k++;
705  }
706  }
707  }
708 
709  double minz=gsl_vector_min(z);
710  double maxz=gsl_vector_max(z);
711  gsl_vector_free (z);
712 
713  sp->makeCurrent();
715 
716  sp->loadFromData (data, columns, columns, false,false);
717  sp->legend()->setLimits(minz,maxz);
718  sp->legend()->setMajors(legendMajorTicks);
719 
720  deleteData(data,columns);
721 }
722 
724 {
725  int cols=m->numCols();
726  int rows=m->numRows();
727 
728  double **data = Matrix::allocateMatrixData(rows, cols);
729  for (int i = 0; i < rows; i++ ){
730  for (int j = 0; j < cols; j++)
731  data[i][j] = m->cell(i, j);
732  }
733 
734  sp->loadFromData(data, rows, cols, m->xStart(), m->xEnd(), m->yStart(), m->yEnd());
735 
736  Qwt3D::Axis z_axis = sp->coordinates()->axes[Z1];
737  double start, end;
738  z_axis.limits (start, end);
739  z_axis.setMajors(z_axis.majors());
740  z_axis.setMajors(z_axis.minors());
741 
742  sp->legend()->setLimits(start, end);
743  sp->legend()->setMajors(legendMajorTicks);
744 
746  if (d_autoscale)
747  findBestLayout();
748  update();
749 }
750 
752 {
753  if (sp->plotStyle() != Qwt3D::NOPLOT )
754  return; // the plot was not previousely emptied
755 
756  if (style_== Qwt3D::USER)
757  {// reseting the right user plot style
758  switch (pointStyle)
759  {
760  case None:
761  break;
762 
763  case Dots :
764  sp->setPlotStyle(Dot(pointSize, smooth));
765  break;
766 
767  case VerticalBars :
768  sp->setPlotStyle(Bar(barsRad));
769  break;
770 
771  case HairCross :
772  sp->setPlotStyle(CrossHair(crossHairRad, crossHairLineWidth, crossHairSmooth, crossHairBoxed));
773  break;
774 
775  case Cones :
776  sp->setPlotStyle(Cone3D(conesRad, conesQuality));
777  break;
778  }
779  }
780  else
781  sp->setPlotStyle(style_);
782 }
783 
785 {
786  if (func)
787  return func;
788  else
789  return 0;
790 }
791 
793 {
794  sp->makeCurrent();
795 
796  resetAxesLabels();
797 
798  sp->updateData();
799  sp->updateGL();
800 }
801 
803 {
804  if (labelsDist != val)
805  {
806  labelsDist=val;
807  sp->coordinates()->adjustLabels(val);
808  sp->makeCurrent();
809  sp->updateGL();
810  }
811  emit modified();
812 }
813 
815 {
816  return sp->coordinates()->axes[X1].numberFont();
817 }
818 
819 void Graph3D::setNumbersFont(const QFont& font)
820 {
821  sp->coordinates()->setNumberFont (font);
822  sp->makeCurrent();
823  sp->updateGL();
824 }
825 
826 void Graph3D::setNumbersFont(const QStringList& lst)
827 {
828  QFont fnt=QFont(lst[1],lst[2].toInt(),lst[3].toInt(),lst[4].toInt());
829  sp->coordinates()->setNumberFont(fnt);
830 }
831 
832 void Graph3D::setXAxisLabelFont(const QFont& fnt)
833 {
834  sp->coordinates()->axes[X1].setLabelFont(fnt);
835  sp->coordinates()->axes[X2].setLabelFont(fnt);
836  sp->coordinates()->axes[X3].setLabelFont(fnt);
837  sp->coordinates()->axes[X4].setLabelFont(fnt);
838 }
839 
840 void Graph3D::setYAxisLabelFont(const QFont& fnt)
841 {
842  sp->coordinates()->axes[Y1].setLabelFont(fnt);
843  sp->coordinates()->axes[Y2].setLabelFont(fnt);
844  sp->coordinates()->axes[Y3].setLabelFont(fnt);
845  sp->coordinates()->axes[Y4].setLabelFont(fnt);
846 }
847 
848 void Graph3D::setZAxisLabelFont(const QFont& fnt)
849 {
850  sp->coordinates()->axes[Z1].setLabelFont(fnt);
851  sp->coordinates()->axes[Z2].setLabelFont(fnt);
852  sp->coordinates()->axes[Z3].setLabelFont(fnt);
853  sp->coordinates()->axes[Z4].setLabelFont(fnt);
854 }
855 
856 void Graph3D::setXAxisLabelFont(const QStringList& lst)
857 {
858  QFont fnt=QFont(lst[1],lst[2].toInt(),lst[3].toInt(),lst[4].toInt());
859  sp->coordinates()->axes[X1].setLabelFont(fnt);
860  sp->coordinates()->axes[X2].setLabelFont(fnt);
861  sp->coordinates()->axes[X3].setLabelFont(fnt);
862  sp->coordinates()->axes[X4].setLabelFont(fnt);
863 }
864 
865 void Graph3D::setYAxisLabelFont(const QStringList& lst)
866 {
867  QFont fnt=QFont(lst[1],lst[2].toInt(),lst[3].toInt(),lst[4].toInt());
868  sp->coordinates()->axes[Y1].setLabelFont(fnt);
869  sp->coordinates()->axes[Y2].setLabelFont(fnt);
870  sp->coordinates()->axes[Y3].setLabelFont(fnt);
871  sp->coordinates()->axes[Y4].setLabelFont(fnt);
872 }
873 
874 void Graph3D::setZAxisLabelFont(const QStringList& lst)
875 {
876  QFont fnt=QFont(lst[1],lst[2].toInt(),lst[3].toInt(),lst[4].toInt());
877  sp->coordinates()->axes[Z1].setLabelFont(fnt);
878  sp->coordinates()->axes[Z2].setLabelFont(fnt);
879  sp->coordinates()->axes[Z3].setLabelFont(fnt);
880  sp->coordinates()->axes[Z4].setLabelFont(fnt);
881 }
882 
884 {
885  QStringList lst;
886  double majorl,minorl;
887 
888  sp->coordinates()->axes[X1].ticLength (majorl,minorl);
889  lst<<QString::number(majorl);
890  lst<<QString::number(minorl);
891 
892  sp->coordinates()->axes[Y1].ticLength (majorl,minorl);
893  lst<<QString::number(majorl);
894  lst<<QString::number(minorl);
895 
896  sp->coordinates()->axes[Z1].ticLength (majorl,minorl);
897  lst<<QString::number(majorl);
898  lst<<QString::number(minorl);
899 
900  return lst;
901 }
902 
903 void Graph3D::setTickLengths(const QStringList& lst)
904 {
905  double majorl,minorl;
906  QStringList tick_length = lst;
907  if (int(lst.count()) > 6)
908  tick_length.removeAll(tick_length.first());
909 
910  majorl=tick_length[0].toDouble();
911  minorl=tick_length[1].toDouble();
912  sp->coordinates()->axes[X1].setTicLength (majorl,minorl);
913  sp->coordinates()->axes[X2].setTicLength (majorl,minorl);
914  sp->coordinates()->axes[X3].setTicLength (majorl,minorl);
915  sp->coordinates()->axes[X4].setTicLength (majorl,minorl);
916 
917  majorl=tick_length[2].toDouble();
918  minorl=tick_length[3].toDouble();
919  sp->coordinates()->axes[Y1].setTicLength (majorl,minorl);
920  sp->coordinates()->axes[Y2].setTicLength (majorl,minorl);
921  sp->coordinates()->axes[Y3].setTicLength (majorl,minorl);
922  sp->coordinates()->axes[Y4].setTicLength (majorl,minorl);
923 
924  majorl=tick_length[4].toDouble();
925  minorl=tick_length[5].toDouble();
926  sp->coordinates()->axes[Z1].setTicLength (majorl,minorl);
927  sp->coordinates()->axes[Z2].setTicLength (majorl,minorl);
928  sp->coordinates()->axes[Z3].setTicLength (majorl,minorl);
929  sp->coordinates()->axes[Z4].setTicLength (majorl,minorl);
930 }
931 
932 void Graph3D::updateTickLength(int axis,double majorLength, double minorLength)
933 {
934  double majorl,minorl;
935  switch(axis)
936  {
937  case 0:
938  sp->coordinates()->axes[X1].ticLength (majorl,minorl);
939  if (majorl != majorLength || minorl != minorLength)
940  {
941  sp->coordinates()->axes[X1].setTicLength (majorLength,minorLength);
942  sp->coordinates()->axes[X2].setTicLength (majorLength,minorLength);
943  sp->coordinates()->axes[X3].setTicLength (majorLength,minorLength);
944  sp->coordinates()->axes[X4].setTicLength (majorLength,minorLength);
945  }
946  break;
947 
948  case 1:
949  sp->coordinates()->axes[Y1].ticLength (majorl,minorl);
950  if (majorl != majorLength || minorl != minorLength)
951  {
952  sp->coordinates()->axes[Y1].setTicLength (majorLength,minorLength);
953  sp->coordinates()->axes[Y2].setTicLength (majorLength,minorLength);
954  sp->coordinates()->axes[Y3].setTicLength (majorLength,minorLength);
955  sp->coordinates()->axes[Y4].setTicLength (majorLength,minorLength);
956  }
957  break;
958 
959  case 2:
960  sp->coordinates()->axes[Z1].ticLength (majorl,minorl);
961  if (majorl != majorLength || minorl != minorLength)
962  {
963  sp->coordinates()->axes[Z1].setTicLength (majorLength,minorLength);
964  sp->coordinates()->axes[Z2].setTicLength (majorLength,minorLength);
965  sp->coordinates()->axes[Z3].setTicLength (majorLength,minorLength);
966  sp->coordinates()->axes[Z4].setTicLength (majorLength,minorLength);
967  }
968  break;
969  }
970  sp->updateGL();
971 }
972 
973 void Graph3D::rotationChanged(double, double, double)
974 {
975  emit modified();
976 }
977 
978 void Graph3D::scaleChanged(double, double, double)
979 {
980  emit modified();
981 }
982 
983 void Graph3D::shiftChanged(double, double, double)
984 {
985  emit modified();
986 }
987 
989 {
990  emit modified();
991 }
992 
994 {
995  sp->coordinates()->axes[X1].setLabelString(labels[0]);
996  sp->coordinates()->axes[X2].setLabelString(labels[0]);
997  sp->coordinates()->axes[X3].setLabelString(labels[0]);
998  sp->coordinates()->axes[X4].setLabelString(labels[0]);
999 
1000  sp->coordinates()->axes[Y1].setLabelString(labels[1]);
1001  sp->coordinates()->axes[Y2].setLabelString(labels[1]);
1002  sp->coordinates()->axes[Y3].setLabelString(labels[1]);
1003  sp->coordinates()->axes[Y4].setLabelString(labels[1]);
1004 
1005  sp->coordinates()->axes[Z1].setLabelString(labels[2]);
1006  sp->coordinates()->axes[Z2].setLabelString(labels[2]);
1007  sp->coordinates()->axes[Z3].setLabelString(labels[2]);
1008  sp->coordinates()->axes[Z4].setLabelString(labels[2]);
1009 }
1010 
1011 void Graph3D::setAxesLabels(const QStringList& l)
1012 {
1013  QString label= l[0];
1014  sp->coordinates()->axes[X1].setLabelString(label);
1015  sp->coordinates()->axes[X2].setLabelString(label);
1016  sp->coordinates()->axes[X3].setLabelString(label);
1017  sp->coordinates()->axes[X4].setLabelString(label);
1018 
1019  label= l[1];
1020  sp->coordinates()->axes[Y1].setLabelString(label);
1021  sp->coordinates()->axes[Y2].setLabelString(label);
1022  sp->coordinates()->axes[Y3].setLabelString(label);
1023  sp->coordinates()->axes[Y4].setLabelString(label);
1024 
1025  label= l[2];
1026  sp->coordinates()->axes[Z1].setLabelString(label);
1027  sp->coordinates()->axes[Z2].setLabelString(label);
1028  sp->coordinates()->axes[Z3].setLabelString(label);
1029  sp->coordinates()->axes[Z4].setLabelString(label);
1030 
1031  labels=l;
1032 }
1033 
1034 void Graph3D::updateLabel(int axis,const QString& label, const QFont& f)
1035 {
1036  switch(axis)
1037  {
1038  case 0:
1039  if (labels[0] != label)
1040  {
1041  sp->coordinates()->axes[X1].setLabelString(label);
1042  sp->coordinates()->axes[X2].setLabelString(label);
1043  sp->coordinates()->axes[X3].setLabelString(label);
1044  sp->coordinates()->axes[X4].setLabelString(label);
1045  labels[0]=label;
1046  }
1047  if (sp->coordinates()->axes[X1].labelFont() != f)
1048  {
1049  sp->coordinates()->axes[X1].setLabelFont (f);
1050  sp->coordinates()->axes[X2].setLabelFont (f);
1051  sp->coordinates()->axes[X3].setLabelFont (f);
1052  sp->coordinates()->axes[X4].setLabelFont (f);
1053  }
1054  break;
1055 
1056  case 1:
1057  if (labels[1] != label)
1058  {
1059  sp->coordinates()->axes[Y1].setLabelString(label);
1060  sp->coordinates()->axes[Y2].setLabelString(label);
1061  sp->coordinates()->axes[Y3].setLabelString(label);
1062  sp->coordinates()->axes[Y4].setLabelString(label);
1063 
1064  labels[1]=label;
1065  }
1066  if (sp->coordinates()->axes[Y1].labelFont() != f)
1067  {
1068  sp->coordinates()->axes[Y1].setLabelFont (f);
1069  sp->coordinates()->axes[Y2].setLabelFont (f);
1070  sp->coordinates()->axes[Y3].setLabelFont (f);
1071  sp->coordinates()->axes[Y4].setLabelFont (f);
1072  }
1073  break;
1074 
1075  case 2:
1076  if (labels[2] != label)
1077  {
1078  sp->coordinates()->axes[Z1].setLabelString(label);
1079  sp->coordinates()->axes[Z2].setLabelString(label);
1080  sp->coordinates()->axes[Z3].setLabelString(label);
1081  sp->coordinates()->axes[Z4].setLabelString(label);
1082  labels[2]=label;
1083  }
1084  if (sp->coordinates()->axes[Z1].labelFont() != f)
1085  {
1086  sp->coordinates()->axes[Z1].setLabelFont (f);
1087  sp->coordinates()->axes[Z2].setLabelFont (f);
1088  sp->coordinates()->axes[Z3].setLabelFont (f);
1089  sp->coordinates()->axes[Z4].setLabelFont (f);
1090  }
1091  break;
1092  }
1093 
1094  sp->makeCurrent();
1095  sp->updateGL();
1096  emit modified();
1097 }
1098 
1100 {
1101  return sp->coordinates()->axes[X1].labelFont();
1102 }
1103 
1105 {
1106  return sp->coordinates()->axes[Y1].labelFont();
1107 }
1108 
1110 {
1111  return sp->coordinates()->axes[Z1].labelFont();
1112 }
1113 
1115 {
1116  double start,stop;
1117  sp->coordinates()->axes[X1].limits (start,stop);
1118  return start;
1119 }
1120 
1122 {
1123  double start,stop;
1124  sp->coordinates()->axes[X1].limits (start,stop);
1125  return stop;
1126 }
1127 
1129 {
1130  double start,stop;
1131  sp->coordinates()->axes[Y1].limits (start,stop);
1132  return start;
1133 }
1134 
1136 {
1137  double start,stop;
1138  sp->coordinates()->axes[Y1].limits (start,stop);
1139  return stop;
1140 }
1141 
1143 {
1144  double start,stop;
1145  sp->coordinates()->axes[Z1].limits (start,stop);
1146  return start;
1147 }
1148 
1150 {
1151  double start,stop;
1152  sp->coordinates()->axes[Z1].limits(start, stop);
1153  return stop;
1154 }
1155 
1157 {
1158  QStringList limits;
1159  double start,stop;
1160  int majors,minors;
1161 
1162  sp->coordinates()->axes[X1].limits (start,stop);
1163  majors=sp->coordinates()->axes[X1].majors();
1164  minors=sp->coordinates()->axes[X1].minors();
1165 
1166  limits<<QString::number(start);
1167  limits<<QString::number(stop);
1168  limits<<QString::number(majors);
1169  limits<<QString::number(minors);
1170  limits<<QString::number(scaleType[0]);
1171 
1172  sp->coordinates()->axes[Y1].limits (start,stop);
1173  majors=sp->coordinates()->axes[Y1].majors();
1174  minors=sp->coordinates()->axes[Y1].minors();
1175 
1176  limits<<QString::number(start);
1177  limits<<QString::number(stop);
1178  limits<<QString::number(majors);
1179  limits<<QString::number(minors);
1180  limits<<QString::number(scaleType[1]);
1181 
1182  sp->coordinates()->axes[Z1].limits (start,stop);
1183  majors=sp->coordinates()->axes[Z1].majors();
1184  minors=sp->coordinates()->axes[Z1].minors();
1185 
1186  limits<<QString::number(start);
1187  limits<<QString::number(stop);
1188  limits<<QString::number(majors);
1189  limits<<QString::number(minors);
1190  limits<<QString::number(scaleType[2]);
1191 
1192  return limits;
1193 }
1194 
1195 QStringList Graph3D::scaleTicks()
1196 {
1197  QStringList limits;
1198  int majors,minors;
1199 
1200  majors=sp->coordinates()->axes[X1].majors();
1201  minors=sp->coordinates()->axes[X1].minors();
1202  limits<<QString::number(majors);
1203  limits<<QString::number(minors);
1204 
1205  majors=sp->coordinates()->axes[Y1].majors();
1206  minors=sp->coordinates()->axes[Y1].minors();
1207  limits<<QString::number(majors);
1208  limits<<QString::number(minors);
1209 
1210  majors=sp->coordinates()->axes[Z1].majors();
1211  minors=sp->coordinates()->axes[Z1].minors();
1212  limits<<QString::number(majors);
1213  limits<<QString::number(minors);
1214 
1215  return limits;
1216 }
1217 
1218 void Graph3D::updateScale(int axis,const QStringList& options)
1219 {
1220  double xMin,xMax,yMin,yMax,zMin,zMax;
1221  double *min, *max;
1222  int majors, minors, newMaj, newMin;
1223  Qwt3D::Axis *targetAxes[4];
1224 
1225  sp->makeCurrent();
1226 
1227  switch (axis) {
1228  case 0:
1229  targetAxes[0] = &sp->coordinates()->axes[X1];
1230  targetAxes[1] = &sp->coordinates()->axes[X2];
1231  targetAxes[2] = &sp->coordinates()->axes[X3];
1232  targetAxes[3] = &sp->coordinates()->axes[X4];
1233  min = &xMin; max = &xMax;
1234  break;
1235  case 1:
1236  targetAxes[0] = &sp->coordinates()->axes[Y1];
1237  targetAxes[1] = &sp->coordinates()->axes[Y2];
1238  targetAxes[2] = &sp->coordinates()->axes[Y3];
1239  targetAxes[3] = &sp->coordinates()->axes[Y4];
1240  min = &yMin; max = &yMax;
1241  break;
1242  case 2:
1243  targetAxes[0] = &sp->coordinates()->axes[Z1];
1244  targetAxes[1] = &sp->coordinates()->axes[Z2];
1245  targetAxes[2] = &sp->coordinates()->axes[Z3];
1246  targetAxes[3] = &sp->coordinates()->axes[Z4];
1247  min = &zMin; max = &zMax;
1248  break;
1249  default:
1250  throw runtime_error("invalid axis");
1251  }
1252 
1253  majors = targetAxes[0]->majors();
1254  minors = targetAxes[0]->minors();
1255 
1256  sp->coordinates()->axes[X1].limits(xMin,xMax);
1257  sp->coordinates()->axes[Y1].limits(yMin,yMax);
1258  sp->coordinates()->axes[Z1].limits(zMin,zMax);
1259 
1260  if (*min != options[0].toDouble() || *max != options[1].toDouble()) {
1261  *min = options[0].toDouble();
1262  *max = options[1].toDouble();
1263  if (func) {
1264  func->setDomain(xMin, xMax, yMin, yMax);
1265  func->setMinZ(zMin); func->setMaxZ(zMax);
1266  func->create();
1267  sp->createCoordinateSystem(Triple(xMin, yMin, zMin), Triple(xMax, yMax, zMax));
1268  } else
1269  updateScales(xMin, xMax, yMin, yMax, zMin, zMax);
1270  sp->legend()->setLimits(zMin, zMax);
1271  }
1272 
1273  if (QString::number(scaleType[axis]) != options[4]) {
1274  if (options[4] == "0") {
1275  targetAxes[0]->setScale(LINEARSCALE);
1276  if (axis == 2) sp->legend()->setScale(LINEARSCALE);
1277  scaleType[axis] = 0;
1278  } else {
1279  targetAxes[0]->setScale(LOG10SCALE);
1280  if (axis == 2) sp->legend()->setScale(LOG10SCALE);
1281  scaleType[axis] = 1;
1282  }
1283  }
1284 
1285 
1286  newMaj = options[2].toInt();
1287  if (majors != newMaj)
1288  for (int i=0; i<4; i++)
1289  targetAxes[i]->setMajors(newMaj);
1290 
1291  newMin = options[3].toInt();
1292  if (minors != newMin)
1293  for (int i=0; i<4; i++)
1294  targetAxes[i]->setMinors(newMin);
1295 
1296  update();
1297  emit modified();
1298 }
1299 
1300 void Graph3D::updateScales(double xl, double xr, double yl, double yr, double zl, double zr)
1301 {
1302  QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
1303 
1304  if (d_matrix)
1305  updateScalesFromMatrix(xl, xr, yl, yr, zl, zr);
1306  else
1307  {
1308  QString name= plotAssociation;
1309 
1310  int pos=name.indexOf("_",0);
1311  int posX=name.indexOf("(",pos);
1312  QString xColName=name.mid(pos+1,posX-pos-1);
1313  int xCol=worksheet->colIndex(xColName);
1314 
1315  pos=name.indexOf(",",posX);
1316  posX=name.indexOf("(",pos);
1317  QString yColName=name.mid(pos+1,posX-pos-1);
1318  int yCol=worksheet->colIndex(yColName);
1319 
1320  if (name.endsWith("(Z)",Qt::CaseSensitive))
1321  {
1322  pos=name.indexOf(",",posX);
1323  posX=name.indexOf("(",pos);
1324  QString zColName=name.mid(pos+1,posX-pos-1);
1325  int zCol=worksheet->colIndex(zColName);
1326 
1327  updateScales(xl, xr, yl, yr, zl, zr, xCol, yCol, zCol);
1328  }
1329  else if (name.endsWith("(Y)",Qt::CaseSensitive))
1330  updateScales(xl, xr, yl, yr, zl, zr, xCol, yCol);
1331  }
1332 
1333  QApplication::restoreOverrideCursor();
1334 }
1335 
1336 void Graph3D::updateScalesFromMatrix(double xl, double xr, double yl,
1337  double yr, double zl, double zr)
1338 {
1339  double xStart = qMin(d_matrix->xStart(), d_matrix->xEnd());
1340  double xEnd = qMax(d_matrix->xStart(), d_matrix->xEnd());
1341  double yStart = qMin(d_matrix->yStart(), d_matrix->yEnd());
1342  double yEnd = qMax(d_matrix->yStart(), d_matrix->yEnd());
1343 
1344  double dx = fabs((xEnd - xStart)/double(d_matrix->numCols()-1));
1345  double dy = fabs((yEnd - yStart)/double(d_matrix->numRows()-1));
1346 
1347  int nc = int(fabs(xr - xl)/dx)+1;
1348  int nr = int(fabs(yr - yl)/dy)+1;
1349 
1350  double x_begin = qMin(xl, xr);
1351  double y_begin = qMin(yl, yr);
1352 
1353  double **data_matrix = Matrix::allocateMatrixData(nc, nr);
1354  for (int i = 0; i < nc; i++){
1355  double x = x_begin + i*dx;
1356  for (int j = 0; j < nr; j++){
1357  double y = y_begin + j*dy;
1358  if (x >= xStart && x <= xEnd && y >= yStart && y <= yEnd){
1359  int k = abs((y - yStart)/dy);
1360  int l = abs((x - xStart)/dx);
1361  double val = d_matrix->cell(k, l);
1362  if (val > zr)
1363  data_matrix[i][j] = zr;
1364  else if (val < zl)
1365  data_matrix[i][j] = zl;
1366  else
1367  data_matrix[i][j] = val;
1368  } else
1369  data_matrix[i][j] = 0.0;
1370  }
1371  }
1372  sp->loadFromData(data_matrix, nc, nr, xl, xr, yl, yr);
1373  Matrix::freeMatrixData(data_matrix, nc);
1374 
1375  sp->createCoordinateSystem(Triple(xl, yl, zl), Triple(xr, yr, zr));
1376  sp->legend()->setLimits(zl, zr);
1377  sp->legend()->setMajors(legendMajorTicks);
1378  update();
1379 }
1380 
1381 void Graph3D::updateScales(double xl, double xr, double yl, double yr,double zl, double zr,
1382  int xcol, int ycol)
1383 {
1384  int r=worksheet->numRows();
1385  int i, j, xmesh=0, ymesh=2;
1386  double xv, yv;
1387 
1388  for (i = 0; i < r; i++)
1389  {
1390  if (!worksheet->column(xcol)->isInvalid(i) && !worksheet->column(ycol)->isInvalid(i))
1391  {
1392  xv=worksheet->cell(i,xcol);
1393  if (xv >= xl && xv <= xr)
1394  xmesh++;
1395  }
1396  }
1397 
1398  if (xmesh == 0)
1399  xmesh++;
1400 
1401  double **data = Matrix::allocateMatrixData(xmesh, ymesh);
1402 
1403  for ( j = 0; j < ymesh; j++)
1404  {
1405  int k=0;
1406  for ( i = 0; i < r; i++)
1407  {
1408  if (!worksheet->column(xcol)->isInvalid(i) && !worksheet->column(ycol)->isInvalid(i))
1409  {
1410  xv=worksheet->cell(i,xcol);
1411  if (xv >= xl && xv <= xr)
1412  {
1413  yv=worksheet->cell(i,ycol);
1414  if (yv > zr)
1415  data[k][j] = zr;
1416  else if (yv < zl)
1417  data[k][j] = zl;
1418  else
1419  data[k][j] = yv;
1420  k++;
1421  }
1422  }
1423  }
1424  }
1425 
1426  sp->loadFromData(data, xmesh, ymesh, xl, xr, yl, yr);
1427  sp->createCoordinateSystem(Triple(xl, yl, zl), Triple(xr, yr, zr));
1428  Matrix::freeMatrixData(data, xmesh);
1429 }
1430 
1431 void Graph3D::updateScales(double xl, double xr, double yl, double yr, double zl, double zr,
1432  int xCol, int yCol, int zCol)
1433 {
1434  int r=worksheet->numRows();
1435  int i,j,columns=0;
1436  double xv, yv, zv;
1437  for ( i = 0; i < r; i++)
1438  {
1439  if (!worksheet->column(xCol)->isInvalid(i) && !worksheet->column(yCol)->isInvalid(i) && !worksheet->column(zCol)->isInvalid(i))
1440  {
1441  xv=worksheet->cell(i,xCol);
1442  yv=worksheet->cell(i,yCol);
1443  if (xv >= xl && xv <= xr && yv >= yl && yv <= yr)
1444  columns++;
1445  }
1446  }
1447 
1448  if (columns == 0)
1449  columns++;
1450 
1451  Qwt3D::Triple **data=allocateData(columns,columns);
1452  for ( j = 0; j < columns; j++)
1453  {
1454  int k=0;
1455  for ( i = 0; i < r; i++)
1456  {
1457  if (!worksheet->column(xCol)->isInvalid(i) && !worksheet->column(yCol)->isInvalid(i) && !worksheet->column(zCol)->isInvalid(i))
1458  {
1459  xv=worksheet->cell(i,xCol);
1460  yv=worksheet->cell(i,yCol);
1461  if (xv >= xl && xv <= xr && yv >= yl && yv <= yr )
1462  {
1463  zv=worksheet->cell(i,zCol);
1464  if (zv > zr)
1465  data[k][j] = Triple(xv,yv,zr);
1466  else if (zv < zl)
1467  data[k][j] = Triple(xv,yv,zl);
1468  else
1469  data[k][j] = Triple(xv,yv,zv);
1470  k++;
1471  }
1472  }
1473  }
1474  }
1475  sp->loadFromData (data, columns, columns, false,false);
1476  sp->createCoordinateSystem(Triple(xl, yl, zl), Triple(xr, yr, zr));
1477  deleteData(data,columns);
1478 }
1479 
1480 void Graph3D::setTicks(const QStringList& options)
1481 {
1482  int min,maj;
1483  if (int(options.count()) == 6)
1484  {
1485  maj=options[0].toInt();
1486  sp->coordinates()->axes[X1].setMajors(maj);
1487  sp->coordinates()->axes[X2].setMajors(maj);
1488  sp->coordinates()->axes[X3].setMajors(maj);
1489  sp->coordinates()->axes[X4].setMajors(maj);
1490 
1491  min=options[1].toInt();
1492  sp->coordinates()->axes[X1].setMinors(min);
1493  sp->coordinates()->axes[X2].setMinors(min);
1494  sp->coordinates()->axes[X3].setMinors(min);
1495  sp->coordinates()->axes[X4].setMinors(min);
1496 
1497  maj=options[2].toInt();
1498  sp->coordinates()->axes[Y1].setMajors(maj);
1499  sp->coordinates()->axes[Y2].setMajors(maj);
1500  sp->coordinates()->axes[Y3].setMajors(maj);
1501  sp->coordinates()->axes[Y4].setMajors(maj);
1502 
1503  min=options[3].toInt();
1504  sp->coordinates()->axes[Y1].setMinors(min);
1505  sp->coordinates()->axes[Y2].setMinors(min);
1506  sp->coordinates()->axes[Y3].setMinors(min);
1507  sp->coordinates()->axes[Y4].setMinors(min);
1508 
1509  maj=options[4].toInt();
1510  sp->coordinates()->axes[Z1].setMajors(maj);
1511  sp->coordinates()->axes[Z2].setMajors(maj);
1512  sp->coordinates()->axes[Z3].setMajors(maj);
1513  sp->coordinates()->axes[Z4].setMajors(maj);
1514 
1515  min=options[5].toInt();
1516  sp->coordinates()->axes[Z1].setMinors(min);
1517  sp->coordinates()->axes[Z2].setMinors(min);
1518  sp->coordinates()->axes[Z3].setMinors(min);
1519  sp->coordinates()->axes[Z4].setMinors(min);
1520  }
1521  else
1522  {
1523  maj=options[1].toInt();
1524  sp->coordinates()->axes[X1].setMajors(maj);
1525  sp->coordinates()->axes[X2].setMajors(maj);
1526  sp->coordinates()->axes[X3].setMajors(maj);
1527  sp->coordinates()->axes[X4].setMajors(maj);
1528 
1529  min=options[2].toInt();
1530  sp->coordinates()->axes[X1].setMinors(min);
1531  sp->coordinates()->axes[X2].setMinors(min);
1532  sp->coordinates()->axes[X3].setMinors(min);
1533  sp->coordinates()->axes[X4].setMinors(min);
1534 
1535  maj=options[3].toInt();
1536  sp->coordinates()->axes[Y1].setMajors(maj);
1537  sp->coordinates()->axes[Y2].setMajors(maj);
1538  sp->coordinates()->axes[Y3].setMajors(maj);
1539  sp->coordinates()->axes[Y4].setMajors(maj);
1540 
1541  min=options[4].toInt();
1542  sp->coordinates()->axes[Y1].setMinors(min);
1543  sp->coordinates()->axes[Y2].setMinors(min);
1544  sp->coordinates()->axes[Y3].setMinors(min);
1545  sp->coordinates()->axes[Y4].setMinors(min);
1546 
1547  maj=options[5].toInt();
1548  sp->coordinates()->axes[Z1].setMajors(maj);
1549  sp->coordinates()->axes[Z2].setMajors(maj);
1550  sp->coordinates()->axes[Z3].setMajors(maj);
1551  sp->coordinates()->axes[Z4].setMajors(maj);
1552 
1553  min=options[6].toInt();
1554  sp->coordinates()->axes[Z1].setMinors(min);
1555  sp->coordinates()->axes[Z2].setMinors(min);
1556  sp->coordinates()->axes[Z3].setMinors(min);
1557  sp->coordinates()->axes[Z4].setMinors(min);
1558  }
1559 }
1560 
1561 void Graph3D::setColors(const QColor& meshColor,const QColor& axesColor,const QColor& numColor,
1562  const QColor& labelColor,const QColor& bgColor,const QColor& gridColor)
1563 {
1564  if (meshCol != meshColor)
1565  {
1566  sp->setMeshColor(Qt2GL(meshColor));
1568  }
1569 
1570  if(axesCol != axesColor)
1571  {
1572  sp->coordinates()->setAxesColor(Qt2GL(axesColor));
1574  }
1575 
1576  if(numCol !=numColor)
1577  {
1578  sp->coordinates()->setNumberColor(Qt2GL(numColor));
1579  numCol=numColor;
1580  }
1581 
1582  if(labelsCol !=labelColor)
1583  {
1584  sp->coordinates()->setLabelColor(Qt2GL(labelColor));
1586  }
1587 
1588  if(bgCol !=bgColor)
1589  {
1590  sp->setBackgroundColor(Qt2GL(bgColor));
1591  bgCol=bgColor;
1592  }
1593 
1594  if(gridCol !=gridColor)
1595  {
1596  sp->coordinates()->setGridLinesColor(Qt2GL(gridColor));
1598  }
1599 }
1600 
1601 void Graph3D::setColors(const QStringList& colors)
1602 {
1603  meshCol=QColor(COLORVALUE(colors[1]));
1604  sp->setMeshColor(Qt2GL(meshCol));
1605 
1606  axesCol=QColor(COLORVALUE(colors[2]));
1607  sp->coordinates()->setAxesColor(Qt2GL(axesCol));
1608 
1609  numCol=QColor(COLORVALUE(colors[3]));
1610  sp->coordinates()->setNumberColor(Qt2GL(numCol));
1611 
1612  labelsCol=QColor(COLORVALUE(colors[4]));
1613  sp->coordinates()->setLabelColor(Qt2GL(labelsCol));
1614 
1615  bgCol=QColor(COLORVALUE(colors[5]));
1616  sp->setBackgroundColor(Qt2GL(bgCol));
1617 
1618  gridCol=QColor(COLORVALUE(colors[6]));
1619  sp->coordinates()->setGridLinesColor(Qt2GL(gridCol));
1620 
1621  if ((int)colors.count()>7)
1622  {
1623  QColor min=QColor(COLORVALUE(colors[7]));
1624  QColor max=QColor(COLORVALUE(colors[8]));
1625  alpha = colors[9].toDouble();
1626  if ((int)colors.count() == 11)
1627  setDataColorMap(colors[10]);
1628  else
1629  setDataColors(min,max);
1630  }
1631 }
1632 
1633 void Graph3D::updateColors(const QColor& meshColor,const QColor& axesColor,const QColor& numColor,
1634  const QColor& labelColor,const QColor& bgColor,const QColor& gridColor)
1635 {
1636  if (meshCol != meshColor)
1637  {
1638  sp->setMeshColor(Qt2GL(meshColor));
1640  }
1641 
1642  if(axesCol != axesColor)
1643  {
1644  sp->coordinates()->setAxesColor(Qt2GL(axesColor));
1646  }
1647 
1648  if(numCol !=numColor)
1649  {
1650  sp->coordinates()->setNumberColor(Qt2GL(numColor));
1651  numCol=numColor;
1652  }
1653 
1654  if(labelsCol !=labelColor)
1655  {
1656  sp->coordinates()->setLabelColor(Qt2GL(labelColor));
1658  }
1659 
1660  if(bgCol !=bgColor)
1661  {
1662  sp->setBackgroundColor(Qt2GL(bgColor));
1663  bgCol=bgColor;
1664  }
1665 
1666  if(gridCol !=gridColor)
1667  {
1668  sp->coordinates()->setGridLinesColor(Qt2GL(gridColor));
1670  }
1671 
1672  sp->updateData();
1673  sp->updateGL();
1674  emit modified();
1675 }
1676 
1677 void Graph3D::scaleFonts(double factor)
1678 {
1679  QFont font = sp->coordinates()->axes[X1].numberFont();
1680  font.setPointSizeF(font.pointSizeF()*factor);
1681  sp->coordinates()->setNumberFont (font);
1682 
1683  titleFnt.setPointSizeF(factor*titleFnt.pointSizeF());
1684  sp->setTitleFont(titleFnt.family(),titleFnt.pointSize(),titleFnt.weight(),titleFnt.italic());
1685 
1686  font = xAxisLabelFont();
1687  font.setPointSizeF(factor*font.pointSizeF());
1688  setXAxisLabelFont(font);
1689 
1690  font = yAxisLabelFont();
1691  font.setPointSizeF(factor*font.pointSizeF());
1692  setYAxisLabelFont(font);
1693 
1694  font = zAxisLabelFont();
1695  font.setPointSizeF(factor*font.pointSizeF());
1696  setZAxisLabelFont(font);
1697 }
1698 
1699 void Graph3D::resizeEvent ( QResizeEvent *e)
1700 {
1701  sp->makeCurrent();
1702  sp->resize(e->size());
1703 
1704  if (!ignoreFonts && this->isVisible())
1705  {
1706  double ratio=(double)e->size().height()/(double)e->oldSize().height();
1707  scaleFonts(ratio);
1708  }
1709 
1710  sp->updateGL();
1711  emit resizedWindow(this);
1712  emit modified();
1713  QMdiSubWindow::resizeEvent(e);
1714 }
1715 
1716 void Graph3D::contextMenuEvent(QContextMenuEvent *e)
1717 {
1718  if (widget()->geometry().contains(e->pos())) {
1719  emit showContextMenu();
1720  } else {
1721  emit showTitleBarMenu();
1722  }
1723  e->accept();
1724 }
1725 
1727 {
1728  if (sp->coordinates()->style() == FRAME)
1729  return;
1730 
1731  sp->makeCurrent();
1732  sp->setCoordinateStyle(FRAME);
1733 }
1734 
1736 {
1737  if (sp->coordinates()->style() == BOX)
1738  return;
1739 
1740  sp->makeCurrent();
1741  sp->setCoordinateStyle(BOX);
1742 }
1743 
1745 {
1746  if (sp->coordinates()->style() == NOCOORD)
1747  return;
1748 
1749  sp->makeCurrent();
1750  sp->setCoordinateStyle(NOCOORD);
1751 }
1752 
1754 {
1755  if (sp->plotStyle() == FILLED)
1756  return;
1757 
1758  sp->makeCurrent();
1759  sp->setPlotStyle(FILLED);
1760  sp->updateData();
1761  sp->updateGL();
1762 
1763  style_=FILLED;
1764  pointStyle = None;
1765 }
1766 
1768 {
1769  if (sp->plotStyle() == FILLEDMESH)
1770  return;
1771 
1772  sp->makeCurrent();
1773  sp->setPlotStyle(FILLEDMESH);
1774  sp->updateData();
1775  sp->updateGL();
1776 
1777  style_=FILLEDMESH;
1778  pointStyle = None;
1779 }
1780 
1782 {
1783  if (sp->plotStyle() == HIDDENLINE)
1784  return;
1785 
1786  sp->makeCurrent();
1787  sp->setPlotStyle(HIDDENLINE);
1788  sp->showColorLegend(false);
1789  sp->updateData();
1790  sp->updateGL();
1791 
1792  style_=HIDDENLINE;
1793  pointStyle = None;
1794  legendOn=false;
1795 }
1796 
1798 {
1799  if (sp->plotStyle() == WIREFRAME)
1800  return;
1801 
1802  sp->makeCurrent();
1803  sp->setPlotStyle(WIREFRAME);
1804  sp->showColorLegend(false);
1805  sp->updateData();
1806  sp->updateGL();
1807 
1808  pointStyle = None;
1809  style_=WIREFRAME;
1810  legendOn=false;
1811 }
1812 
1814 {
1815  if (!sp || pointStyle == Dots)
1816  return;
1817 
1818  pointStyle=Dots;
1819  style_=Qwt3D::USER;
1820 
1821  sp->makeCurrent();
1822  sp->setPlotStyle(Dot(pointSize, smooth));
1823  sp->updateData();
1824  sp->updateGL();
1825 }
1826 
1828 {
1829  if (!sp || pointStyle == Cones )
1830  return;
1831 
1832  QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
1833 
1834  pointStyle=Cones;
1835  style_=Qwt3D::USER;
1836 
1837  sp->makeCurrent();
1838  sp->setPlotStyle(Cone3D(conesRad,conesQuality));
1839  sp->updateData();
1840  sp->updateGL();
1841 
1842  QApplication::restoreOverrideCursor();
1843 }
1844 
1846 {
1847  if (!sp || pointStyle == HairCross)
1848  return;
1849 
1851  style_=Qwt3D::USER;
1852 
1853  sp->makeCurrent();
1855  sp->updateData();
1856  sp->updateGL();
1857 }
1858 
1860 {
1861  if (d_matrix)
1862  d_matrix = 0;
1863  else if (worksheet)
1864  worksheet = 0;
1865  else if (func)
1866  {
1867  delete func;
1868  func = 0;
1869  }
1870  plotAssociation = QString();
1871 
1872  sp->makeCurrent();
1873  sp->loadFromData (0, 0, 0, false, false);
1874  sp->updateData();
1875  sp->updateGL();
1876 }
1877 
1879 {
1880  if (pointStyle == VerticalBars)
1881  return;
1882 
1883  QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
1884 
1886  style_=Qwt3D::USER;
1887 
1888  sp->makeCurrent();
1889  sp->setPlotStyle(Bar(barsRad));
1890  sp->updateData();
1891  sp->updateGL();
1892  QApplication::restoreOverrideCursor();
1893 }
1894 
1896 {
1897  if (sp->floorStyle() == FLOORDATA)
1898  return;
1899 
1900  sp->makeCurrent();
1901  sp->setFloorStyle(FLOORDATA);
1902  sp->updateData();
1903  sp->updateGL();
1904 }
1905 
1907 {
1908  if (sp->floorStyle() == FLOORISO)
1909  return;
1910 
1911  sp->makeCurrent();
1912  sp->setFloorStyle(FLOORISO);
1913  sp->updateData();
1914  sp->updateGL();
1915 }
1916 
1918 {
1919  if (sp->floorStyle() == NOFLOOR)
1920  return;
1921 
1922  sp->makeCurrent();
1923  sp->setFloorStyle(NOFLOOR);
1924  sp->updateData();
1925  sp->updateGL();
1926 }
1927 
1929 {
1930  if ((int)sp->meshLineWidth() == lw)
1931  return;
1932 
1933  sp->makeCurrent();
1934  sp->setMeshLineWidth((double)lw);
1935  sp->updateData();
1936  sp->updateGL();
1937 }
1938 
1940 {
1941  return sp->coordinates()->grids();
1942 }
1943 
1944 void Graph3D::setGrid(Qwt3D::SIDE s, bool b)
1945 {
1946  if (!sp)
1947  return;
1948 
1949  int sum = sp->coordinates()->grids();
1950 
1951  if (b)
1952  sum |= s;
1953  else
1954  sum &= ~s;
1955 
1956  sp->coordinates()->setGridLines(sum!=Qwt3D::NOSIDEGRID, false, sum);
1957  sp->updateGL();
1958  emit modified();
1959 }
1960 
1961 void Graph3D::setGrid(int grids)
1962 {
1963  if (!sp)
1964  return;
1965 
1966  sp->coordinates()->setGridLines(true, false,grids);
1967 }
1968 
1970 {
1971  setGrid(Qwt3D::LEFT,b);
1972 }
1974 {
1975  setGrid(Qwt3D::RIGHT,b);
1976 }
1978 {
1979  setGrid(Qwt3D::CEIL,b);
1980 }
1982 {
1983  setGrid(Qwt3D::FLOOR,b);
1984 }
1986 {
1987  setGrid(Qwt3D::FRONT,b);
1988 }
1990 {
1991  setGrid(Qwt3D::BACK,b);
1992 }
1993 
1995 {
1996  QPrinter printer;
1997  printer.setOrientation(QPrinter::Landscape);
1998  printer.setColorMode (QPrinter::Color);
1999  printer.setFullPage(false);
2000 
2001  QPrintDialog dialog(&printer, this);
2002  if (dialog.exec())
2003  {
2004  if (IO::save (sp,"scidavis.png","PNG"))
2005  {
2006  QPixmap p;
2007  p.load ("scidavis.png","PNG", Qt::ColorOnly );
2008 
2009  QPainter paint(&printer);
2010  paint.drawPixmap(QPoint(0,0),p);
2011  paint.end();
2012 
2013  QFile f("scidavis.png");
2014  f.remove();
2015  }
2016  else
2017  QMessageBox::about(0,tr("IO Error"),
2018  tr("Could not print: <h4>") + QString(name()) + "</h4>.");
2019  }
2020 }
2021 
2023 {
2024  QApplication::clipboard()->setPixmap(sp->renderPixmap(), QClipboard::Clipboard);
2025  sp->updateData();
2026 }
2027 
2028 void Graph3D::exportImage(const QString& fileName, int quality, bool transparent)
2029 {
2030  if (transparent)
2031  {
2032  QPixmap pic = sp->renderPixmap();
2033  sp->updateData();
2034 
2035  QBitmap mask(pic.size());
2036  mask.fill(Qt::color1);
2037  QPainter p;
2038  p.begin(&mask);
2039  p.setPen(Qt::color0);
2040 
2041  QColor background = QColor (Qt::white);
2042  QRgb backgroundPixel = background.rgb ();
2043  QImage image = pic.toImage();
2044  for (int y=0; y<image.height(); y++)
2045  {
2046  for ( int x=0; x<image.width(); x++ )
2047  {
2048  QRgb rgb = image.pixel(x, y);
2049  if (rgb == backgroundPixel) // we want the frame transparent
2050  p.drawPoint( x, y );
2051  }
2052  }
2053  p.end();
2054  pic.setMask(mask);
2055  pic.save(fileName, 0, quality);
2056  }
2057  else
2058  {
2059  QImage im = sp->grabFrameBuffer(true);
2060  QImageWriter iw(fileName);
2061  iw.setQuality(quality);
2062  iw.write(im);
2063  }
2064 }
2065 
2066 void Graph3D::exportPDF(const QString& fileName)
2067 {
2068  exportVector(fileName);
2069 }
2070 
2071 void Graph3D::exportVector(const QString& fileName, const QString& fileType)
2072 {
2073  if ( fileName.isEmpty() )
2074  {
2075  QMessageBox::critical(0, tr("Error"), tr("Please provide a valid file name!"));
2076  return;
2077  }
2078 
2079  QString format = fileType;
2080  format = format.toUpper();
2081 
2082  VectorWriter * gl2ps = (VectorWriter*)IO::outputHandler(format);
2083  if (gl2ps)
2084  {
2085  gl2ps->setTextMode(VectorWriter::NATIVE);
2086  }
2087  if (!IO::save(sp, fileName, format))
2088  throw std::runtime_error((fileType+tr(" not supported")).toStdString());
2089 }
2090 
2091 bool Graph3D::eventFilter(QObject *object, QEvent *e)
2092 {
2093  if (e->type() == QEvent::MouseButtonDblClick && object == (QObject *)this->sp)
2094  {
2095  emit showOptionsDialog();
2096  return true;
2097  }
2098  return MyWidget::eventFilter(object, e);
2099 }
2100 
2101 void Graph3D::setPointOptions(double size, bool s)
2102 {
2103  if (pointSize == size && smooth == s)
2104  return;
2105 
2106  pointSize = size;
2107  smooth = s;
2108 }
2109 
2111 {
2112  if (sp->plotStyle() == Qwt3D::USER && sp->plotStyle() != Qwt3D::POINTS)
2113  return barsRad;
2114  else
2115  return 0.0;
2116 }
2117 
2118 void Graph3D::setBarsRadius(double rad)
2119 {
2120  if (barsRad == rad)
2121  return;
2122 
2123  barsRad = rad;
2124 }
2125 
2126 void Graph3D::updateBars(double rad)
2127 {
2128  if (barsRad == rad)
2129  return;
2130 
2131  barsRad = rad;
2132  sp->setPlotStyle(Bar(barsRad));
2133  update();
2134 }
2135 
2136 void Graph3D::updatePoints(double size, bool sm)
2137 {
2138  if (pointStyle == Dots && pointSize == size && smooth == sm)
2139  return;
2140 
2141  pointSize = size;
2142  smooth = sm;
2143  pointStyle = Dots;
2144 
2145  Dot d(pointSize, smooth);
2146  sp->setPlotStyle(d);
2147 
2148  update();
2149  emit modified();
2150  emit custom3DActions(this);
2151 }
2152 
2153 void Graph3D::updateCones(double rad, int quality)
2154 {
2155  if (pointStyle == Cones && conesRad == rad && conesQuality == quality)
2156  return;
2157 
2158  conesRad = rad;
2159  conesQuality = quality;
2160  pointStyle = Cones;
2161  sp->setPlotStyle(Cone3D(conesRad,conesQuality));
2162  update();
2163  emit modified();
2164  emit custom3DActions(this);
2165 }
2166 
2167 void Graph3D::setConesOptions(double rad, int quality)
2168 {
2169  conesRad = rad;
2170  conesQuality = quality;
2171 }
2172 
2173 void Graph3D::updateCross(double rad, double linewidth, bool smooth, bool boxed)
2174 {
2175  if (pointStyle == HairCross && crossHairRad == rad &&
2176  crossHairSmooth == smooth && crossHairBoxed == boxed &&
2177  crossHairLineWidth == linewidth)
2178  return;
2179 
2180  crossHairRad = rad;
2181  crossHairLineWidth=linewidth;
2183  crossHairBoxed = boxed;
2185 
2186  sp->setPlotStyle(CrossHair(rad,linewidth, smooth, boxed));
2187  update();
2188  emit modified();
2189  emit custom3DActions(this);
2190 }
2191 
2192 void Graph3D::setCrossOptions(double rad, double linewidth, bool smooth, bool boxed)
2193 {
2194  crossHairRad = rad ;
2195  crossHairLineWidth=linewidth;
2197  crossHairBoxed = boxed;
2198 }
2199 
2200 void Graph3D::setStyle(Qwt3D::COORDSTYLE coord,Qwt3D::FLOORSTYLE floor,
2201  Qwt3D::PLOTSTYLE plot, Graph3D::PointStyle point)
2202 {
2203  sp->setCoordinateStyle(coord);
2204  sp->setFloorStyle(floor);
2205 
2206  if (point == None)
2207  sp->setPlotStyle(plot);
2208  else if (point == VerticalBars)
2209  sp->setPlotStyle(Bar(barsRad));
2210  else if (point == Dots)
2211  sp->setPlotStyle(Dot(pointSize, smooth));
2212  else if (point == HairCross)
2213  sp->setPlotStyle(CrossHair(crossHairRad, crossHairLineWidth, crossHairSmooth, crossHairBoxed));
2214  else if (point == Cones)
2215  sp->setPlotStyle(Cone3D(conesRad, conesQuality));
2216 
2217  pointStyle=point;
2218  style_=sp->plotStyle() ;
2219 }
2220 
2222 {
2223  sp->makeCurrent();
2224  if (sp->plotStyle() == style)
2225  return;
2226 
2227  switch (style)
2228  {
2229  case WIREFRAME :
2230  {
2231  sp->setPlotStyle(WIREFRAME );
2232  style_= WIREFRAME ;
2233  pointStyle = None;
2234 
2235  legendOn = false;
2236  sp->showColorLegend(legendOn);
2237  break;
2238  }
2239 
2240  case FILLED :
2241  {
2242  sp->setPlotStyle(FILLED );
2243  style_= FILLED;
2244  pointStyle = None;
2245  break;
2246  }
2247 
2248  case FILLEDMESH :
2249  {
2250  sp->setPlotStyle(FILLEDMESH);
2251  style_= FILLEDMESH;
2252  pointStyle = None;
2253  break;
2254  }
2255 
2256  case HIDDENLINE:
2257  {
2258  sp->setPlotStyle(HIDDENLINE);
2259  style_= HIDDENLINE;
2260  pointStyle = None;
2261  legendOn = false;
2262  sp->showColorLegend(legendOn);
2263  break;
2264  }
2265 
2266  case Qwt3D::POINTS:
2267  {
2268  pointSize = 0.5;
2269  smooth = true;
2270  pointStyle=Dots;
2271  style_ = Qwt3D::USER;
2272 
2273  Dot d(pointSize, smooth);
2274  sp->setPlotStyle(d);
2275  break;
2276  }
2277 
2278  case Qwt3D::USER:
2279  {
2281  style_ = Qwt3D::USER;
2282  sp->setPlotStyle(Bar(barsRad));
2283  break;
2284  }
2285  }
2286 
2287  sp->updateData();
2288  sp->updateGL();
2289 }
2290 
2291 void Graph3D::setStyle(const QStringList& st)
2292 {
2293  if (st[1] =="nocoord")
2294  sp->setCoordinateStyle(NOCOORD);
2295  else if (st[1] =="frame")
2296  sp->setCoordinateStyle(FRAME);
2297  else if (st[1] =="box")
2298  sp->setCoordinateStyle(BOX);
2299 
2300  if (st[2] =="nofloor")
2301  sp->setFloorStyle(NOFLOOR);
2302  else if (st[2] =="flooriso")
2303  sp->setFloorStyle(FLOORISO);
2304  else if (st[2] =="floordata")
2305  sp->setFloorStyle(FLOORDATA);
2306 
2307  if (st[3] =="filledmesh")
2308  sp->setPlotStyle(FILLEDMESH);
2309  else if (st[3] =="filled")
2310  sp->setPlotStyle(FILLED);
2311  else if (st[3] =="points")
2312  {
2313  pointSize = st[4].toDouble();
2314 
2315  smooth=false;
2316  if (st[5] == "1")
2317  smooth=true;
2318 
2319  sp->setPlotStyle(Dot(pointSize, smooth));
2320  pointStyle = Dots;
2321  }
2322  else if (st[3] =="wireframe")
2323  sp->setPlotStyle(WIREFRAME);
2324  else if (st[3] =="hiddenline")
2325  sp->setPlotStyle(HIDDENLINE);
2326  else if (st[3] =="bars")
2327  {
2328  barsRad = (st[4]).toDouble();
2329  sp->setPlotStyle(Bar(barsRad));
2331  }
2332  else if (st[3] =="cones")
2333  {
2334  conesRad = (st[4]).toDouble();
2335  conesQuality = (st[5]).toInt();
2336 
2337  sp->setPlotStyle(Cone3D(conesRad, conesQuality));
2338  pointStyle = Cones;
2339  }
2340  else if (st[3] =="cross")
2341  {
2342  crossHairRad = (st[4]).toDouble();
2343  crossHairLineWidth = (st[5]).toDouble();
2344 
2345  crossHairSmooth=false;
2346  if (st[6] == "1")
2347  crossHairSmooth=true;
2348 
2349  crossHairBoxed=false;
2350  if (st[7] == "1")
2351  crossHairBoxed=true;
2352 
2353  sp->setPlotStyle(CrossHair(crossHairRad, crossHairLineWidth, crossHairSmooth, crossHairBoxed));
2355  }
2356 
2357  style_ = sp->plotStyle() ;
2358 }
2359 
2360 void Graph3D::setRotation(double xVal,double yVal,double zVal)
2361 {
2362  sp->setRotation(xVal,yVal,zVal);
2363 }
2364 
2365 void Graph3D::setScale(double xVal,double yVal,double zVal)
2366 {
2367  sp->setScale(xVal,yVal,zVal);
2368 }
2369 
2370 void Graph3D::setShift(double xVal,double yVal,double zVal)
2371 {
2372  sp->setShift(xVal,yVal,zVal);
2373 }
2374 
2375 void Graph3D::setZoom(double val)
2376 {
2377  sp->setZoom(val);
2378 }
2379 
2380 void Graph3D::updateZoom(double val)
2381 {
2382  if (sp->zoom() == val)
2383  return;
2384 
2385  QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
2386 
2387  sp->makeCurrent();
2388  sp->setZoom(val);
2389  sp->updateData();
2390  sp->updateGL();
2391 
2392  QApplication::restoreOverrideCursor();
2393 }
2394 
2395 void Graph3D::updateScaling(double xVal,double yVal,double zVal)
2396 {
2397  if (sp->xScale() == xVal && sp->yScale() == yVal && sp->zScale() == zVal)
2398  return;
2399 
2400  QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
2401 
2402  sp->setScale(xVal,yVal,zVal);
2403  sp->updateData();
2404  sp->updateGL();
2405 
2406  QApplication::restoreOverrideCursor();
2407 }
2408 
2409 Qwt3D::PLOTSTYLE Graph3D::plotStyle()
2410 {
2411  return sp->plotStyle();
2412 }
2413 
2414 Qwt3D::FLOORSTYLE Graph3D::floorStyle()
2415 {
2416  return sp->floorStyle();
2417 }
2418 
2419 Qwt3D::COORDSTYLE Graph3D::coordStyle()
2420 {
2421  return sp->coordinates()->style();
2422 }
2423 
2425 {
2426  if (func)
2427  return func->function();
2428  else
2429  return plotAssociation;
2430 }
2431 
2432 QString Graph3D::saveToString(const QString& geometry)
2433 {
2434  QString s="<SurfacePlot>\n";
2435  s+= QString(name())+"\t";
2436  s+= birthDate() + "\n";
2437  s+= geometry;
2438  s+= "SurfaceFunction\t";
2439 
2440  sp->makeCurrent();
2441  if (func)
2442  s+=func->function()+"\t";
2443  else
2444  {
2445  s+= plotAssociation;
2446  s+="\t";
2447  }
2448 
2449  double start,stop;
2450  sp->coordinates()->axes[X1].limits(start,stop);
2451  s+=QString::number(start)+"\t";
2452  s+=QString::number(stop)+"\t";
2453  sp->coordinates()->axes[Y1].limits(start,stop);
2454  s+=QString::number(start)+"\t";
2455  s+=QString::number(stop)+"\t";
2456  sp->coordinates()->axes[Z1].limits(start,stop);
2457  s+=QString::number(start)+"\t";
2458  s+=QString::number(stop)+"\n";
2459 
2460  QString st;
2461  if (sp->coordinates()->style() == Qwt3D::NOCOORD)
2462  st="nocoord";
2463  else if (sp->coordinates()->style() == Qwt3D::BOX)
2464  st="box";
2465  else
2466  st="frame";
2467  s+="Style\t"+st+"\t";
2468 
2469  switch(sp->floorStyle ())
2470  {
2471  case NOFLOOR:
2472  st="nofloor";
2473  break;
2474 
2475  case FLOORISO:
2476  st="flooriso";
2477  break;
2478 
2479  case FLOORDATA:
2480  st="floordata";
2481  break;
2482  }
2483  s+=st+"\t";
2484 
2485  switch(sp->plotStyle())
2486  {
2487  case USER:
2488  if (pointStyle == VerticalBars)
2489  st="bars\t"+QString::number(barsRad);
2490  else if (pointStyle == Dots)
2491  {
2492  st="points\t"+QString::number(pointSize);
2493  st+="\t"+QString::number(smooth);
2494  }
2495  else if (pointStyle == Cones)
2496  {
2497  st="cones\t"+QString::number(conesRad);
2498  st+="\t"+QString::number(conesQuality);
2499  }
2500  else if (pointStyle == HairCross)
2501  {
2502  st="cross\t"+QString::number(crossHairRad);
2503  st+="\t"+QString::number(crossHairLineWidth);
2504  st+="\t"+QString::number(crossHairSmooth);
2505  st+="\t"+QString::number(crossHairBoxed);
2506  }
2507  break;
2508 
2509  case WIREFRAME:
2510  st="wireframe";
2511  break;
2512 
2513  case HIDDENLINE:
2514  st="hiddenline";
2515  break;
2516 
2517  case FILLED:
2518  st="filled";
2519  break;
2520 
2521  case FILLEDMESH:
2522  st="filledmesh";
2523  break;
2524 
2525  default:
2526  ;
2527  }
2528  s+=st+"\n";
2529 
2530  s+="grids\t";
2531  s+=QString::number(sp->coordinates()->grids())+"\n";
2532 
2533  s+="title\t";
2534  s+=title+"\t";
2535  s+=COLORNAME(titleCol)+"\t";
2536  s+=titleFnt.family()+"\t";
2537  s+=QString::number(titleFnt.pointSize())+"\t";
2538  s+=QString::number(titleFnt.weight())+"\t";
2539  s+=QString::number(titleFnt.italic())+"\n";
2540 
2541  s+="colors\t";
2542  s+=COLORNAME(meshCol)+"\t";
2543  s+=COLORNAME(axesCol)+"\t";
2544  s+=COLORNAME(numCol)+"\t";
2545  s+=COLORNAME(labelsCol)+"\t";
2546  s+=COLORNAME(bgCol)+"\t";
2547  s+=COLORNAME(gridCol)+"\t";
2548  s+=COLORNAME(fromColor)+"\t";
2549  s+=COLORNAME(toColor)+"\t";
2550  s+=QString::number(alpha) + "\t" + color_map + "\n";
2551 
2552  s+="axesLabels\t";
2553  s+=labels.join("\t")+"\n";
2554 
2555  s+="tics\t";
2556  QStringList tl=scaleTicks();
2557  s+=tl.join("\t")+"\n";
2558 
2559  s+="tickLengths\t";
2560  tl=axisTickLengths();
2561  s+=tl.join("\t")+"\n";
2562 
2563  s+="options\t";
2564  s+=QString::number(legendOn)+"\t";
2565  s+=QString::number(sp->resolution())+"\t";
2566  s+=QString::number(labelsDist)+"\n";
2567 
2568  s+="numbersFont\t";
2569  QFont fnt=sp->coordinates()->axes[X1].numberFont();
2570  s+=fnt.family()+"\t";
2571  s+=QString::number(fnt.pointSize())+"\t";
2572  s+=QString::number(fnt.weight())+"\t";
2573  s+=QString::number(fnt.italic())+"\n";
2574 
2575  s+="xAxisLabelFont\t";
2576  fnt=sp->coordinates()->axes[X1].labelFont();
2577  s+=fnt.family()+"\t";
2578  s+=QString::number(fnt.pointSize())+"\t";
2579  s+=QString::number(fnt.weight())+"\t";
2580  s+=QString::number(fnt.italic())+"\n";
2581 
2582  s+="yAxisLabelFont\t";
2583  fnt=sp->coordinates()->axes[Y1].labelFont();
2584  s+=fnt.family()+"\t";
2585  s+=QString::number(fnt.pointSize())+"\t";
2586  s+=QString::number(fnt.weight())+"\t";
2587  s+=QString::number(fnt.italic())+"\n";
2588 
2589  s+="zAxisLabelFont\t";
2590  fnt=sp->coordinates()->axes[Z1].labelFont();
2591  s+=fnt.family()+"\t";
2592  s+=QString::number(fnt.pointSize())+"\t";
2593  s+=QString::number(fnt.weight())+"\t";
2594  s+=QString::number(fnt.italic())+"\n";
2595 
2596  s+="rotation\t";
2597  s+=QString::number(sp->xRotation())+"\t";
2598  s+=QString::number(sp->yRotation())+"\t";
2599  s+=QString::number(sp->zRotation())+"\n";
2600 
2601  s+="zoom\t";
2602  s+=QString::number(sp->zoom())+"\n";
2603 
2604  s+="scaling\t";
2605  s+=QString::number(sp->xScale())+"\t";
2606  s+=QString::number(sp->yScale())+"\t";
2607  s+=QString::number(sp->zScale())+"\n";
2608 
2609  s+="shift\t";
2610  s+=QString::number(sp->xShift())+"\t";
2611  s+=QString::number(sp->yShift())+"\t";
2612  s+=QString::number(sp->zShift())+"\n";
2613 
2614  s+="LineWidth\t";
2615  s+=QString::number(sp->meshLineWidth())+"\n";
2616  s+="WindowLabel\t" + windowLabel() + "\t" + QString::number(captionPolicy()) + "\n";
2617  s+="Orthogonal\t" + QString::number(sp->ortho())+"\n";
2618  s+="</SurfacePlot>\n";
2619  return s;
2620 }
2621 
2623 {
2624  if (legendOn == show)
2625  return;
2626 
2627  sp->makeCurrent();
2628  sp->showColorLegend(show);
2629 
2630  legendOn=show;
2631  sp->updateGL();
2632  emit modified();
2633 }
2634 
2636 {
2637  if (sp->resolution() == r)
2638  return;
2639 
2640  sp->makeCurrent();
2641  sp->setResolution(r);
2642  sp->updateData();
2643  sp->updateGL();
2644  emit modified();
2645 }
2646 
2647 void Graph3D::setTitle(const QStringList& lst)
2648 {
2649  title=lst[1];
2650  sp->setTitle(title);
2651 
2652  titleCol=QColor(COLORVALUE(lst[2]));
2653  sp->setTitleColor(Qt2GL(titleCol));
2654 
2655  titleFnt=QFont(lst[3],lst[4].toInt(),lst[5].toInt(),lst[6].toInt());
2656  sp->setTitleFont(titleFnt.family(),titleFnt.pointSize(),titleFnt.weight(),titleFnt.italic());
2657 }
2658 
2659 void Graph3D::setTitle(const QString& s,const QColor& color,const QFont& font)
2660 {
2661  if (title != s)
2662  {
2663  title=s;
2664  sp->setTitle(title);
2665  }
2666 
2667  titleCol=color;
2668  sp->setTitleColor(Qt2GL(color));
2669 
2670  if (titleFnt != font)
2671  {
2672  titleFnt=font;
2673  sp->setTitleFont(font.family(),font.pointSize(),font.weight(),font.italic());
2674  }
2675 }
2676 
2677 void Graph3D::updateTitle(const QString& s,const QColor& color,const QFont& font)
2678 {
2679  if (title != s)
2680  {
2681  title=s;
2682  sp->setTitle(title);
2683  }
2684 
2685  titleCol=color;
2686  sp->setTitleColor(Qt2GL(color));
2687 
2688  if (titleFnt != font)
2689  {
2690  titleFnt=font;
2691  sp->setTitleFont(font.family(),font.pointSize(),font.weight(),font.italic());
2692  }
2693 
2694  sp->makeCurrent();
2695  sp->updateGL();
2696  emit modified();
2697 }
2698 
2699 void Graph3D::setTitleFont(const QFont& font)
2700 {
2701  if (titleFnt != font)
2702  {
2703  titleFnt=font;
2704  sp->setTitleFont(font.family(),font.pointSize(),font.weight(),font.italic());
2705  }
2706 }
2707 
2708 void Graph3D::setOptions(const QStringList& lst)
2709 {
2710  legendOn=false;
2711  if (lst[1].toInt() == 1)
2712  legendOn=true;
2713  sp->showColorLegend(legendOn);
2714  sp->setResolution(lst[2].toInt());
2715  adjustLabels(lst[3].toInt());
2716 }
2717 
2718 
2719 void Graph3D::setOptions(bool legend, int r, int dist)
2720 {
2721  sp->showColorLegend(legend);
2722  legendOn=legend;
2723  sp->setResolution(r);
2724  adjustLabels(dist);
2725 }
2726 
2727 Qwt3D::Triple** Graph3D::allocateData(int columns, int rows)
2728 {
2729  Qwt3D::Triple** data = new Qwt3D::Triple* [columns];
2730 
2731  for ( int i = 0; i < columns; ++i)
2732  {
2733  data[i] = new Qwt3D::Triple [rows];
2734  }
2735  return data;
2736 }
2737 
2738 void Graph3D::deleteData(Qwt3D::Triple **data, int columns)
2739 {
2740  for ( int i = 0; i < columns; i++)
2741  {
2742  delete [] data[i];
2743  }
2744  delete [] data;
2745 }
2746 
2748 {
2749  return fromColor;
2750 }
2751 
2753 {
2754  return toColor;
2755 }
2756 
2757 void Graph3D::setDataColors(const QColor& cMin, const QColor& cMax)
2758 {
2759  if (cMin == fromColor && cMax == toColor)
2760  return;
2761 
2762  fromColor=cMin;
2763  toColor=cMax;
2764 
2765  Qwt3D::ColorVector cv;
2766 
2767  int size=255;
2768  double dsize = size;
2769 
2770  double r1=cMax.red()/dsize;
2771  double r2=cMin.red()/dsize;
2772 
2773  double stepR = (r1-r2)/dsize;
2774 
2775  double g1=cMax.green()/dsize;
2776  double g2=cMin.green()/dsize;
2777 
2778  double stepG = (g1-g2)/dsize;
2779 
2780  double b1=cMax.blue()/dsize;
2781  double b2=cMin.blue()/dsize;
2782 
2783  double stepB = (b1-b2)/dsize;
2784 
2785  RGBA rgb;
2786  for (int i=0; i<size; i++)
2787  {
2788  rgb.r = r1-i*stepR;
2789  rgb.g = g1-i*stepG;
2790  rgb.b = b1-i*stepB;
2791  rgb.a = alpha;
2792 
2793  cv.push_back(rgb);
2794  }
2795 
2796  col_ = new StandardColor(sp);
2797  col_->setColorVector(cv);
2798  sp->setDataColor(col_);
2799 
2800  if (legendOn)
2801  {
2802  sp->showColorLegend(false);
2803  sp->showColorLegend(legendOn);
2804  }
2805 }
2806 
2808 {
2809  if (alpha == t)
2810  return;
2811 
2812  alpha = t;
2813 
2814  Qwt3D::StandardColor* color=(StandardColor*) sp->dataColor ();
2815  color->setAlpha(t);
2816 
2817  sp->showColorLegend(legendOn);
2818  sp->updateData();
2819  sp->updateGL();
2820  emit modified();
2821 }
2822 
2824 {
2825  if (alpha == t)
2826  return;
2827 
2828  alpha = t;
2829 
2830  Qwt3D::StandardColor* color=(StandardColor*) sp->dataColor ();
2831  color->setAlpha(t);
2832 }
2833 
2835 {
2836  if (worksheet)
2837  worksheet->showMaximized();
2838  else if (d_matrix)
2839  d_matrix->showMaximized();
2840 }
2841 
2842 void Graph3D::setSmoothMesh(bool smooth)
2843 {
2844  if (smoothMesh == smooth)
2845  return;
2846 
2847  smoothMesh = smooth;
2848  sp->setSmoothMesh(smoothMesh);
2849  sp->coordinates()->setLineSmooth(smoothMesh);
2850  sp->updateData();
2851  sp->updateGL();
2852 }
2853 
2854 QString Graph3D::saveAsTemplate(const QString& geometryInfo)
2855 {
2856  QString s = saveToString(geometryInfo);
2857  QStringList lst = s.split("\n", QString::SkipEmptyParts);
2858  QStringList l = lst[3].split("\t");
2859  l[1] = QString();
2860  lst[3] = l.join("\t");
2861  return lst.join("\n");
2862 }
2863 
2867 void Graph3D::animate(bool on)
2868 {
2869 if ( on )
2870  d_timer->start( animation_redraw_wait ); // Wait this many msecs before redraw
2871 else
2872  d_timer->stop();
2873 }
2874 
2876 {
2877 if (!sp)
2878  return;
2879 
2880 sp->setRotation(int(sp->xRotation() + 1) % 360, int(sp->yRotation() + 1) % 360, int(sp->zRotation() + 1) % 360);
2881 }
2882 
2883 void Graph3D::setDataColorMap(const QString& fileName)
2884 {
2885 if (color_map == fileName)
2886  return;
2887 
2888 ColorVector cv;
2889 if (!openColorMap(cv, fileName))
2890  return;
2891 
2892 color_map = fileName;
2893 
2894 col_ = new StandardColor(sp);
2895 col_->setColorVector(cv);
2896 
2897 sp->setDataColor(col_);
2898 sp->updateData();
2899 sp->showColorLegend(legendOn);
2900 sp->updateGL();
2901 }
2902 
2903 bool Graph3D::openColorMap(ColorVector& cv, QString fname)
2904 {
2905 if (fname.isEmpty())
2906  return false;
2907 
2908 using std::ifstream;
2909 ifstream file(QWT3DLOCAL8BIT(fname));
2910 if (!file)
2911  return false;
2912 
2913 RGBA rgb;
2914 cv.clear();
2915 
2916 while ( file )
2917  {
2918  file >> rgb.r >> rgb.g >> rgb.b;
2919  file.ignore(10000,'\n');
2920  if (!file.good())
2921  break;
2922  else
2923  {
2924  rgb.a = 1;
2925  rgb.r /= 255;
2926  rgb.g /= 255;
2927  rgb.b /= 255;
2928  cv.push_back(rgb);
2929  }
2930  }
2931 return true;
2932 }
2933 
2935 {
2936  double start, end;
2937  sp->coordinates()->axes[X1].limits (start, end);
2938  double xScale = 1/fabs(end-start);
2939 
2940  sp->coordinates()->axes[Y1].limits (start, end);
2941  double yScale = 1/fabs(end-start);
2942 
2943  sp->coordinates()->axes[Z1].limits (start, end);
2944  double zScale = 1/fabs(end-start);
2945 
2946  double d = (sp->hull().maxVertex-sp->hull().minVertex).length();
2947  sp->setScale(xScale, yScale, zScale);
2948  sp->setZoom(d/sqrt(3));
2949 
2950  double majl = 0.1/yScale;
2951  updateTickLength(0, majl, 0.6*majl);
2952  majl = 0.1/xScale;
2953  updateTickLength(1, majl, 0.6*majl);
2954  updateTickLength(2, majl, 0.6*majl);
2955 }
2956 
2958 {
2959  if (!g)
2960  return;
2961 
2962  Graph3D::PointStyle pt = g->pointType();
2963  if (g->plotStyle() == Qwt3D::USER ){
2964  switch (pt){
2965  case Graph3D::None :
2966  break;
2967 
2968  case Graph3D::Dots :
2970  break;
2971 
2972  case Graph3D::VerticalBars :
2973  setBarsRadius(g->barsRadius());
2974  break;
2975 
2976  case Graph3D::HairCross :
2978  break;
2979 
2980  case Graph3D::Cones :
2982  break;
2983  }
2984  }
2985  setStyle(g->coordStyle(), g->floorStyle(), g->plotStyle(), pt);
2986  setGrid(g->grids());
2987  setTitle(g->plotTitle(),g->titleColor(),g->titleFont());
2989  if (!g->colorMap().isEmpty())
2990  setDataColorMap(g->colorMap());
2991  else
2993 
2994  setColors(g->meshColor(),g->axesColor(),g->numColor(),
2995  g->labelColor(), g->bgColor(),g->gridColor());
2996  setAxesLabels(g->axesLabels());
2997  setTicks(g->scaleTicks());
3004  setRotation(g->xRotation(),g->yRotation(),g->zRotation());
3005  setZoom(g->zoom());
3006  setScale(g->xScale(),g->yScale(),g->zScale());
3007  setShift(g->xShift(),g->yShift(),g->zShift());
3008  setMeshLineWidth((int)g->meshLineWidth());
3009  setOrtho(g->isOrthogonal());
3010  update();
3011  animate(g->isAnimated());
3012 }
3013 
3015 {
3016  if (func)
3017  delete func;
3018 
3019  delete sp;
3020 }
Table::cell
double cell(int row, int col)
Return the value of the cell as a double.
Definition: Table.cpp:907
Graph3D::labelColor
QColor labelColor()
Definition: Graph3D.h:267
Graph3D::updateDataXYZ
void updateDataXYZ(Table *table, int xCol, int yCol, int zCol)
Definition: Graph3D.cpp:670
Matrix
Matrix worksheet class.
Definition: Matrix.h:52
Graph3D::updateDataXY
void updateDataXY(Table *table, int xCol, int yCol)
Definition: Graph3D.cpp:612
Graph3D::colorMap
QString colorMap()
Definition: Graph3D.h:272
Matrix::yStart
double yStart()
Return the Y value corresponding to row 1.
Definition: Matrix.h:267
Graph3D::barsRad
double barsRad
Definition: Graph3D.h:381
Graph3D::setFramed
void setFramed()
Definition: Graph3D.cpp:1726
Graph3D::VerticalBars
@ VerticalBars
Definition: Graph3D.h:65
MyParser.h
Graph3D::copyImage
void copyImage()
Definition: Graph3D.cpp:2022
Graph3D::conesQuality
int conesQuality
Definition: Graph3D.h:385
Graph3D::zoomChanged
void zoomChanged(double)
Definition: Graph3D.cpp:988
Table::column
Column * column(int index) const
Return column number 'index'.
Definition: Table.h:121
Graph3D::customPlotStyle
void customPlotStyle(int style)
Definition: Graph3D.cpp:2221
Graph3D::fromColor
QColor fromColor
Custom data colors.
Definition: Graph3D.h:377
Graph3D::setDataColorMap
void setDataColorMap(const QString &fileName)
Definition: Graph3D.cpp:2883
Graph3D::showContextMenu
void showContextMenu()
Graph3D::updateLabel
void updateLabel(int axis, const QString &label, const QFont &f)
Definition: Graph3D.cpp:1034
Matrix::xEnd
double xEnd()
Return the X value corresponding to the last column.
Definition: Matrix.h:265
Graph3D::initCoord
void initCoord()
Definition: Graph3D.cpp:178
Graph3D::alpha
double alpha
Definition: Graph3D.h:381
UserFunction::UserFunction
UserFunction(const QString &s, SurfacePlot &pw)
Definition: Graph3D.cpp:56
Graph3D::yRotation
double yRotation()
Definition: Graph3D.h:219
Graph3D
3D graph widget.
Definition: Graph3D.h:57
Graph3D::crossHairLineWidth
double crossHairLineWidth
Definition: Graph3D.h:381
UserFunction::formula
QString formula
Definition: Graph3D.h:400
Graph3D::contextMenuEvent
void contextMenuEvent(QContextMenuEvent *e)
Definition: Graph3D.cpp:1716
Graph3D::modified
void modified()
Graph3D::setResolution
void setResolution(int r)
Definition: Graph3D.cpp:2635
Graph3D::setBoxed
void setBoxed()
Definition: Graph3D.cpp:1735
Graph3D::setScale
void setScale(double xVal, double yVal, double zVal)
Definition: Graph3D.cpp:2365
Graph3D::resolution
int resolution()
Definition: Graph3D.h:295
Graph3D::setXAxisLabelFont
void setXAxisLabelFont(const QFont &fnt)
Definition: Graph3D.cpp:832
Graph3D::exportPDF
void exportPDF(const QString &fileName)
Definition: Graph3D.cpp:2066
Graph3D::zStop
double zStop()
Definition: Graph3D.cpp:1149
Graph3D::Dots
@ Dots
Definition: Graph3D.h:65
Column.h
Matrix::allocateMatrixData
static double ** allocateMatrixData(int rows, int columns)
Allocate memory for a matrix buffer.
Definition: Matrix.cpp:696
QStringFromString
QString QStringFromString(const std::string &x)
Definition: QStringStdString.h:15
Graph3D::d_autoscale
bool d_autoscale
Definition: Graph3D.h:373
Graph3D::ignoreFonts
bool ignoreFonts
Definition: Graph3D.h:379
data
Definition: exp_saturation.c:37
Graph3D::legendMajorTicks
int legendMajorTicks
Definition: Graph3D.h:378
Graph3D::setFloorGrid
void setFloorGrid(bool b)
Definition: Graph3D.cpp:1981
Graph3D::setAxesLabels
void setAxesLabels(const QStringList &lst)
Definition: Graph3D.cpp:1011
Graph3D::numColor
QColor numColor()
Definition: Graph3D.h:268
Graph3D::crossHairBoxed
bool crossHairBoxed
Definition: Graph3D.h:384
Matrix::xStart
double xStart()
Return the X value corresponding to column 1.
Definition: Matrix.h:263
MyWidget::showTitleBarMenu
void showTitleBarMenu()
Emitted when the title bar recieves a QContextMenuEvent.
MyWidget::windowLabel
virtual QString windowLabel()
Return the window label.
Definition: MyWidget.h:76
Graph3D::titleCol
QColor titleCol
Definition: Graph3D.h:375
Graph3D::updateZoom
void updateZoom(double val)
Definition: Graph3D.cpp:2380
Graph3D::isOrthogonal
bool isOrthogonal()
Definition: Graph3D.h:127
Graph3D::title
QString title
Definition: Graph3D.h:370
Graph3D::scaleTicks
QStringList scaleTicks()
Definition: Graph3D.cpp:1195
Graph3D::scaleLimits
QStringList scaleLimits()
Definition: Graph3D.cpp:1156
Graph3D::insertFunction
void insertFunction(const QString &s, double xl, double xr, double yl, double yr, double zl, double zr)
Definition: Graph3D.cpp:238
Graph3D::yStart
double yStart()
Definition: Graph3D.cpp:1128
Graph3D::pointStyle
PointStyle pointStyle
Definition: Graph3D.h:386
Graph3D::axesCol
QColor axesCol
Definition: Graph3D.h:375
Graph3D::coneQuality
int coneQuality()
Definition: Graph3D.h:330
Graph3D::Trajectory
@ Trajectory
Definition: Graph3D.h:64
MyWidget::captionPolicy
virtual CaptionPolicy captionPolicy()
Return the caption policy.
Definition: MyWidget.h:86
Graph3D::smoothMesh
bool smoothMesh
Definition: Graph3D.h:373
Graph3D::setFilledMesh
void setFilledMesh()
Definition: Graph3D.cpp:1767
Graph3D::bgCol
QColor bgCol
Definition: Graph3D.h:375
Graph3D::setZAxisLabelFont
void setZAxisLabelFont(const QFont &fnt)
Definition: Graph3D.cpp:848
Graph3D::deleteData
void deleteData(Qwt3D::Triple **data, int columns)
Definition: Graph3D.cpp:2738
MyWidget
Base class of all MDI client windows.
Definition: MyWidget.h:52
Graph3D::setDataColors
void setDataColors(const QColor &cMax, const QColor &cMin)
Definition: Graph3D.cpp:2757
Graph3D::setOrtho
void setOrtho(bool on=true)
Definition: Graph3D.h:128
MyWidget::name
virtual QString name()
Return the window name.
Definition: MyWidget.h:81
Graph3D::setTicks
void setTicks(const QStringList &options)
Definition: Graph3D.cpp:1480
Graph3D::titleFnt
QFont titleFnt
Definition: Graph3D.h:372
Graph3D::floorStyle
Qwt3D::FLOORSTYLE floorStyle()
Definition: Graph3D.cpp:2414
Graph3D::showOptionsDialog
void showOptionsDialog()
ColorButton.h
Bar
3D bars (modifed enrichment from QwtPlot3D)
Definition: Bar.h:36
Graph3D::numCol
QColor numCol
Definition: Graph3D.h:375
MyParser
Mathematical parser class based on muParser.
Definition: MyParser.h:52
Cone3D.h
Graph3D::boxedCrossHair
bool boxedCrossHair()
Definition: Graph3D.h:322
Graph3D::zStart
double zStart()
Definition: Graph3D.cpp:1142
Graph3D::setOptions
void setOptions(bool legend, int r, int dist)
Definition: Graph3D.cpp:2719
Graph3D::setPointsMesh
void setPointsMesh()
Definition: Graph3D.cpp:1813
UserFunction::operator()
double operator()(double x, double y)
Definition: Graph3D.cpp:62
Graph3D::setSmoothMesh
void setSmoothMesh(bool smooth)
Definition: Graph3D.cpp:2842
UserFunction::function
QString function()
Definition: Graph3D.h:400
Table
MDI window providing a spreadsheet table with column logic.
Definition: Table.h:51
MyParser::SetExpr
void SetExpr(const QString &x)
Definition: MyParser.h:56
Graph3D::HairCross
@ HairCross
Definition: Graph3D.h:65
MyWidget::resizedWindow
void resizedWindow(MyWidget *)
Graph3D::findBestLayout
void findBestLayout()
Definition: Graph3D.cpp:2934
Graph3D::setNoAxes
void setNoAxes()
Definition: Graph3D.cpp:1744
Graph3D::setBarsRadius
void setBarsRadius(double rad)
Definition: Graph3D.cpp:2118
Graph3D::barsRadius
double barsRadius()
Definition: Graph3D.cpp:2110
Graph3D::updateScaling
void updateScaling(double xVal, double yVal, double zVal)
Definition: Graph3D.cpp:2395
Matrix::name
virtual QString name()
Return the window name.
Definition: Matrix.h:59
Graph3D::setNoGrid
void setNoGrid()
Definition: Graph3D.cpp:1753
MyWidget::birthDate
virtual QString birthDate()
Return the creation date.
Definition: MyWidget.h:91
Graph3D::changeTransparency
void changeTransparency(double t)
Definition: Graph3D.cpp:2807
Graph3D::smoothPoints
bool smoothPoints()
Definition: Graph3D.h:318
Graph3D::grids
int grids()
Definition: Graph3D.cpp:1939
Graph3D::saveAsTemplate
QString saveAsTemplate(const QString &geometryInfo)
Definition: Graph3D.cpp:2854
Graph3D::animation_redraw_wait
int animation_redraw_wait
Wait this many msecs before redraw 3D plot (used for animations)
Definition: Graph3D.h:365
Column::isInvalid
bool isInvalid(int row) const override
Return whether a certain row contains an invalid value
Definition: Column.cpp:598
Graph3D::setConesOptions
void setConesOptions(double rad, int quality)
Definition: Graph3D.cpp:2167
Graph3D::conesRad
double conesRad
Definition: Graph3D.h:381
Graph3D::zRotation
double zRotation()
Definition: Graph3D.h:220
Graph3D::crossHairRad
double crossHairRad
Definition: Graph3D.h:381
Graph3D::meshCol
QColor meshCol
Definition: Graph3D.h:375
Graph3D::saveToString
QString saveToString(const QString &geometry)
Definition: Graph3D.cpp:2432
Graph3D::setFloorData
void setFloorData()
Definition: Graph3D.cpp:1895
Graph3D::~Graph3D
~Graph3D()
Definition: Graph3D.cpp:3014
Graph3D::transparency
double transparency()
Definition: Graph3D.h:261
Graph3D::setHiddenLineGrid
void setHiddenLineGrid()
Definition: Graph3D.cpp:1781
Graph3D::Scatter
@ Scatter
Definition: Graph3D.h:64
Graph3D::labelsDist
int labelsDist
Definition: Graph3D.h:378
Graph3D::Graph3D
Graph3D(const QString &label, QWidget *parent=0, const char *name=0, Qt::WindowFlags f=0)
Definition: Graph3D.cpp:88
Graph3D::maxDataColor
QColor maxDataColor()
Definition: Graph3D.cpp:2752
Graph3D.h
Graph3D::scaleFonts
void scaleFonts(double factor)
Definition: Graph3D.cpp:1677
Graph3D::yShift
double yShift()
Definition: Graph3D.h:227
Graph3D::setLineGrid
void setLineGrid()
Definition: Graph3D.cpp:1797
Graph3D::yAxisLabelFont
QFont yAxisLabelFont()
Definition: Graph3D.cpp:1104
Graph3D::setBarsPlot
void setBarsPlot()
Definition: Graph3D.cpp:1878
Table::colX
int colX(int col)
Definition: Table.cpp:332
Graph3D::None
@ None
Definition: Graph3D.h:65
Graph3D::updateScalesFromMatrix
void updateScalesFromMatrix(double xl, double xr, double yl, double yr, double zl, double zr)
Definition: Graph3D.cpp:1336
Graph3D::updatePoints
void updatePoints(double size, bool sm)
Definition: Graph3D.cpp:2136
Graph3D::update
void update()
Definition: Graph3D.cpp:792
Bar.h
Graph3D::smoothCrossHair
bool smoothCrossHair()
Definition: Graph3D.h:321
Graph3D::updateMatrixData
void updateMatrixData(Matrix *m)
Definition: Graph3D.cpp:723
Matrix::numCols
int numCols()
Return the number of columns.
Definition: Matrix.cpp:293
Graph3D::addMatrixData
void addMatrixData(Matrix *m)
Definition: Graph3D.cpp:319
Graph3D::formula
QString formula()
Definition: Graph3D.cpp:2424
Graph3D::isLegendOn
bool isLegendOn()
Definition: Graph3D.h:301
Graph3D::func
UserFunction * func
Definition: Graph3D.h:68
Graph3D::plotStyle
Qwt3D::PLOTSTYLE plotStyle()
Definition: Graph3D.cpp:2409
Graph3D::setGrid
void setGrid(Qwt3D::SIDE s, bool b)
Definition: Graph3D.cpp:1944
Graph3D::scaleType
QVector< int > scaleType
Definition: Graph3D.h:374
Graph3D::eventFilter
bool eventFilter(QObject *object, QEvent *e)
Definition: Graph3D.cpp:2091
Graph3D::setCrossOptions
void setCrossOptions(double rad, double linewidth, bool smooth, bool boxed)
Definition: Graph3D.cpp:2192
Graph3D::updateColors
void updateColors(const QColor &meshColor, const QColor &axesColor, const QColor &numColor, const QColor &labelColor, const QColor &bgColor, const QColor &gridColor)
Definition: Graph3D.cpp:1633
Graph3D::axesLabels
QStringList axesLabels()
Definition: Graph3D.h:130
Graph3D::setCeilGrid
void setCeilGrid(bool b)
Definition: Graph3D.cpp:1977
python-sipcmd.dist
dist
Definition: python-sipcmd.py:52
Graph3D::setBackGrid
void setBackGrid(bool b)
Definition: Graph3D.cpp:1989
Graph3D::initPlot
void initPlot()
Definition: Graph3D.cpp:94
Graph3D::print
void print()
Definition: Graph3D.cpp:1994
Graph3D::d_timer
QTimer * d_timer
Definition: Graph3D.h:369
Graph3D::xScale
double xScale()
Definition: Graph3D.h:222
Graph3D::numbersFont
QFont numbersFont()
Definition: Graph3D.cpp:814
Graph3D::xAxisLabelFont
QFont xAxisLabelFont()
Definition: Graph3D.cpp:1099
Graph3D::PointStyle
PointStyle
Definition: Graph3D.h:65
Graph3D::sp
Qwt3D::SurfacePlot * sp
Definition: Graph3D.h:67
Graph3D::setPointOptions
void setPointOptions(double size, bool s)
Definition: Graph3D.cpp:2101
Graph3D::setYAxisLabelFont
void setYAxisLabelFont(const QFont &fnt)
Definition: Graph3D.cpp:840
Graph3D::smooth
bool smooth
Draw 3D points with smoothed angles.
Definition: Graph3D.h:383
Graph3D::copy
void copy(Graph3D *g)
Definition: Graph3D.cpp:2957
Graph3D::resetAxesLabels
void resetAxesLabels()
Definition: Graph3D.cpp:993
Graph3D::updateCross
void updateCross(double rad, double linewidth, bool smooth, bool boxed)
Definition: Graph3D.cpp:2173
Graph3D::xShift
double xShift()
Definition: Graph3D.h:226
Graph3D::updateData
void updateData(Table *table)
Definition: Graph3D.cpp:579
Graph3D::bgColor
QColor bgColor()
Definition: Graph3D.h:269
Graph3D::toColor
QColor toColor
Definition: Graph3D.h:377
Graph3D::setConesMesh
void setConesMesh()
Definition: Graph3D.cpp:1827
Graph3D::zShift
double zShift()
Definition: Graph3D.h:228
Graph3D::xRotation
double xRotation()
Definition: Graph3D.h:218
Graph3D::exportImage
void exportImage(const QString &fileName, int quality=100, bool transparent=false)
Definition: Graph3D.cpp:2028
Graph3D::xStop
double xStop()
Definition: Graph3D.cpp:1121
Graph3D::setStyle
void setStyle(Qwt3D::COORDSTYLE coord, Qwt3D::FLOORSTYLE floor, Qwt3D::PLOTSTYLE plot, Graph3D::PointStyle point)
Definition: Graph3D.cpp:2200
Graph3D::zoom
double zoom()
Definition: Graph3D.h:230
Table::colName
QString colName(int col)
Definition: Table.cpp:765
Graph3D::clearData
void clearData()
Definition: Graph3D.cpp:1859
Graph3D::rotationChanged
void rotationChanged(double, double, double)
Definition: Graph3D.cpp:973
Graph3D::coordStyle
Qwt3D::COORDSTYLE coordStyle()
Definition: Graph3D.cpp:2419
Graph3D::openColorMap
bool openColorMap(ColorVector &cv, QString fname)
Definition: Graph3D.cpp:2903
Graph3D::gridColor
QColor gridColor()
Definition: Graph3D.h:270
UserFunction
Class for user defined functions.
Definition: Graph3D.h:394
Graph3D::rotate
void rotate()
Used for the animation: rotates the scene with 1/360 degrees.
Definition: Graph3D.cpp:2875
Graph3D::resizeEvent
void resizeEvent(QResizeEvent *)
Definition: Graph3D.cpp:1699
Graph3D::adjustLabels
void adjustLabels(int val)
Definition: Graph3D.cpp:802
MyWidget::setBirthDate
virtual void setBirthDate(const QString &s)
Set the creation date.
Definition: MyWidget.h:93
Graph3D::userFunction
UserFunction * userFunction()
Definition: Graph3D.cpp:784
Graph3D::addFunction
void addFunction(const QString &s, double xl, double xr, double yl, double yr, double zl, double zr)
Definition: Graph3D.cpp:212
Graph3D::axisTickLengths
QStringList axisTickLengths()
Definition: Graph3D.cpp:883
Graph3D::color_map
QString color_map
File name of the color map used for the data (if any)
Definition: Graph3D.h:367
Graph3D::meshColor
QColor meshColor()
Definition: Graph3D.h:265
Graph3D::setFrontGrid
void setFrontGrid(bool b)
Definition: Graph3D.cpp:1985
COLORNAME
static QString COLORNAME(QColor c)
Definition: ColorButton.h:42
Graph3D::style_
Qwt3D::PLOTSTYLE style_
Definition: Graph3D.h:389
Graph3D::updateScale
void updateScale(int axis, const QStringList &options)
Definition: Graph3D.cpp:1218
Graph3D::setEmptyFloor
void setEmptyFloor()
Definition: Graph3D.cpp:1917
Graph3D::changeDataColumn
void changeDataColumn(Table *table, const QString &colName)
Definition: Graph3D.cpp:435
name
char * name()
Definition: exp_saturation.c:45
Graph3D::titleFont
QFont titleFont()
Definition: Graph3D.h:284
Graph3D::isAnimated
bool isAnimated()
Definition: Graph3D.h:347
Graph3D::updateTitle
void updateTitle(const QString &s, const QColor &color, const QFont &font)
Definition: Graph3D.cpp:2677
Graph3D::updateTickLength
void updateTickLength(int, double majorLength, double minorLength)
Definition: Graph3D.cpp:932
Graph3D::pointsSize
double pointsSize()
Definition: Graph3D.h:317
Graph3D::titleColor
QColor titleColor()
Definition: Graph3D.h:287
COLORVALUE
static QString COLORVALUE(QString s)
Definition: ColorButton.h:43
Graph3D::showWorksheet
void showWorksheet()
Definition: Graph3D.cpp:2834
Graph3D::setTickLengths
void setTickLengths(const QStringList &lst)
Definition: Graph3D.cpp:903
Cone3D
3D cone class (based on QwtPlot3D)
Definition: Cone3D.h:36
Graph3D::crossHairRadius
double crossHairRadius()
Definition: Graph3D.h:323
Graph3D::resetNonEmptyStyle
void resetNonEmptyStyle()
Definition: Graph3D.cpp:751
Graph3D::crossHairSmooth
bool crossHairSmooth
Definition: Graph3D.h:384
Graph3D::yStop
double yStop()
Definition: Graph3D.cpp:1135
Graph3D::d_matrix
Matrix * d_matrix
Definition: Graph3D.h:388
Graph3D::plotAssociation
QString plotAssociation
Definition: Graph3D.h:370
Graph3D::setLeftGrid
void setLeftGrid(bool b)
Definition: Graph3D.cpp:1969
Graph3D::setFloorIsolines
void setFloorIsolines()
Definition: Graph3D.cpp:1906
Graph3D::plotTitle
QString plotTitle()
Definition: Graph3D.h:286
Graph3D::insertNewData
void insertNewData(Table *table, const QString &colName)
Definition: Graph3D.cpp:425
Graph3D::shiftChanged
void shiftChanged(double, double, double)
Definition: Graph3D.cpp:983
Graph3D::col_
Qwt3D::StandardColor * col_
Definition: Graph3D.h:380
Graph3D::gridCol
QColor gridCol
Definition: Graph3D.h:375
Graph3D::setColors
void setColors(const QStringList &colors)
Definition: Graph3D.cpp:1601
Graph3D::allocateData
Qwt3D::Triple ** allocateData(int columns, int rows)
Definition: Graph3D.cpp:2727
Graph3D::setRightGrid
void setRightGrid(bool b)
Definition: Graph3D.cpp:1973
Graph3D::setRotation
void setRotation(double xVal, double yVal, double zVal)
Definition: Graph3D.cpp:2360
Graph3D::Cones
@ Cones
Definition: Graph3D.h:65
Graph3D::setShift
void setShift(double xVal, double yVal, double zVal)
Definition: Graph3D.cpp:2370
Graph3D::custom3DActions
void custom3DActions(MyWidget *)
Graph3D::setTransparency
void setTransparency(double t)
Definition: Graph3D.cpp:2823
Matrix::yEnd
double yEnd()
Return the Y value corresponding to the last row.
Definition: Matrix.h:269
Graph3D::updateBars
void updateBars(double rad)
Definition: Graph3D.cpp:2126
Graph3D::coneRadius
double coneRadius()
Definition: Graph3D.h:329
Graph3D::setZoom
void setZoom(double val)
Definition: Graph3D.cpp:2375
Graph3D::setMeshLineWidth
void setMeshLineWidth(int lw)
Definition: Graph3D.cpp:1928
Graph3D::showColorLegend
void showColorLegend(bool show)
Definition: Graph3D.cpp:2622
Table::colY
int colY(int col)
Definition: Table.cpp:337
Graph3D::setTitleFont
void setTitleFont(const QFont &font)
Definition: Graph3D.cpp:2699
Graph3D::zScale
double zScale()
Definition: Graph3D.h:224
Table::colIndex
int colIndex(const QString &name)
Definition: Table.cpp:1017
Graph3D::scaleChanged
void scaleChanged(double, double, double)
Definition: Graph3D.cpp:978
Graph3D::animate
void animate(bool on=true)
Definition: Graph3D.cpp:2867
Graph3D::pointSize
double pointSize
Definition: Graph3D.h:381
Graph3D::xStart
double xStart()
Definition: Graph3D.cpp:1114
Graph3D::minDataColor
QColor minDataColor()
Definition: Graph3D.cpp:2747
Graph3D::zAxisLabelFont
QFont zAxisLabelFont()
Definition: Graph3D.cpp:1109
Graph3D::changeMatrix
void changeMatrix(Matrix *m)
Definition: Graph3D.cpp:311
Graph3D::updateScales
void updateScales(double xl, double xr, double yl, double yr, double zl, double zr)
Definition: Graph3D.cpp:1300
Graph3D::exportVector
void exportVector(const QString &fileName, const QString &fileType="pdf")
Definition: Graph3D.cpp:2071
Graph3D::updateCones
void updateCones(double rad, int quality)
Definition: Graph3D.cpp:2153
Graph3D::labelsCol
QColor labelsCol
Definition: Graph3D.h:375
Graph3D::meshLineWidth
double meshLineWidth()
Definition: Graph3D.h:190
Graph3D::setTitle
void setTitle(const QStringList &lst)
Definition: Graph3D.cpp:2647
Graph3D::axesColor
QColor axesColor()
Definition: Graph3D.h:266
Graph3D::labels
QStringList labels
Definition: Graph3D.h:371
Graph3D::addData
void addData(Table *table, const QString &colName)
Definition: Graph3D.cpp:294
Graph3D::setCrossMesh
void setCrossMesh()
Definition: Graph3D.cpp:1845
Graph3D::crossHairLinewidth
double crossHairLinewidth()
Definition: Graph3D.h:324
Matrix::numRows
int numRows()
Return the number of rows.
Definition: Matrix.cpp:283
UserFunction::~UserFunction
~UserFunction()
Definition: Graph3D.cpp:84
Graph3D::pointType
PointStyle pointType()
Definition: Graph3D.h:335
Matrix::freeMatrixData
static void freeMatrixData(double **data, int rows)
Free memory used for a matrix buffer.
Definition: Matrix.cpp:705
Graph3D::yScale
double yScale()
Definition: Graph3D.h:223
Matrix::cell
double cell(int row, int col)
Return the value of the cell as a double.
Definition: Matrix.cpp:134
Graph3D::worksheet
Table * worksheet
Definition: Graph3D.h:387
Graph3D::setNumbersFont
void setNumbersFont(const QFont &font)
Definition: Graph3D.cpp:819
Graph3D::legendOn
bool legendOn
Definition: Graph3D.h:373
Table::numRows
int numRows()
Definition: Table.cpp:887
Graph3D::labelsDistance
int labelsDistance()
Definition: Graph3D.h:171