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)  

PlotDialog.cpp
Go to the documentation of this file.
1 
11 
29 #include "ApplicationWindow.h"
30 #include "PlotDialog.h"
31 #include "ColorButton.h"
32 #include "PenWidget.h"
33 #include "PatternBox.h"
34 #include "SymbolBox.h"
35 #include "Table.h"
36 #include "MyParser.h"
37 #include "QwtHistogram.h"
38 #include "VectorCurve.h"
39 #include "QwtErrorPlotCurve.h"
40 #include "BoxCurve.h"
41 #include "FunctionCurve.h"
42 #include "Spectrogram.h"
43 #include "QwtPieCurve.h"
44 #include "ColorMapEditor.h"
45 #include "QStringStdString.h"
46 #include "core/column/Column.h"
47 
48 #include <QTreeWidget>
49 #include <QLineEdit>
50 #include <QLayout>
51 #include <QSpinBox>
52 #include <QCheckBox>
53 #include <QPushButton>
54 #include <QRadioButton>
55 #include <QLabel>
56 #include <QWidget>
57 #include <QMessageBox>
58 #include <QComboBox>
59 #include <QWidgetList>
60 #include <QFileDialog>
61 #include <QGroupBox>
62 #include <QFontDialog>
63 #include <QShortcut>
64 #include <QKeySequence>
65 #include <QDoubleSpinBox>
66 #include <QMenu>
67 #include <QDateTime>
68 
69 PlotDialog::PlotDialog(bool showExtended, QWidget* parent, Qt::WindowFlags fl )
70 : QDialog(parent, fl),
71  d_ml(0)
72 {
73  setWindowTitle( tr( "Plot details" ) );
74 
75  listBox = new QTreeWidget();
76  listBox->setColumnCount(1);
77  listBox->header()->hide();
78  listBox->setIndentation(15);
79 
80  QGridLayout *gl = new QGridLayout(this);
81  gl->setSizeConstraint(QLayout::SetFixedSize);
82  gl->addWidget(listBox, 0, 0);
83 
84  privateTabWidget = new QTabWidget();
85  gl->addWidget(privateTabWidget, 0, 1);
86 
87  curvePlotTypeBox = new QWidget();
88  QHBoxLayout *hb1 = new QHBoxLayout(curvePlotTypeBox);
89  hb1->addWidget(new QLabel(tr("Plot type")));
90  boxPlotType = new QComboBox();
91  boxPlotType->setEditable(false);
92  hb1->addWidget(boxPlotType);
93  gl->addWidget(curvePlotTypeBox, 1, 0);
94 
95  initAxesPage();
96  initLinePage();
100  initSpacingPage();
101  initVectPage();
102  initBoxPage();
105  initPiePage();
106  initLayerPage();
107  initFontsPage();
108  initPrintPage();
109 
110  clearTabWidget();
111 
112  QHBoxLayout* hb2 = new QHBoxLayout();
113  btnMore = new QPushButton("&<<");
114  btnMore->setFixedWidth(30);
115  btnMore->setCheckable(true);
116  if (showExtended)
117  btnMore->toggle ();
118  hb2->addWidget(btnMore);
119  btnWorksheet = new QPushButton(tr( "&Worksheet" ) );
120  hb2->addWidget(btnWorksheet);
121  buttonOk = new QPushButton(tr( "&OK" ));
122  buttonOk->setDefault( true );
123  hb2->addWidget(buttonOk);
124  buttonCancel = new QPushButton(tr( "&Cancel" ));
125  hb2->addWidget(buttonCancel);
126  buttonApply = new QPushButton(tr( "&Apply" ));
127  hb2->addWidget(buttonApply);
128  btnEditCurve = new QPushButton(tr("&Plot Associations..."));
129  hb2->addWidget(btnEditCurve);
130  hb2->addStretch();
131  gl->addLayout(hb2, 1, 1);
132 
133  connect(btnMore, SIGNAL(toggled(bool)), this, SLOT(showAll(bool)));
134 
135  connect( buttonOk, SIGNAL(clicked()), this, SLOT(quit() ) );
136  connect( buttonCancel, SIGNAL(clicked()), this, SLOT(close()));
137  connect( buttonApply, SIGNAL(clicked() ), this, SLOT(acceptParams() ) );
138  connect( btnWorksheet, SIGNAL(clicked()), this, SLOT(showWorksheet()));
139  connect( btnEditCurve, SIGNAL(clicked()), this, SLOT(editCurve()));
140  connect(listBox, SIGNAL(itemDoubleClicked( QTreeWidgetItem *, int)),
141  this, SLOT(showPlotAssociations( QTreeWidgetItem *, int)));
142  connect(listBox, SIGNAL(currentItemChanged (QTreeWidgetItem *, QTreeWidgetItem *)),
143  this, SLOT(updateTabWindow(QTreeWidgetItem *, QTreeWidgetItem *)));
144  connect(listBox, SIGNAL(itemCollapsed(QTreeWidgetItem *)), this, SLOT(updateTreeWidgetItem(QTreeWidgetItem *)));
145  connect(listBox, SIGNAL(itemExpanded(QTreeWidgetItem *)), this, SLOT(updateTreeWidgetItem(QTreeWidgetItem *)));
146  connect(boxPlotType, SIGNAL(currentIndexChanged(int)), this, SLOT(changePlotType(int)));
147 
148  QShortcut *shortcut = new QShortcut(QKeySequence(Qt::Key_Delete), this);
149  connect(shortcut, SIGNAL(activated()), this, SLOT(removeSelectedCurve()));
150 }
151 
152 void PlotDialog::showAll(bool all)
153 {
154  if(all)
155  {
156  listBox->show();
157  listBox->setFocus();
158 
159  QTreeWidgetItem *item = listBox->currentItem();
160  if (item->type() == CurveTreeItem::PlotCurveTreeItem)
161  curvePlotTypeBox->show();
162 
163  btnMore->setText("&>>");
164  }
165  else
166  {
167  listBox->hide();
168  curvePlotTypeBox->hide();
169  btnMore->setText("&<<");
170  }
171 }
172 
173 void PlotDialog::showPlotAssociations(QTreeWidgetItem *item, int)
174 {
175  if (!item)
176  return;
177 
178  ApplicationWindow *app = (ApplicationWindow *)this->parent();
179  if (!app)
180  return;
181 
182  if (item->type() != CurveTreeItem::PlotCurveTreeItem)
183  return;
184 
185  QwtPlotItem *it = (QwtPlotItem *)((CurveTreeItem *)item)->plotItem();
186  if (!it)
187  return;
188 
189  if (it->rtti() == QwtPlotItem::Rtti_PlotSpectrogram)
190  {
191  Spectrogram *sp = (Spectrogram *)it;
192  if (sp->matrix())
193  sp->matrix()->showMaximized();
194  return;
195  }
196 
197  if (((PlotCurve *)it)->type() == Graph::Function)
198  {
199  close();
200  app->showFunctionDialog(((CurveTreeItem *)item)->graph(), ((CurveTreeItem *)item)->plotItemIndex());
201  }
202  else
203  {
204 #if QT_VERSION >= 0x050000
205  close();
206 #endif
207  app->showPlotAssociations(((CurveTreeItem *)item)->plotItemIndex());
208 #if QT_VERSION < 0x050000
209  close();
210 #endif
211  }
212 }
213 
215 {
216  ApplicationWindow *app = (ApplicationWindow *)this->parent();
217 
218  CurveTreeItem *item = (CurveTreeItem *)listBox->currentItem();
219  if (!item)
220  return;
221  if (item->type() != CurveTreeItem::PlotCurveTreeItem)
222  return;
223 
224  int index = item->plotItemIndex();
225  int curveType = ((PlotCurve *)item->plotItem())->type();
226 
227 #if QT_VERSION >= 0x050000
228  close();
229 #endif
230 
231  if (app)
232  {
233  if (curveType == Graph::Function)
234  app->showFunctionDialog(item->graph(), index);
235  else
236  app->showPlotAssociations(index);
237  }
238 
239 #if QT_VERSION < 0x050000
240  close();
241 #endif
242 }
243 
244 void PlotDialog::changePlotType(int new_curve_type)
245 {
246  CurveTreeItem *item = (CurveTreeItem *)listBox->currentItem();
247  if (!item || item->type() != CurveTreeItem::PlotCurveTreeItem)
248  return;
249  Graph *graph = item->graph();
250  if (!graph)
251  return;
252 
253  int old_curve_type = item->plotItemType();
254  if (boxPlotType->count() == 1 || (old_curve_type == new_curve_type))
255  return;
256 
257  if (old_curve_type == Graph::ColorMap || old_curve_type == Graph::ContourMap || old_curve_type == Graph::GrayMap)
258  clearTabWidget();
259  else if (old_curve_type == Graph::VectXYAM || old_curve_type == Graph::VectXYXY)
260  {
261  clearTabWidget();
262  insertTabs(old_curve_type);
263 
264  graph->setCurveType(item->plotItemIndex(), (Graph::CurveType)new_curve_type);
265  customVectorsPage(new_curve_type);
266  }
267  else
268  {
269  clearTabWidget();
270  insertTabs(new_curve_type);
271 
272  graph->setCurveType(item->plotItemIndex(), (Graph::CurveType)new_curve_type);
273 
274  boxConnect->setCurrentIndex(1);//show line for Line and LineSymbol plots
275 
276  if (new_curve_type)
277  {
278  boxSymbolStyle->setCurrentIndex(1);
279  boxFillSymbol->setChecked(true);
280  boxFillColor->setEnabled(true);
281  }
282  }
283  acceptParams();
284 }
285 
287 {
288  QGroupBox *boxFonts = new QGroupBox();
289  QGridLayout *fl = new QGridLayout(boxFonts);
290 
291  btnTitle = new QPushButton(tr("Titles"));
292  btnAxesLabels = new QPushButton(tr("Axes Labels"));
293  btnAxesNumbers = new QPushButton(tr("Axes Numbers"));
294  btnLegend = new QPushButton(tr("Legends"));
295 
296  fl->addWidget(btnTitle, 0, 0);
297  fl->addWidget(btnAxesLabels, 0, 1);
298  fl->addWidget(btnAxesNumbers, 0, 2);
299  fl->addWidget(btnLegend, 0, 3);
300  fl->setRowStretch(1, 1);
301  fl->setColumnStretch(4, 1);
302 
303  fontsPage = new QWidget();
304  QHBoxLayout *hl = new QHBoxLayout(fontsPage);
305  hl->addWidget(boxFonts);
306  privateTabWidget->addTab(fontsPage, tr( "Fonts" ) );
307 
308  connect( btnTitle, SIGNAL( clicked() ), this, SLOT( setTitlesFont() ) );
309  connect( btnAxesLabels, SIGNAL( clicked() ), this, SLOT( setAxesLabelsFont() ) );
310  connect( btnAxesNumbers, SIGNAL( clicked() ), this, SLOT( setAxesNumbersFont() ) );
311  connect( btnLegend, SIGNAL( clicked() ), this, SLOT( setLegendsFont() ) );
312 }
313 
315 {
316  layerPage = new QWidget();
317 
318  QGroupBox * boxBkg = new QGroupBox();
319  QGridLayout * boxBkgLayout = new QGridLayout( boxBkg );
320 
321  boxBkgLayout->addWidget( new QLabel(tr( "Background Color" )), 0, 0 );
323  boxBkgLayout->addWidget( boxBackgroundColor, 0, 1 );
324  boxBkgLayout->addWidget( new QLabel(tr( "Opacity" )), 0, 2 );
325  boxBackgroundTransparency = new QSpinBox();
326  boxBackgroundTransparency->setRange(0, 255);
327  boxBackgroundTransparency->setSingleStep(5);
328  boxBackgroundTransparency->setWrapping(true);
329  boxBackgroundTransparency->setSpecialValueText(tr("Transparent"));
330  boxBkgLayout->addWidget( boxBackgroundTransparency, 0, 3 );
331 
332  boxBkgLayout->addWidget( new QLabel(tr("Canvas Color" )), 1, 0);
333  boxCanvasColor = new ColorButton();
334  boxBkgLayout->addWidget( boxCanvasColor, 1, 1 );
335  boxBkgLayout->addWidget( new QLabel(tr( "Opacity" )), 1, 2 );
336  boxCanvasTransparency = new QSpinBox();
337  boxCanvasTransparency->setRange(0, 255);
338  boxCanvasTransparency->setSingleStep(5);
339  boxCanvasTransparency->setWrapping(true);
340  boxCanvasTransparency->setSpecialValueText(tr("Transparent"));
341  boxBkgLayout->addWidget( boxCanvasTransparency, 1, 3 );
342 
343  boxBkgLayout->addWidget( new QLabel(tr("Border Color" )), 2, 0);
344  boxBorderColor = new ColorButton();
345  boxBkgLayout->addWidget( boxBorderColor, 2, 1);
346 
347  boxBkgLayout->addWidget( new QLabel(tr( "Width" )), 2, 2);
348  boxBorderWidth = new QSpinBox();
349  boxBkgLayout->addWidget( boxBorderWidth, 2, 3);
350  boxBkgLayout->setRowStretch( 4, 1 );
351 
352  QGroupBox * box4 = new QGroupBox(QString());
353  QGridLayout * box4Layout = new QGridLayout( box4 );
354 
355  box4Layout->addWidget( new QLabel(tr( "Margin" )), 0, 0 );
356  boxMargin = new QSpinBox();
357  boxMargin->setRange( 0, 1000 );
358  boxMargin->setSingleStep(5);
359  box4Layout->addWidget( boxMargin, 0, 1 );
360 
361  boxAntialiasing = new QCheckBox(tr("Antialiasing"));
362  box4Layout->addWidget( boxAntialiasing, 1, 1 );
363 
364  boxAll = new QCheckBox(tr("Apply to all layers"));
365  box4Layout->addWidget( boxAll, 2, 1 );
366  box4Layout->setRowStretch( 3, 1 );
367 
368  QHBoxLayout * hl = new QHBoxLayout( layerPage );
369  hl->addWidget(boxBkg);
370  hl->addWidget(box4);
371 
372  privateTabWidget->addTab(layerPage, tr("Layer"));
373 
374  connect(boxBackgroundTransparency, SIGNAL(valueChanged(int)), this, SLOT(updateBackgroundTransparency(int)));
375  connect(boxCanvasTransparency, SIGNAL(valueChanged(int)), this, SLOT(updateCanvasTransparency(int)));
376  connect(boxAntialiasing, SIGNAL(toggled(bool)), this, SLOT(updateAntialiasing(bool)));
377  connect(boxMargin, SIGNAL(valueChanged (int)), this, SLOT(changeMargin(int)));
378  connect(boxBorderColor, SIGNAL(changed(QColor)), this, SLOT(pickBorderColor(QColor)));
379  connect(boxBackgroundColor, SIGNAL(changed(QColor)), this, SLOT(pickBackgroundColor(QColor)));
380  connect(boxCanvasColor, SIGNAL(changed(QColor)), this, SLOT(pickCanvasColor(QColor)));
381  connect(boxBorderWidth,SIGNAL(valueChanged (int)), this, SLOT(updateBorder(int)));
382 }
383 
385 {
386  piePage = new QWidget();
387 
388  QGridLayout *gl1 = new QGridLayout();
389  gl1->addWidget(new QLabel( tr( "Color" )), 0, 0);
390 
392  gl1->addWidget(boxPieLineColor, 0, 1);
393 
394  gl1->addWidget(new QLabel(tr( "Style" )), 1, 0);
395  boxPieLineStyle = new QComboBox();
396  boxPieLineStyle->addItem("_____");
397  boxPieLineStyle->addItem("- - -");
398  boxPieLineStyle->addItem(".....");
399  boxPieLineStyle->addItem("_._._");
400  boxPieLineStyle->addItem("_.._..");
401  gl1->addWidget(boxPieLineStyle);
402 
403  gl1->addWidget(new QLabel(tr( "Width")), 2, 0);
404  boxPieLineWidth = new QSpinBox();
405  gl1->addWidget(boxPieLineWidth, 2, 1);
406  gl1->setRowStretch(3,1);
407 
408  QGroupBox *gb1 = new QGroupBox(tr( "Border" ));
409  gb1->setLayout(gl1);
410 
411  QGridLayout *gl2 = new QGridLayout();
412  gl2->addWidget(new QLabel( tr( "First color" )), 0, 0);
413 
414  boxFirstColor = new ColorButton();
415  gl2->addWidget(boxFirstColor, 0, 1);
416 
417  gl2->addWidget(new QLabel( tr( "Pattern" )), 1, 0);
418  boxPiePattern = new PatternBox();
419  gl2->addWidget(boxPiePattern, 1, 1);
420  gl2->addWidget(new QLabel( tr( "Pie radius" )), 2, 0);
421 
422  boxRadius = new QSpinBox();
423  boxRadius->setRange(0, 10000);
424  boxRadius->setSingleStep(10);
425 
426  gl2->addWidget(boxRadius, 2, 1);
427  gl2->setRowStretch(3,1);
428 
429  QGroupBox *gb2 = new QGroupBox(tr( "Fill" ));
430  gb2->setLayout(gl2);
431 
432  QHBoxLayout* hl = new QHBoxLayout();
433  hl->addWidget(gb1);
434  hl->addWidget(gb2);
435  piePage->setLayout(hl);
436 
437  privateTabWidget->addTab(piePage, tr( "Pie" ) );
438 }
439 
441 {
442  QGroupBox *gb = new QGroupBox();
443  QVBoxLayout *vl = new QVBoxLayout(gb);
444  boxScaleLayers = new QCheckBox(tr("&Scale layers to paper size"));
445  vl->addWidget(boxScaleLayers);
446  boxPrintCrops = new QCheckBox(tr("Print Crop &Marks"));
447  vl->addWidget(boxPrintCrops);
448  vl->addStretch();
449 
450  printPage = new QWidget();
451  QHBoxLayout* hlayout = new QHBoxLayout(printPage);
452  hlayout->addWidget(gb);
453  privateTabWidget->addTab(printPage, tr( "Print" ) );
454 }
455 
457 {
458  QGroupBox *gb = new QGroupBox(tr( "Attach curve to: " ));
459  QGridLayout *gl = new QGridLayout(gb);
460  gl->addWidget(new QLabel( tr( "x Axis" )), 0, 0);
461  boxXAxis = new QComboBox();
462  boxXAxis->setEditable(false);
463  boxXAxis->addItem(tr("Bottom"));
464  boxXAxis->addItem(tr("Top"));
465  gl->addWidget(boxXAxis, 0, 1);
466  gl->addWidget(new QLabel( tr( "y Axis" )), 1, 0);
467  boxYAxis = new QComboBox();
468  boxYAxis->setEditable(false);
469  boxYAxis->addItem(tr("Left"));
470  boxYAxis->addItem(tr("Right"));
471  gl->addWidget(boxYAxis, 1, 1);
472  gl->setRowStretch (2, 1);
473  gl->setColumnStretch(2,1);
474 
475  axesPage = new QWidget();
476  QHBoxLayout* hlayout = new QHBoxLayout(axesPage);
477  hlayout->addWidget(gb);
478  privateTabWidget->addTab(axesPage, tr( "Axes" ) );
479 }
480 
482 {
483  QGroupBox *gb = new QGroupBox();
484  QGridLayout *gl1 = new QGridLayout(gb);
485  gl1->addWidget(new QLabel( tr( "Connect" )), 0, 0);
486 
487  boxConnect = new QComboBox();
488  boxConnect->setEditable(false);
489  boxConnect->addItem(tr("No line"));
490  boxConnect->addItem(tr("Lines"));
491  boxConnect->addItem(tr("Sticks"));
492  boxConnect->addItem(tr("Horizontal Steps"));
493  boxConnect->addItem(tr("Dots"));
494  boxConnect->addItem(tr("Spline"));
495  boxConnect->addItem(tr("Vertical Steps"));
496  gl1->addWidget(boxConnect, 0, 1);
497 
498  penWidget = new PenWidget(this,QPen());
499  gl1->addWidget(penWidget, 1, 0, 1, 2);
500 
501  fillGroupBox = new QGroupBox(tr( "Fill area under curve" ));
502  fillGroupBox->setCheckable(true);
503  QGridLayout *gl2 = new QGridLayout(fillGroupBox);
504  gl2->addWidget(new QLabel(tr( "Fill color" )), 0, 0);
505  boxAreaColor = new ColorButton();
506  gl2->addWidget(boxAreaColor, 0, 1);
507  gl2->addWidget(new QLabel(tr( "Pattern" )), 1, 0);
508  boxPattern = new PatternBox();
509  gl2->addWidget(boxPattern, 1, 1);
510  gl2->setRowStretch (2, 1);
511 
512  linePage = new QWidget();
513  QHBoxLayout* hlayout = new QHBoxLayout(linePage);
514  hlayout->addWidget(gb);
515  hlayout->addWidget(fillGroupBox);
516  privateTabWidget->addTab( linePage, tr( "Line" ) );
517 
518  connect(boxConnect, SIGNAL(activated(int)), this, SLOT(acceptParams()));
519  connect(penWidget, SIGNAL(penChanged(QPen)), this, SLOT(acceptParams()));
520  connect(boxPattern, SIGNAL(activated(int)), this, SLOT(acceptParams()));
521  connect(fillGroupBox, SIGNAL(toggled(bool)), this, SLOT(showAreaColor(bool)));
522  connect(fillGroupBox, SIGNAL(clicked()), this, SLOT(acceptParams()));
523 }
524 
526 {
527  QGroupBox *gb = new QGroupBox();
528  QGridLayout *gl = new QGridLayout(gb);
529  gl->addWidget(new QLabel(tr( "Style" )), 0, 0);
530  boxSymbolStyle = new SymbolBox();
531  gl->addWidget(boxSymbolStyle, 0, 1);
532  gl->addWidget(new QLabel(tr( "Size" )), 1, 0);
533  boxSymbolSize = new QSpinBox();
534  boxSymbolSize->setRange(1, 100);
535  boxSymbolSize->setValue(5);
536  gl->addWidget(boxSymbolSize, 1, 1);
537  boxFillSymbol = new QCheckBox( tr( "Fill Color" ));
538  gl->addWidget(boxFillSymbol, 2, 0);
539  boxFillColor = new ColorButton();
540  gl->addWidget(boxFillColor, 2, 1);
541  gl->addWidget(new QLabel(tr( "Edge Color" )), 3, 0);
542  boxSymbolColor = new ColorButton();
543  gl->addWidget(boxSymbolColor, 3, 1);
544  gl->addWidget(new QLabel(tr( "Edge Width" )), 4, 0);
545  boxPenWidth = new QSpinBox();
546  boxPenWidth->setRange(1, 100);
547  gl->addWidget(boxPenWidth, 4, 1);
548  gl->setRowStretch (5, 1);
549  gl->setColumnStretch(2,1);
550 
551  symbolPage = new QWidget();
552  QHBoxLayout* hl = new QHBoxLayout(symbolPage);
553  hl->addWidget(gb);
554 
555  privateTabWidget->addTab(symbolPage, tr( "Symbol" ));
556 
557  connect(boxSymbolStyle, SIGNAL(activated(int)), this, SLOT(acceptParams()));
558  connect(boxFillSymbol, SIGNAL(clicked()), this, SLOT(fillSymbols()));
559 }
560 
562 {
563  QGroupBox *gb1 = new QGroupBox(tr( "Box" ));
564  QGridLayout *gl1 = new QGridLayout(gb1);
565  gl1->addWidget(new QLabel(tr( "Type" )), 0, 0);
566 
567  boxType = new QComboBox();
568  boxType->setEditable(false);
569  boxType->addItem(tr("No Box"));
570  boxType->addItem(tr("Rectangle"));
571  boxType->addItem(tr("Diamond"));
572  boxType->addItem(tr("Perc 10, 25, 75, 90"));
573  boxType->addItem(tr("Notch"));
574  gl1->addWidget(boxType, 0, 1);
575 
576  boxRangeLabel = new QLabel(tr( "Range" ));
577  gl1->addWidget(boxRangeLabel, 1, 0);
578  boxRange = new QComboBox();
579  boxRange->setEditable(false);
580  boxRange->addItem(tr("Standard Deviation"));
581  boxRange->addItem(tr("Standard Error"));
582  boxRange->addItem(tr("Perc 25, 75"));
583  boxRange->addItem(tr("Perc 10, 90"));
584  boxRange->addItem(tr("Perc 5, 95"));
585  boxRange->addItem(tr("Perc 1, 99"));
586  boxRange->addItem(tr("Max-Min"));
587  boxRange->addItem(tr("Constant"));
588  gl1->addWidget(boxRange, 1, 1);
589 
590  boxCoeffLabel = new QLabel(tr( "Percentile (%)" ));
591  gl1->addWidget(boxCoeffLabel, 2, 0);
592  boxCoef = new QSpinBox();
593  boxCoef->setRange(50, 100);
594  boxCoef->setSingleStep(5);
595  gl1->addWidget(boxCoef, 2, 1);
596 
597  boxCntLabel = new QLabel(tr( "Coefficient" ));
598  gl1->addWidget(boxCntLabel, 3, 0);
599  boxCnt = new QDoubleSpinBox();
600  boxCnt->setRange(0.0, 100.0);
601  boxCnt->setSingleStep(0.01);
602  boxCnt->setValue(1.0);
603  gl1->addWidget(boxCnt, 3, 1);
604 
605  gl1->addWidget(new QLabel(tr( "Box Width" )), 4, 0);
606  boxWidth = new QSpinBox();
607  boxWidth->setRange(0, 100);
608  boxWidth->setSingleStep(5);
609  gl1->addWidget(boxWidth, 4, 1);
610 
611  QGroupBox *gb2 = new QGroupBox(tr( "Whiskers" ));
612  QGridLayout *gl2 = new QGridLayout(gb2);
613  whiskerRangeLabel = new QLabel(tr( "Range" ));
614  gl2->addWidget(whiskerRangeLabel, 0, 0);
615 
616  boxWhiskersRange = new QComboBox();
617  boxWhiskersRange->setEditable(false);
618  boxWhiskersRange->addItem(tr("No Whiskers"));
619  boxWhiskersRange->addItem(tr("Standard Deviation"));
620  boxWhiskersRange->addItem(tr("Standard Error"));
621  boxWhiskersRange->addItem(tr("75-25"));
622  boxWhiskersRange->addItem(tr("90-10"));
623  boxWhiskersRange->addItem(tr("95-5"));
624  boxWhiskersRange->addItem(tr("99-1"));
625  boxWhiskersRange->addItem(tr("Max-Min"));
626  boxWhiskersRange->addItem(tr("Constant"));
627  gl2->addWidget(boxWhiskersRange, 0, 1);
628 
629  whiskerCoeffLabel = new QLabel(tr( "Percentile (%)" ));
630  gl2->addWidget(whiskerCoeffLabel, 1, 0);
631  boxWhiskersCoef = new QSpinBox();
632  boxWhiskersCoef->setRange(50, 100);
633  boxWhiskersCoef->setSingleStep(5);
634  gl2->addWidget(boxWhiskersCoef, 1, 1);
635 
636  whiskerCntLabel = new QLabel(tr( "Coef" ));
637  gl2->addWidget(whiskerCntLabel, 2, 0);
638  whiskerCnt = new QDoubleSpinBox();
639  whiskerCnt->setRange(0.0, 100.0);
640  whiskerCnt->setSingleStep(0.01);
641  whiskerCnt->setValue(1.0);
642  gl2->addWidget(whiskerCnt, 2, 1);
643 
644  QVBoxLayout *vl1 = new QVBoxLayout();
645  vl1->addWidget(gb1);
646  vl1->addStretch();
647 
648  QVBoxLayout *vl2 = new QVBoxLayout();
649  vl2->addWidget(gb2);
650  vl2->addStretch();
651 
652  boxPage = new QWidget();
653  QHBoxLayout* hl = new QHBoxLayout(boxPage);
654  hl->addLayout(vl1);
655  hl->addLayout(vl2);
656  privateTabWidget->addTab(boxPage, tr( "Box/Whiskers" ) );
657 
658  connect(boxType, SIGNAL(activated(int)), this, SLOT(setBoxType(int)));
659  connect(boxRange, SIGNAL(activated(int)), this, SLOT(setBoxRangeType(int)));
660  connect(boxWhiskersRange, SIGNAL(activated(int)), this, SLOT(setWhiskersRange(int)));
661 }
662 
664 {
665  QGroupBox *gb1 = new QGroupBox(tr( "Type" ) );
666  QGridLayout *gl1 = new QGridLayout(gb1);
667  gl1->addWidget(new QLabel(tr( "Max" )), 0, 0);
668 
669  boxMaxStyle = new SymbolBox();
670  gl1->addWidget(boxMaxStyle, 0, 1);
671 
672  gl1->addWidget(new QLabel(tr( "99%" )), 1, 0);
673  box99Style = new SymbolBox();
674  gl1->addWidget(box99Style, 1, 1);
675 
676  gl1->addWidget(new QLabel(tr( "Mean" )), 2, 0);
677  boxMeanStyle = new SymbolBox();
678  gl1->addWidget(boxMeanStyle, 2, 1);
679 
680  gl1->addWidget(new QLabel(tr( "1%" )), 3, 0);
681  box1Style = new SymbolBox();
682  gl1->addWidget(box1Style, 3, 1);
683 
684  gl1->addWidget(new QLabel(tr( "Min" )), 4, 0);
685  boxMinStyle = new SymbolBox();
686  gl1->addWidget(boxMinStyle, 4, 1);
687  gl1->setRowStretch(5, 1);
688 
689  QGroupBox *gb2 = new QGroupBox(tr( "Symbol" ));
690  QGridLayout *gl2 = new QGridLayout(gb2);
691  gl2->addWidget(new QLabel(tr( "Size" )), 0, 0);
692 
693  boxPercSize = new QSpinBox();
694  boxPercSize->setMinimum( 1 );
695  gl2->addWidget(boxPercSize, 0, 1);
696 
697  boxFillSymbols = new QCheckBox(tr( "Fill Color" ));
698  gl2->addWidget(boxFillSymbols, 1, 0);
700  gl2->addWidget(boxPercFillColor, 1, 1);
701 
702  gl2->addWidget(new QLabel(tr( "Edge Color" )), 2, 0);
703  boxEdgeColor = new ColorButton();
704  gl2->addWidget(boxEdgeColor, 2, 1);
705 
706  gl2->addWidget(new QLabel(tr( "Edge Width" )), 3, 0);
707  boxEdgeWidth = new QSpinBox();
708  boxEdgeWidth->setRange(0, 100);
709  gl2->addWidget(boxEdgeWidth, 3, 1);
710  gl2->setRowStretch(4, 1);
711 
712  percentilePage = new QWidget();
713  QHBoxLayout* hl = new QHBoxLayout(percentilePage);
714  hl->addWidget(gb1);
715  hl->addWidget(gb2);
716  privateTabWidget->addTab(percentilePage, tr( "Percentile" ) );
717 
718  connect(boxMeanStyle, SIGNAL(activated(int)), this, SLOT(acceptParams()));
719  connect(boxMinStyle, SIGNAL(activated(int)), this, SLOT(acceptParams()));
720  connect(boxMaxStyle, SIGNAL(activated(int)), this, SLOT(acceptParams()));
721  connect(box99Style, SIGNAL(activated(int)), this, SLOT(acceptParams()));
722  connect(box1Style, SIGNAL(activated(int)), this, SLOT(acceptParams()));
723  connect(box1Style, SIGNAL(activated(int)), this, SLOT(acceptParams()));
724  connect(boxFillSymbols, SIGNAL(clicked()), this, SLOT(fillBoxSymbols()));
725 }
726 
728 {
729  spectrogramPage = new QWidget();
730 
731  imageGroupBox = new QGroupBox(tr( "Image" ));
732  imageGroupBox->setCheckable (true);
733 
734  QVBoxLayout *vl = new QVBoxLayout();
735  grayScaleBox = new QRadioButton(tr("&Gray Scale"));
736  connect(grayScaleBox, SIGNAL(toggled(bool)), this, SLOT(showColorMapEditor(bool)));
737  vl->addWidget(grayScaleBox);
738  defaultScaleBox = new QRadioButton(tr("&Default Color Map"));
739  connect(defaultScaleBox, SIGNAL(toggled(bool)), this, SLOT(showColorMapEditor(bool)));
740  vl->addWidget(defaultScaleBox);
741  customScaleBox = new QRadioButton(tr("&Custom Color Map"));
742  connect(customScaleBox, SIGNAL(toggled(bool)), this, SLOT(showColorMapEditor(bool)));
743  vl->addWidget(customScaleBox);
744 
745  QHBoxLayout *hl = new QHBoxLayout(imageGroupBox);
747  hl->addLayout(vl);
748  hl->addWidget(colorMapEditor);
749 
750  levelsGroupBox = new QGroupBox(tr( "Contour Lines" ));
751  levelsGroupBox->setCheckable(true);
752 
753  QHBoxLayout *hl1 = new QHBoxLayout();
754  hl1->addWidget(new QLabel(tr( "Levels" )));
755 
756  levelsBox = new QSpinBox();
757  levelsBox->setRange(2, 1000);
758  hl1->addWidget(levelsBox);
759  hl1->addStretch();
760 
761  QVBoxLayout *vl1 = new QVBoxLayout();
762  vl1->addLayout(hl1);
763 
764  autoContourBox = new QRadioButton(tr("Use &Color Map"));
765  connect(autoContourBox, SIGNAL(toggled(bool)), this, SLOT(showDefaultContourLinesBox(bool)));
766  vl1->addWidget(autoContourBox);
767 
768  defaultContourBox = new QRadioButton(tr("Use Default &Pen"));
769  connect(defaultContourBox, SIGNAL(toggled(bool)), this, SLOT(showDefaultContourLinesBox(bool)));
770  vl1->addWidget(defaultContourBox);
771 
772  QHBoxLayout *hl2 = new QHBoxLayout(levelsGroupBox);
773  hl2->addLayout(vl1);
774 
775  defaultPenBox = new QGroupBox();
776  QGridLayout *gl1 = new QGridLayout(defaultPenBox);
777  gl1->addWidget(new QLabel(tr( "Color" )), 0, 0);
778 
780  gl1->addWidget(levelsColorBox, 0, 1);
781 
782  gl1->addWidget(new QLabel(tr( "Width" )), 1, 0);
783  contourWidthBox = new QSpinBox();
784  gl1->addWidget(contourWidthBox, 1, 1);
785 
786  gl1->addWidget(new QLabel(tr( "Style" )), 2, 0);
787  boxContourStyle = new QComboBox();
788  boxContourStyle->setEditable(false);
789  boxContourStyle->addItem("_____");
790  boxContourStyle->addItem("_ _ _");
791  boxContourStyle->addItem(".....");
792  boxContourStyle->addItem("_._._");
793  boxContourStyle->addItem("_.._..");
794  gl1->addWidget(boxContourStyle, 2, 1);
795  hl2->addWidget(defaultPenBox);
796 
797  axisScaleBox = new QGroupBox(tr( "Color Bar Scale" ));
798  axisScaleBox->setCheckable (true);
799 
800  QGridLayout *gl2 = new QGridLayout(axisScaleBox);
801  gl2->addWidget(new QLabel(tr( "Axis" )), 0, 0);
802 
803  colorScaleBox = new QComboBox();
804  colorScaleBox->addItem(tr("Left"));
805  colorScaleBox->addItem(tr("Right"));
806  colorScaleBox->addItem(tr("Bottom"));
807  colorScaleBox->addItem(tr("Top"));
808  gl2->addWidget(colorScaleBox, 0, 1);
809 
810  gl2->addWidget(new QLabel(tr( "Width" )), 1, 0);
811  colorScaleWidthBox = new QSpinBox();
812  colorScaleWidthBox->setRange(2, 10000);
813  gl2->addWidget(colorScaleWidthBox, 1, 1);
814 
815  QVBoxLayout* vl2 = new QVBoxLayout(spectrogramPage);
816  vl2->addWidget(imageGroupBox);
817  vl2->addWidget(levelsGroupBox);
818  vl2->addWidget(axisScaleBox);
819  vl2->addStretch();
820 
821  privateTabWidget->addTab(spectrogramPage, tr("Contour") + " / " + tr("Image"));
822 }
823 
825 {
826  boxPercFillColor->setEnabled(boxFillSymbols->isChecked());
827  acceptParams();
828 }
829 
831 {
832  boxFillColor->setEnabled(boxFillSymbol->isChecked());
833  acceptParams();
834 }
835 
837 {
838  QGroupBox *gb1 = new QGroupBox(tr( "Direction" ));
839 
840  QVBoxLayout* vl = new QVBoxLayout(gb1);
841  plusBox = new QCheckBox(tr( "Plus" ));
842  vl->addWidget(plusBox);
843  minusBox = new QCheckBox(tr( "Minus" ));
844  vl->addWidget(minusBox);
845  xBox = new QCheckBox(tr( "&X Error Bar" ));
846  vl->addWidget(xBox);
847  vl->addWidget(xBox);
848  vl->addStretch();
849 
850  QGroupBox *gb2 = new QGroupBox(tr( "Style" ));
851  QGridLayout *gl = new QGridLayout(gb2);
852  gl->addWidget(new QLabel(tr( "Color" )), 0, 0);
853 
854  colorBox = new ColorButton();
855  gl->addWidget(colorBox, 0, 1);
856 
857  gl->addWidget(new QLabel(tr( "Line Width" )), 1, 0);
858  widthBox = new QComboBox();
859  widthBox->addItem( tr( "1" ) );
860  widthBox->addItem( tr( "2" ) );
861  widthBox->addItem( tr( "3" ) );
862  widthBox->addItem( tr( "4" ) );
863  widthBox->addItem( tr( "5" ) );
864  widthBox->setEditable (true);
865  gl->addWidget(widthBox, 1, 1);
866 
867  gl->addWidget(new QLabel(tr( "Cap Width" )), 2, 0);
868  capBox = new QComboBox();
869  capBox->addItem( tr( "8" ) );
870  capBox->addItem( tr( "10" ) );
871  capBox->addItem( tr( "12" ) );
872  capBox->addItem( tr( "16" ) );
873  capBox->addItem( tr( "20" ) );
874  capBox->setEditable (true);
875  gl->addWidget(capBox, 2, 1);
876 
877  throughBox = new QCheckBox(tr( "Through Symbol" ));
878  gl->addWidget(throughBox, 3, 0);
879  gl->setRowStretch (4, 1);
880 
881  errorsPage = new QWidget();
882  QHBoxLayout* hl = new QHBoxLayout(errorsPage);
883  hl->addWidget(gb1);
884  hl->addWidget(gb2);
885  privateTabWidget->addTab( errorsPage, tr( "Error Bars" ) );
886 
887  connect(xBox, SIGNAL(clicked()), this, SLOT(changeErrorBarsType()));
888  connect(plusBox, SIGNAL(clicked()), this, SLOT(changeErrorBarsPlus()));
889  connect(minusBox, SIGNAL(clicked()), this, SLOT(changeErrorBarsMinus()));
890  connect(throughBox, SIGNAL(clicked()), this, SLOT(changeErrorBarsThrough()));
891  connect(colorBox, SIGNAL(changed(QColor)), this, SLOT(pickErrorBarsColor(QColor)));
892 }
893 
895 {
896  QHBoxLayout* hl = new QHBoxLayout();
897  automaticBox = new QCheckBox(tr( "Automatic Binning" ));
898  hl->addWidget(automaticBox);
899  hl->addStretch();
900  buttonStatistics = new QPushButton(tr( "&Show statistics" ));
901  hl->addWidget(buttonStatistics);
902 
903  GroupBoxH = new QGroupBox();
904  QGridLayout *gl = new QGridLayout(GroupBoxH);
905  gl->addWidget(new QLabel(tr( "Bin Size" )), 0, 0);
906  binSizeBox = new QLineEdit();
907  gl->addWidget(binSizeBox, 0, 1);
908  gl->addWidget(new QLabel(tr( "Begin" )), 1, 0);
909  histogramBeginBox = new QLineEdit();
910  gl->addWidget(histogramBeginBox, 1, 1);
911  gl->addWidget(new QLabel(tr( "End" )), 2, 0);
912  histogramEndBox = new QLineEdit();
913  gl->addWidget(histogramEndBox, 2, 1);
914 
915  histogramPage = new QWidget();
916  QVBoxLayout* vl = new QVBoxLayout(histogramPage);
917  vl->addLayout(hl);
918  vl->addWidget(GroupBoxH);
919  vl->addStretch();
920 
921  privateTabWidget->addTab( histogramPage, tr( "Histogram Data" ) );
922 
923  connect(automaticBox, SIGNAL(clicked()), this, SLOT(setAutomaticBinning()));
924  connect(buttonStatistics, SIGNAL(clicked()), this, SLOT(showStatistics() ) );
925 }
926 
928 {
929  spacingPage = new QWidget();
930 
931  QGridLayout *gl = new QGridLayout(spacingPage);
932  gl->addWidget(new QLabel(tr( "Gap Between Bars (in %)" )), 0, 0);
933  gapBox = new QSpinBox();
934  gapBox->setRange(0, 100);
935  gapBox->setSingleStep(10);
936  gl->addWidget(gapBox, 0, 1);
937  gl->addWidget(new QLabel(tr( "Offset (in %)" )), 1, 0);
938  offsetBox = new QSpinBox();
939  offsetBox->setRange(-1000, 1000);
940  offsetBox->setSingleStep(50);
941  gl->addWidget(offsetBox, 1, 1);
942  gl->setRowStretch (2, 1);
943 
944  privateTabWidget->addTab( spacingPage, tr( "Spacing" ));
945 }
946 
948 {
949  QGroupBox *gb1 = new QGroupBox();
950  QGridLayout *gl1 = new QGridLayout(gb1);
951  gl1->addWidget(new QLabel(tr( "Color" )), 0, 0);
952  vectColorBox = new ColorButton();
953  gl1->addWidget(vectColorBox, 0, 1);
954  gl1->addWidget(new QLabel(tr( "Line Width" )), 1, 0);
955  vectWidthBox = new QSpinBox();
956  vectWidthBox->setRange(0, 100);
957  gl1->addWidget(vectWidthBox, 1, 1);
958 
959  QGroupBox *gb2 = new QGroupBox(tr( "Arrowheads" ));
960  QGridLayout *gl2 = new QGridLayout(gb2);
961  gl2->addWidget(new QLabel(tr( "Length" )), 0, 0);
962  headLengthBox = new QSpinBox();
963  headLengthBox->setRange(0, 100);
964  gl2->addWidget(headLengthBox, 0, 1);
965  gl2->addWidget(new QLabel(tr( "Angle" )), 1, 0);
966  headAngleBox = new QSpinBox();
967  headAngleBox->setRange(0, 85);
968  headAngleBox->setSingleStep(5);
969  gl2->addWidget(headAngleBox, 1, 1);
970  filledHeadBox = new QCheckBox(tr( "&Filled" ));
971  gl2->addWidget(filledHeadBox, 2, 0);
972  gl2->setRowStretch(3, 1);
973 
974  GroupBoxVectEnd = new QGroupBox(tr( "End Point" ));
975  QGridLayout *gl3 = new QGridLayout(GroupBoxVectEnd);
976  labelXEnd = new QLabel(tr( "X End" ));
977  gl3->addWidget(labelXEnd, 0, 0);
978  xEndBox = new QComboBox();
979  gl3->addWidget(xEndBox, 0, 1);
980 
981  labelYEnd = new QLabel(tr( "Y End" ));
982  gl3->addWidget(labelYEnd, 1, 0);
983  yEndBox = new QComboBox();
984  gl3->addWidget(yEndBox, 1, 1);
985 
986  labelPosition = new QLabel(tr( "Position" ));
987  gl3->addWidget(labelPosition, 2, 0);
988  vectPosBox = new QComboBox();
989  vectPosBox->addItem(tr("Tail"));
990  vectPosBox->addItem(tr("Middle"));
991  vectPosBox->addItem(tr("Head"));
992  gl3->addWidget(vectPosBox, 2, 1);
993  gl3->setRowStretch(3, 1);
994 
995  vectPage = new QWidget();
996 
997  QVBoxLayout *vl1 = new QVBoxLayout();
998  vl1->addWidget(gb1);
999  vl1->addWidget(gb2);
1000 
1001  QHBoxLayout *hl = new QHBoxLayout(vectPage);
1002  hl->addLayout(vl1);
1003  hl->addWidget(GroupBoxVectEnd);
1004 
1005  privateTabWidget->addTab( vectPage, tr( "Vector" ) );
1006 }
1007 
1009 {
1010  if (!ml)
1011  return;
1012 
1013  d_ml = ml;
1014  boxScaleLayers->setChecked(d_ml->scaleLayersOnPrint());
1015  boxPrintCrops->setChecked(d_ml->printCropmarksEnabled());
1016 
1017  QTreeWidgetItem *item = new QTreeWidgetItem(listBox, QStringList(ml->name()));
1018  item->setIcon(0, QIcon(":/folder_open.xpm"));
1019  listBox->addTopLevelItem(item);
1020  listBox->setCurrentItem(item);
1021 
1022  QWidgetList plots = ml->graphPtrs();
1023  for (int i = 0; i < plots.count(); ++i)
1024  {
1025  Graph* g = (Graph*)plots.at(i);
1026  if (!g)
1027  continue;
1028 
1029  LayerItem *layer = new LayerItem(g, item, tr("Layer") + QString::number(i+1));
1030  item->addChild(layer);
1031 
1032  if (g == ml->activeGraph())
1033  {
1034  layer->setExpanded(true);
1035  layer->setActive(true);
1036  listBox->setCurrentItem(layer);
1037  }
1038  }
1039 }
1040 
1042 {
1043  LayerItem *layerItem = (LayerItem *)listBox->currentItem();
1044  if (!layerItem)
1045  return;
1046  if (layerItem->type() != LayerItem::LayerTreeItem)
1047  return;
1048  QTreeWidgetItem *item = layerItem->child(index);
1049  if (item)
1050  {
1051  ((CurveTreeItem *)item)->setActive(true);
1052  listBox->setCurrentItem(item);
1053  }
1054 }
1055 
1057 {
1058  ApplicationWindow *app = (ApplicationWindow *)this->parent();
1059  if (!app)
1060  return;
1061 
1062  QTreeWidgetItem *it = listBox->currentItem();
1063  if (!it)
1064  return;
1065  if (it->type() != CurveTreeItem::PlotCurveTreeItem)
1066  return;
1067 
1068  QwtPlotItem *plotItem = (QwtPlotItem *)((CurveTreeItem *)it)->plotItem();
1069  if (!plotItem)
1070  return;
1071 
1072  QwtHistogram *h = (QwtHistogram *)plotItem;
1073  if (!h)
1074  return;
1075 
1076  QString tableName = app->generateUniqueName(tr("Bins"));
1077  Table *t = app->newTable(h->dataSize(), 4, tableName, tr("Histogram and Probabilities for") + " " + h->title().text());
1078  if (t)
1079  {
1080  double h_sum = 0.0;
1081  for (int i = 0; i<h->dataSize(); i++ )
1082  h_sum += h->y(i);
1083 
1084  double sum = 0.0;
1085  for (int i = 0; i<h->dataSize(); i++ )
1086  {
1087  sum += h->y(i);
1088  t->column(0)->setValueAt(i, h->x(i));
1089  t->column(1)->setValueAt(i, h->y(i));
1090  t->column(2)->setValueAt(i, sum);
1091  t->column(3)->setValueAt(i, sum/h_sum*100);
1092  }
1093  t->setHeader(QStringList() << tr("Bins") << tr("Quantity") << tr("Sum") << tr("Percent"));
1094  t->showMaximized();
1095  }
1096 
1097  QDateTime dt = QDateTime::currentDateTime();
1098  QString info = dt.toString(Qt::LocalDate)+"\t"+tr("Histogram and Probabilities for") + " " + h->title().text()+"\n";
1099  info += tr("Mean")+" = "+QString::number(h->mean())+"\t";
1100  info += tr("Standard Deviation")+" = "+QString::number(h->standardDeviation())+"\n";
1101  info += tr("Minimum")+" = "+QString::number(h->minimum())+"\t";
1102  info += tr("Maximum")+" = "+QString::number(h->maximum())+"\t";
1103  info += tr("Bins")+" = "+QString::number(h->dataSize())+"\n";
1104  info += "-------------------------------------------------------------\n";
1105  if (!info.isEmpty())
1106  {
1107  app->logInfo += info;
1108  app->showResults(true);
1109  }
1110 
1111  close();
1112 }
1113 
1114 void PlotDialog::contextMenuEvent(QContextMenuEvent *e)
1115 {
1116  QTreeWidgetItem *item = listBox->currentItem();
1117  if (!item)
1118  return;
1119  if (item->type() != CurveTreeItem::PlotCurveTreeItem)
1120  return;
1121  QwtPlotItem *it = (QwtPlotItem *)((CurveTreeItem *)item)->plotItem();
1122  if (!it)
1123  return;
1124 
1125  QPoint pos = listBox->viewport()->mapFromGlobal(QCursor::pos());
1126  QRect rect = listBox->visualItemRect(listBox->currentItem());
1127  if (rect.contains(pos))
1128  {
1129  QMenu contextMenu(this);
1130  contextMenu.addAction(tr("&Delete"), this, SLOT(removeSelectedCurve()));
1131 
1132  if (it->rtti() == QwtPlotItem::Rtti_PlotCurve)
1133  {
1134  if (((PlotCurve *)it)->type() == Graph::Function)
1135  contextMenu.addAction(tr("&Edit..."), this, SLOT(editCurve()));
1136  else
1137  contextMenu.addAction(tr("&Plot Associations..."), this, SLOT(editCurve()));
1138  }
1139  contextMenu.exec(QCursor::pos());
1140  }
1141  e->accept();
1142 }
1143 
1145 {
1146  CurveTreeItem *item = (CurveTreeItem *)listBox->currentItem();
1147  if (!item)
1148  return;
1149  if (item->type() != CurveTreeItem::PlotCurveTreeItem)
1150  return;
1151 
1152  Graph *graph = item->graph();
1153  if (graph)
1154  {
1155  graph->removeCurve(item->plotItemIndex());
1156  graph->updatePlot();
1157 
1158  int index = item->parent()->indexOfChild (item);
1159  QTreeWidgetItem *it = item->parent()->takeChild(index);
1160  if (it)
1161  delete it;
1162  }
1163 }
1164 
1166 {
1167  CurveTreeItem *item = (CurveTreeItem *)listBox->currentItem();
1168  if (!item)
1169  return;
1170  if (item->type() != CurveTreeItem::PlotCurveTreeItem)
1171  return;
1172 
1173  Graph *graph = item->graph();
1174  if (!graph)
1175  return;
1176 
1177  graph->updateErrorBars((QwtErrorPlotCurve *)item->plotItem(), xBox->isChecked(),widthBox->currentText().toInt(),
1178  capBox->currentText().toInt(),colorBox->color(), plusBox->isChecked(),minusBox->isChecked(),
1179  throughBox->isChecked());
1180 }
1181 
1183 {
1184  CurveTreeItem *item = (CurveTreeItem *)listBox->currentItem();
1185  if (!item)
1186  return;
1187  if (item->type() != CurveTreeItem::PlotCurveTreeItem)
1188  return;
1189 
1190  Graph *graph = item->graph();
1191  if (!graph)
1192  return;
1193 
1194  graph->updateErrorBars((QwtErrorPlotCurve *)item->plotItem(), xBox->isChecked(),widthBox->currentText().toInt(),
1195  capBox->currentText().toInt(), colorBox->color(),plusBox->isChecked(),minusBox->isChecked(),
1196  throughBox->isChecked());
1197 }
1198 
1200 {
1201  CurveTreeItem *item = (CurveTreeItem *)listBox->currentItem();
1202  if (!item)
1203  return;
1204  if (item->type() != CurveTreeItem::PlotCurveTreeItem)
1205  return;
1206 
1207  Graph *graph = item->graph();
1208  if (!graph)
1209  return;
1210 
1211  graph->updateErrorBars((QwtErrorPlotCurve *)item->plotItem(), xBox->isChecked(),widthBox->currentText().toInt(),
1212  capBox->currentText().toInt(), colorBox->color(),plusBox->isChecked(),minusBox->isChecked(),
1213  throughBox->isChecked());
1214 }
1215 
1217 {
1218  CurveTreeItem *item = (CurveTreeItem *)listBox->currentItem();
1219  if (!item)
1220  return;
1221  if (item->type() != CurveTreeItem::PlotCurveTreeItem)
1222  return;
1223 
1224  Graph *graph = item->graph();
1225  if (!graph)
1226  return;
1227 
1228  graph->updateErrorBars((QwtErrorPlotCurve *)item->plotItem(), xBox->isChecked(), widthBox->currentText().toInt(),
1229  capBox->currentText().toInt(), colorBox->color(), plusBox->isChecked(), minusBox->isChecked(),
1230  throughBox->isChecked());
1231 }
1232 
1234 {
1235  CurveTreeItem *item = (CurveTreeItem *)listBox->currentItem();
1236  if (!item)
1237  return;
1238  if (item->type() != CurveTreeItem::PlotCurveTreeItem)
1239  return;
1240 
1241  Graph *graph = item->graph();
1242  if (!graph)
1243  return;
1244 
1245  graph->updateErrorBars((QwtErrorPlotCurve *)item->plotItem(), xBox->isChecked(),widthBox->currentText().toInt(),
1246  capBox->currentText().toInt(), color, plusBox->isChecked(), minusBox->isChecked(),
1247  throughBox->isChecked());
1248 }
1249 
1251 {
1252  boxAreaColor->setEnabled(show);
1253  boxPattern->setEnabled(show);
1254 }
1255 
1256 void PlotDialog::updateTabWindow(QTreeWidgetItem *currentItem, QTreeWidgetItem *previousItem)
1257 {
1258  if (!previousItem || !currentItem)
1259  return;
1260 
1261  if (previousItem->type() == CurveTreeItem::PlotCurveTreeItem)
1262  ((CurveTreeItem *)previousItem)->setActive(false);
1263  else if (previousItem->type() == LayerItem::LayerTreeItem)
1264  ((LayerItem *)previousItem)->setActive(false);
1265 
1266  boxPlotType->blockSignals(true);
1267 
1268  if (currentItem->type() == CurveTreeItem::PlotCurveTreeItem)
1269  {
1270  CurveTreeItem *curveItem = (CurveTreeItem *)currentItem;
1271  setActiveCurve(curveItem);
1272 
1273  if (previousItem->type() != CurveTreeItem::PlotCurveTreeItem ||
1274  ((CurveTreeItem *)previousItem)->plotItemType() != curveItem->plotItemType())
1275  {
1276  clearTabWidget();
1277  int plot_type = setPlotType(curveItem);
1278  if (plot_type >= 0)
1279  insertTabs(plot_type);
1280  if (!curvePlotTypeBox->isVisible())
1281  curvePlotTypeBox->show();
1282  }
1283  }
1284  else if (currentItem->type() == LayerItem::LayerTreeItem)
1285  {
1286  if (previousItem->type() != LayerItem::LayerTreeItem)
1287  {
1288  clearTabWidget();
1289  privateTabWidget->addTab (layerPage, tr("Layer"));
1290  privateTabWidget->setCurrentIndex(privateTabWidget->indexOf(layerPage));
1291  }
1292  setActiveLayer((LayerItem *)currentItem);
1293  }
1294  else
1295  {
1296  clearTabWidget();
1297  privateTabWidget->addTab(printPage, tr("Print"));
1298  privateTabWidget->addTab(fontsPage, tr("Fonts"));
1299  privateTabWidget->setCurrentIndex(privateTabWidget->indexOf(printPage));
1300 
1301  curvePlotTypeBox->hide();
1302  btnWorksheet->hide();
1303  btnEditCurve->hide();
1304  }
1305  boxPlotType->blockSignals(false);
1306 }
1307 
1308 void PlotDialog::insertTabs(int plot_type)
1309 {
1310  if (plot_type == Graph::Pie)
1311  {
1312  privateTabWidget->addTab (piePage, tr("Pie"));
1313  privateTabWidget->setCurrentIndex(privateTabWidget->indexOf(piePage));
1314  btnEditCurve->hide();
1315  return;
1316  }
1317 
1318  privateTabWidget->addTab (axesPage, tr("Axes"));
1319  if (plot_type == Graph::Line)
1320  {
1321  boxConnect->setEnabled(true);
1322  privateTabWidget->addTab (linePage, tr("Line"));
1323  privateTabWidget->setCurrentIndex(privateTabWidget->indexOf(linePage));
1324  }
1325  else if (plot_type == Graph::Scatter)
1326  {
1327  boxConnect->setEnabled(true);
1328  privateTabWidget->addTab (symbolPage, tr("Symbol"));
1329  privateTabWidget->setCurrentIndex(privateTabWidget->indexOf(symbolPage));
1330  }
1331  else if (plot_type == Graph::LineSymbols)
1332  {
1333  boxConnect->setEnabled(true);
1334  privateTabWidget->addTab (linePage, tr("Line"));
1335  privateTabWidget->addTab (symbolPage, tr("Symbol"));
1336  privateTabWidget->setCurrentIndex(privateTabWidget->indexOf(symbolPage));
1337  }
1338  else if (plot_type == Graph::VerticalBars ||
1339  plot_type == Graph::HorizontalBars ||
1340  plot_type == Graph::Histogram)
1341  {
1342  boxConnect->setEnabled(false);
1343  privateTabWidget->addTab (linePage, tr("Pattern"));
1344  privateTabWidget->addTab (spacingPage, tr("Spacing"));
1345 
1346  if (plot_type == Graph::Histogram)
1347  {
1348  privateTabWidget->addTab (histogramPage, tr("Histogram Data"));
1349  privateTabWidget->setCurrentIndex(privateTabWidget->indexOf(histogramPage));
1350  }
1351  else
1352  privateTabWidget->setCurrentIndex(privateTabWidget->indexOf(linePage));
1353  }
1354  else if (plot_type == Graph::VectXYXY || plot_type == Graph::VectXYAM)
1355  {
1356  boxConnect->setEnabled(true);
1357  privateTabWidget->addTab (vectPage, tr("Vector"));
1358  customVectorsPage(plot_type == Graph::VectXYAM);
1359  privateTabWidget->setCurrentIndex(privateTabWidget->indexOf(vectPage));
1360  }
1361  else if (plot_type == Graph::ErrorBars)
1362  {
1363  privateTabWidget->addTab (errorsPage, tr("Error Bars"));
1364  privateTabWidget->setCurrentIndex(privateTabWidget->indexOf(errorsPage));
1365  }
1366  else if (plot_type == Graph::Box)
1367  {
1368  boxConnect->setEnabled(false);
1369  privateTabWidget->addTab (linePage, tr("Pattern"));
1370  privateTabWidget->addTab (boxPage, tr("Box/Whiskers"));
1371  privateTabWidget->addTab (percentilePage, tr("Percentile"));
1372  privateTabWidget->setCurrentIndex(privateTabWidget->indexOf(linePage));
1373  }
1374  else if (plot_type == Graph::ColorMap || plot_type == Graph::GrayMap || plot_type == Graph::ContourMap)
1375  {
1376  privateTabWidget->addTab(spectrogramPage, tr("Colors") + " / " + tr("Contour"));
1377  privateTabWidget->setCurrentIndex(privateTabWidget->indexOf(spectrogramPage));
1378  }
1379 }
1380 
1382 {
1383  privateTabWidget->removeTab(privateTabWidget->indexOf(axesPage));
1384  privateTabWidget->removeTab(privateTabWidget->indexOf(linePage));
1385  privateTabWidget->removeTab(privateTabWidget->indexOf(symbolPage));
1386  privateTabWidget->removeTab(privateTabWidget->indexOf(errorsPage));
1387  privateTabWidget->removeTab(privateTabWidget->indexOf(histogramPage));
1388  privateTabWidget->removeTab(privateTabWidget->indexOf(spacingPage));
1389  privateTabWidget->removeTab(privateTabWidget->indexOf(vectPage));
1390  privateTabWidget->removeTab(privateTabWidget->indexOf(boxPage));
1391  privateTabWidget->removeTab(privateTabWidget->indexOf(percentilePage));
1392  privateTabWidget->removeTab(privateTabWidget->indexOf(spectrogramPage));
1393  privateTabWidget->removeTab(privateTabWidget->indexOf(piePage));
1394 
1395  privateTabWidget->removeTab(privateTabWidget->indexOf(layerPage));
1396  privateTabWidget->removeTab(privateTabWidget->indexOf(fontsPage));
1397  privateTabWidget->removeTab(privateTabWidget->indexOf(printPage));
1398 }
1399 
1401 {
1402  if (acceptParams())
1403  close();
1404 }
1405 
1407 {
1408  ApplicationWindow *app = (ApplicationWindow *)this->parent();
1409  if (!app)
1410  return;
1411 
1412  CurveTreeItem *item = (CurveTreeItem *)listBox->currentItem();
1413  if (!item)
1414  return;
1415  if (item->type() != CurveTreeItem::PlotCurveTreeItem)
1416  return;
1417 
1418  app->showCurveWorksheet(item->graph(), item->plotItemIndex());
1419  close();
1420 }
1421 
1423 {
1424  int curveType = item->plotItemType();
1425  if (curveType >= 0)
1426  {
1427  boxPlotType->clear();
1428 
1429  if (curveType == Graph::ErrorBars)
1430  boxPlotType->addItem( tr( "Error Bars" ) );
1431  else if (curveType == Graph::Pie)
1432  boxPlotType->addItem( tr( "Pie" ) );
1433  else if (curveType == Graph::VerticalBars)
1434  boxPlotType->addItem( tr( "Vertical Bars" ) );
1435  else if (curveType == Graph::HorizontalBars)
1436  boxPlotType->addItem( tr( "Horizontal Bars" ) );
1437  else if (curveType == Graph::Histogram)
1438  boxPlotType->addItem( tr( "Histogram" ) );
1439  else if (curveType == Graph::VectXYXY || curveType == Graph::VectXYAM)
1440  {
1441  boxPlotType->addItem( tr( "Vector XYXY" ) );
1442  boxPlotType->addItem( tr( "Vector XYAM" ) );
1443  if (curveType == Graph::VectXYAM)
1444  boxPlotType->setCurrentIndex(1);
1445  }
1446  else if (curveType == Graph::Box)
1447  boxPlotType->addItem( tr( "Box" ) );
1448  else if (curveType == Graph::ColorMap || curveType == Graph::GrayMap || curveType == Graph::ContourMap)
1449  boxPlotType->addItem(tr("Contour") + " / " + tr("Image"));
1450  else
1451  {
1452  boxPlotType->addItem( tr( "Line" ) );
1453  boxPlotType->addItem( tr( "Scatter" ) );
1454  boxPlotType->addItem( tr( "Line + Symbol" ) );
1455 
1456  QwtPlotCurve *c = (QwtPlotCurve*)item->plotItem();
1457  if (!c)
1458  return -1;
1459 
1460  QwtSymbol s = c->symbol();
1461  if (s.style() == QwtSymbol::NoSymbol)
1462  {
1463  boxPlotType->setCurrentIndex(0);
1464  return Graph::Line;
1465  }
1466  else if (c->style() == QwtPlotCurve::NoCurve)
1467  {
1468  boxPlotType->setCurrentIndex(1);
1469  return Graph::Scatter;
1470  }
1471  else
1472  {
1473  boxPlotType->setCurrentIndex(2);
1474  return Graph::LineSymbols;
1475  }
1476  }
1477  }
1478  return curveType;
1479 }
1480 
1482 {
1483  if (!item)
1484  return;
1485  item->setActive(true);
1486 
1487  Graph *g = item->graph();
1488  if (!g)
1489  return;
1490 
1491  curvePlotTypeBox->hide();
1492  btnWorksheet->hide();
1493  btnEditCurve->hide();
1494 
1495  boxBackgroundTransparency->blockSignals(true);
1496  boxCanvasTransparency->blockSignals(true);
1497  boxBorderWidth->blockSignals(true);
1498 
1499  Plot *p = g->plotWidget();
1500  boxMargin->setValue(p->margin());
1501  boxBorderWidth->setValue(p->lineWidth());
1503 
1504  QColor c = p->paletteBackgroundColor();
1505  boxBackgroundTransparency->setValue(c.alpha());
1506  boxBackgroundColor->setEnabled(c.alpha());
1508 
1509  c = p->canvasBackground();
1510  boxCanvasTransparency->setValue(c.alpha());
1511  boxCanvasColor->setEnabled(c.alpha());
1513 
1514  boxAntialiasing->setChecked(g->antialiasing());
1515 
1516  boxBackgroundTransparency->blockSignals(false);
1517  boxCanvasTransparency->blockSignals(false);
1518  boxBorderWidth->blockSignals(false);
1519 }
1520 
1522 {
1523  if (!item)
1524  return;
1525 
1526  const QwtPlotItem *i = item->plotItem();
1527  if (!i)
1528  return;
1529 
1530  item->setActive(true);
1531  btnWorksheet->show();
1532  btnEditCurve->show();
1533 
1534  int curveType = item->plotItemType();
1535  if (curveType == Graph::Pie)
1536  {
1537  QwtPieCurve *pie = (QwtPieCurve*)i;
1538  boxRadius->setValue(pie->ray());
1539  boxPiePattern->setPattern(pie->pattern());
1540  boxPieLineWidth->setValue(pie->pen().width());
1541  boxPieLineColor->setColor(pie->pen().color());
1542  setPiePenStyle(pie->pen().style());
1544  return;
1545  }
1546 
1547  //axes page
1548  boxXAxis->setCurrentIndex(i->xAxis()-2);
1549  boxYAxis->setCurrentIndex(i->yAxis());
1550 
1551  if (i->rtti() == QwtPlotItem::Rtti_PlotSpectrogram)
1552  {
1553  btnEditCurve->hide();
1554  Spectrogram *sp = (Spectrogram *)i;
1555 
1556  imageGroupBox->setChecked(sp->testDisplayMode(QwtPlotSpectrogram::ImageMode));
1557  grayScaleBox->setChecked(sp->colorMapPolicy() == Spectrogram::GrayScale);
1558  defaultScaleBox->setChecked(sp->colorMapPolicy() == Spectrogram::Default);
1559  customScaleBox->setChecked(sp->colorMapPolicy() == Spectrogram::Custom);
1560 
1561  colorMapEditor->setRange(sp->data().range().minValue(), sp->data().range().maxValue());
1562  colorMapEditor->setColorMap((const QwtLinearColorMap &)sp->colorMap());
1563 
1564  levelsGroupBox->setChecked(sp->testDisplayMode(QwtPlotSpectrogram::ContourMode));
1565  levelsBox->setValue(sp->levels());
1566 
1567  autoContourBox->setChecked(sp->defaultContourPen().style() == Qt::NoPen);
1568  defaultContourBox->setChecked(sp->defaultContourPen().style() != Qt::NoPen);
1569 
1570  levelsColorBox->setColor(sp->defaultContourPen().color());
1571  contourWidthBox->setValue(sp->defaultContourPen().width());
1572  if (sp->defaultContourPen().style() != Qt::NoPen)
1573  boxContourStyle->setCurrentIndex(sp->defaultContourPen().style() - 1);
1574  else
1575  boxContourStyle->setCurrentIndex(0);
1576 
1577  axisScaleBox->setChecked(sp->hasColorScale());
1578  colorScaleBox->setCurrentIndex((int)sp->colorScaleAxis());
1579  colorScaleWidthBox->setValue(sp->colorBarWidth());
1580  return;
1581  }
1582 
1583  PlotCurve *c = (PlotCurve*)i;
1584  if (c->type() == Graph::Function)
1585  btnEditCurve->setText(tr("&Edit..."));
1586  else
1587  btnEditCurve->setText(tr("&Plot Associations..."));
1588 
1589  //line page
1590  int style = c->style();
1591  if (curveType == Graph::Spline)
1592  style = 5;
1593  else if (curveType == Graph::VerticalSteps)
1594  style = 6;
1595  boxConnect->setCurrentIndex(style);
1596 
1597  penWidget->setPen(c->pen());
1598  fillGroupBox->blockSignals(true);
1599  fillGroupBox->setChecked(c->brush().style() != Qt::NoBrush );
1600  fillGroupBox->blockSignals(false);
1601  boxAreaColor->setColor(c->brush().color());
1602  boxPattern->setPattern(c->brush().style());
1603 
1604  //symbol page
1605  const QwtSymbol s = c->symbol();
1606  boxSymbolSize->setValue(s.size().width()/2);
1607  boxSymbolStyle->setStyle(s.style());
1608  boxSymbolColor->setColor(s.pen().color());
1609  boxPenWidth->setValue(s.pen().width());
1610  boxFillSymbol->setChecked(s.brush() != Qt::NoBrush);
1611  boxFillColor->setEnabled(s.brush() != Qt::NoBrush);
1612  boxFillColor->setColor(s.brush().color());
1613 
1614  if (curveType == Graph::VerticalBars || curveType == Graph::HorizontalBars ||
1615  curveType == Graph::Histogram)
1616  {//spacing page
1617  QwtBarCurve *b = (QwtBarCurve*)i;
1618  if (b)
1619  {
1620  gapBox->setValue(b->gap());
1621  offsetBox->setValue(b->offset());
1622  }
1623  }
1624 
1625  if (curveType == Graph::Histogram)
1626  {//Histogram page
1627  QwtHistogram *h = (QwtHistogram*)i;
1628  if (h)
1629  {
1630  automaticBox->setChecked(h->autoBinning());
1631  binSizeBox->setText(QString::number(h->binSize()));
1632  histogramBeginBox->setText(QString::number(h->begin()));
1633  histogramEndBox->setText(QString::number(h->end()));
1635  }
1636  }
1637 
1638  if (curveType == Graph::VectXYXY || curveType == Graph::VectXYAM)
1639  {//Vector page
1640  VectorCurve *v = (VectorCurve*)i;
1641  if (v)
1642  {
1643  vectColorBox->setColor(v->color());
1644  vectWidthBox->setValue(v->width());
1645  headLengthBox->setValue(v->headLength());
1646  headAngleBox->setValue(v->headAngle());
1647  filledHeadBox->setChecked(v->filledArrowHead());
1648  vectPosBox->setCurrentIndex(v->position());
1649  updateEndPointColumns(item->text(0));
1650  }
1651  }
1652 
1653  if (curveType == Graph::ErrorBars)
1654  {
1656  if (err)
1657  {
1658  xBox->setChecked(err->xErrors());
1659  widthBox->setEditText(QString::number(err->width()));
1660  capBox->setEditText(QString::number(err->capLength()));
1661  throughBox->setChecked(err->throughSymbol());
1662  plusBox->setChecked(err->plusSide());
1663  minusBox->setChecked(err->minusSide());
1664  colorBox->setColor(err->color());
1665  }
1666  }
1667 
1668  if (curveType == Graph::Box)
1669  {
1670  BoxCurve *b = (BoxCurve*)i;
1671  if (b)
1672  {
1673  boxMaxStyle->setStyle(b->maxStyle());
1674  boxMinStyle->setStyle(b->minStyle());
1676  box99Style->setStyle(b->p99Style());
1677  box1Style->setStyle(b->p1Style());
1678 
1679  boxPercSize->setValue(s.size().width()/2);
1680  boxFillSymbols->setChecked(s.brush() != Qt::NoBrush);
1681  boxPercFillColor->setEnabled(s.brush() != Qt::NoBrush);
1682  boxPercFillColor->setColor(s.brush().color());
1683  boxEdgeColor->setColor(s.pen().color());
1684  boxEdgeWidth->setValue(s.pen().width());
1685 
1686  boxRange->setCurrentIndex (b->boxRangeType()-1);
1687  boxType->setCurrentIndex (b->boxStyle());
1688  boxWidth->setValue(b->boxWidth());
1689  setBoxRangeType(boxRange->currentIndex());
1690  setBoxType(boxType->currentIndex());
1691  if (b->boxRangeType() == BoxCurve::SD || b->boxRangeType() == BoxCurve::SE)
1692  boxCnt->setValue(b->boxRange());
1693  else
1694  boxCoef->setValue((int)b->boxRange());
1695 
1696  boxWhiskersRange->setCurrentIndex (b->whiskersRangeType());
1697  setWhiskersRange(boxWhiskersRange->currentIndex());
1699  whiskerCnt->setValue(b->whiskersRange());
1700  else
1701  boxWhiskersCoef->setValue((int)b->whiskersRange());
1702  }
1703  }
1704 }
1705 
1706 void PlotDialog::updateEndPointColumns(const QString& text)
1707 {
1708  QStringList cols=text.split(",", QString::SkipEmptyParts);
1709  QStringList aux=cols[0].split(":", QString::SkipEmptyParts);
1710  QString table=aux[0];
1711  QStringList list;
1712  for (int i=0; i<(int)columnNames.count(); i++)
1713  {
1714  QString s=columnNames[i];
1715  if (s.contains(table))
1716  list<<s;
1717  }
1718 
1719  xEndBox->clear();
1720  xEndBox->addItems(list);
1721  xEndBox->setItemText(xEndBox->currentIndex(), table + "_" + cols[2].remove("(X)").remove("(A)"));
1722 
1723  yEndBox->clear();
1724  yEndBox->addItems(list);
1725  yEndBox->setItemText(yEndBox->currentIndex(), table + "_" + cols[3].remove("(Y)").remove("(M)"));
1726 }
1727 
1729 {
1730  if (privateTabWidget->currentWidget() == fontsPage)
1731  {
1733  return true;
1734  }
1735  else if (privateTabWidget->currentWidget() == printPage)
1736  {
1737  d_ml->setScaleLayersOnPrint(boxScaleLayers->isChecked());
1738  d_ml->printCropmarks(boxPrintCrops->isChecked());
1739  return true;
1740  }
1741  else if (privateTabWidget->currentWidget() == layerPage)
1742  {
1743  if (!boxAll->isChecked())
1744  return true;
1745 
1746  QWidgetList allPlots = d_ml->graphPtrs();
1747  for (int i=0; i<allPlots.count();i++)
1748  {
1749  Graph* g = (Graph*)allPlots.at(i);
1750  if (g)
1751  {
1752  g->setFrame(boxBorderWidth->value(), boxBorderColor->color());
1753  g->setMargin(boxMargin->value());
1754 
1755  QColor c = boxBackgroundColor->color();
1756  c.setAlpha(boxBackgroundTransparency->value());
1757  g->setBackgroundColor(c);
1758 
1759  c = boxCanvasColor->color();
1760  c.setAlpha(boxCanvasTransparency->value());
1761  g->setCanvasBackground(c);
1762 
1763  g->setAntialiasing(boxAntialiasing->isChecked());
1764  }
1765  }
1766  return true;
1767  }
1768 
1769  QTreeWidgetItem *it = listBox->currentItem();
1770  if (!it)
1771  return false;
1772 
1773  CurveTreeItem *item = (CurveTreeItem *)it;
1774  QwtPlotItem *plotItem = (QwtPlotItem *)item->plotItem();
1775  if (!plotItem)
1776  return false;
1777 
1778  Graph *graph = item->graph();
1779  if (!graph)
1780  return false;
1781 
1782  if (privateTabWidget->currentWidget() == axesPage)
1783  {
1784  plotItem->setAxis(boxXAxis->currentIndex() + 2, boxYAxis->currentIndex());
1785  graph->setAutoScale();
1786  return true;
1787  }
1788  else if (privateTabWidget->currentWidget() == spectrogramPage)
1789  {
1790  Spectrogram *sp = (Spectrogram *)plotItem;
1791  if (!sp || sp->rtti() != QwtPlotItem::Rtti_PlotSpectrogram)
1792  return false;
1793 
1794  sp->setLevelsNumber(levelsBox->value());
1795  if (autoContourBox->isChecked())
1796  sp->setDefaultContourPen(Qt::NoPen);
1797  else
1798  sp->setDefaultContourPen(QPen(levelsColorBox->color(), contourWidthBox->value(),
1799  Graph::getPenStyle(boxContourStyle->currentIndex())));
1800 
1801  sp->setDisplayMode(QwtPlotSpectrogram::ContourMode, levelsGroupBox->isChecked());
1802  sp->setDisplayMode(QwtPlotSpectrogram::ImageMode, imageGroupBox->isChecked());
1803 
1804  if (grayScaleBox->isChecked())
1805  {
1806  sp->setGrayScale();
1807  colorMapEditor->setColorMap(QwtLinearColorMap(Qt::black, Qt::white));
1808  }
1809  else if (defaultScaleBox->isChecked())
1810  {
1811  sp->setDefaultColorMap();
1813  }
1814  else
1816 
1817  sp->showColorScale((QwtPlot::Axis)colorScaleBox->currentIndex(), axisScaleBox->isChecked());
1818  sp->setColorBarWidth(colorScaleWidthBox->value());
1819 
1820  //Update axes page
1821  boxXAxis->setCurrentIndex(sp->xAxis()-2);
1822  boxYAxis->setCurrentIndex(sp->yAxis());
1823  }
1824  else if (privateTabWidget->currentWidget()==linePage)
1825  {
1826  if (boxConnect->currentIndex() == 0) // no line => we really have a scatter plotter
1827  boxPlotType->setCurrentIndex(1);
1828  else {
1829  int index = item->plotItemIndex();
1830  graph->setCurveStyle(index, boxConnect->currentIndex());
1831  QBrush br = QBrush(boxAreaColor->color(), boxPattern->getSelectedPattern());
1832  if (!fillGroupBox->isChecked())
1833  br = QBrush();
1834  graph->setCurveBrush(index, br);
1835  QwtPlotCurve *curve = (QwtPlotCurve *)plotItem;
1836  curve->setPen(penWidget->pen());
1837  }
1838  }
1839  else if (privateTabWidget->currentWidget()==symbolPage)
1840  {
1841  if (boxSymbolStyle->selectedSymbol() == QwtSymbol::NoSymbol) // no symbol => line plot
1842  boxPlotType->setCurrentIndex(0);
1843  else {
1844  int size = 2*boxSymbolSize->value()+1;
1845  QBrush br = QBrush(boxFillColor->color(), Qt::SolidPattern);
1846  if (!boxFillSymbol->isChecked())
1847  br = QBrush();
1848  QPen pen = QPen(boxSymbolColor->color(),boxPenWidth->value(),Qt::SolidLine);
1849  QwtSymbol s = QwtSymbol(boxSymbolStyle->selectedSymbol(), br, pen, QSize(size, size));
1850  QwtPlotCurve *curve = (QwtPlotCurve *)plotItem;
1851  curve->setSymbol(s);
1852  }
1853  }
1854  else if (privateTabWidget->currentWidget()==histogramPage)
1855  {
1856  QwtHistogram *h = (QwtHistogram *)plotItem;
1857  if (!h)
1858  return false;
1859 
1860  QString text = item->text(0);
1861  QStringList t = text.split(": ", QString::SkipEmptyParts);
1862  QStringList list = t[1].split(",", QString::SkipEmptyParts);
1863  text = t[0] + "_" + list[1].remove("(Y)");
1864  bool accept = validInput();
1865  if (accept)
1866  {
1867  if (h->autoBinning() == automaticBox->isChecked() &&
1868  h->binSize() == binSizeBox->text().toDouble() &&
1869  h->begin() == histogramBeginBox->text().toDouble() &&
1870  h->end() == histogramEndBox->text().toDouble()) return true;
1871 
1872  h->setBinning(automaticBox->isChecked(), binSizeBox->text().toDouble(),
1873  histogramBeginBox->text().toDouble(), histogramEndBox->text().toDouble());
1874  h->loadData();
1875  graph->updateScale();
1876  graph->notifyChanges();
1877  }
1878  return accept;
1879  }
1880  else if (privateTabWidget->currentWidget()==spacingPage)
1881  graph->setBarsGap(item->plotItemIndex(), gapBox->value(), offsetBox->value());
1882  else if (privateTabWidget->currentWidget() == vectPage)
1883  {
1884  int index = item->plotItemIndex();
1885  ApplicationWindow *app = (ApplicationWindow *)this->parent();
1886  if (!app)
1887  return false;
1888 
1889  QString xEndCol = xEndBox->currentText();
1890  QString yEndCol = yEndBox->currentText();
1891  Table* w = app->table(xEndCol);
1892  if (!w)
1893  return false;
1894 
1895  graph->updateVectorsLayout(index, vectColorBox->color(), vectWidthBox->value(),
1896  headLengthBox->value(), headAngleBox->value(),
1897  filledHeadBox->isChecked(), vectPosBox->currentIndex(), xEndCol, yEndCol);
1898 
1899  QString text = item->text(0);
1900  QStringList t = text.split(": ", QString::SkipEmptyParts);
1901  QString table = t[0];
1902 
1903  QStringList cols = t[1].split(",", QString::SkipEmptyParts);
1904  if (graph->curveType(index) == Graph::VectXYXY)
1905  {
1906  xEndCol = xEndCol.remove(table + "_") + "(X)";
1907  yEndCol = yEndCol.remove(table + "_") + "(Y)";
1908  }
1909  else
1910  {
1911  xEndCol = xEndCol.remove(table + "_") + "(A)";
1912  yEndCol = yEndCol.remove(table + "_") + "(M)";
1913  }
1914 
1915  if (cols[2] != xEndCol || cols[3] != yEndCol)
1916  {
1917  cols[2] = xEndCol;
1918  cols[3] = yEndCol;
1919  item->setText(0, table + ": " + cols.join(","));
1920  }
1921  return true;
1922  }
1923  else if (privateTabWidget->currentWidget() == errorsPage)
1924  {
1925  graph->updateErrorBars((QwtErrorPlotCurve *)item->plotItem(), xBox->isChecked(), widthBox->currentText().toInt(),
1926  capBox->currentText().toInt(), colorBox->color(), plusBox->isChecked(), minusBox->isChecked(),
1927  throughBox->isChecked());
1928  return true;
1929  }
1930  else if (privateTabWidget->currentWidget() == piePage)
1931  {
1932  QwtPieCurve *pie = (QwtPieCurve*)plotItem;
1933  pie->setPen(QPen(boxPieLineColor->color(), boxPieLineWidth->value(),
1934  Graph::getPenStyle(boxPieLineStyle->currentIndex())));
1935  pie->setRay(boxRadius->value());
1938  }
1939  else if (privateTabWidget->currentWidget() == percentilePage)
1940  {
1941  BoxCurve *b = (BoxCurve*)plotItem;
1942  if (b)
1943  {
1949 
1950  int size = 2*boxPercSize->value() + 1;
1951  QBrush br = QBrush(boxPercFillColor->color(), Qt::SolidPattern);
1952  if (!boxFillSymbols->isChecked())
1953  br = QBrush();
1954  QwtSymbol s = QwtSymbol(QwtSymbol::NoSymbol, br, QPen(boxEdgeColor->color(),
1955  boxEdgeWidth->value(),Qt::SolidLine), QSize(size, size));
1956  b->setSymbol(s);
1957  }
1958  }
1959  else if (privateTabWidget->currentWidget() == boxPage)
1960  {
1961  BoxCurve *b = (BoxCurve*)plotItem;
1962  if (b)
1963  {
1964  b->setBoxWidth(boxWidth->value());
1965  b->setBoxStyle(boxType->currentIndex());
1966  if (boxCnt->isVisible())
1967  b->setBoxRange(boxRange->currentIndex()+1, boxCnt->value());
1968  else
1969  b->setBoxRange(boxRange->currentIndex()+1, (double)boxCoef->value());
1970 
1971  if (whiskerCnt->isVisible())
1972  b->setWhiskersRange(boxWhiskersRange->currentIndex(), whiskerCnt->value());
1973  else
1974  b->setWhiskersRange(boxWhiskersRange->currentIndex(), (double)boxWhiskersCoef->value());
1975  }
1976  }
1977  graph->replot();
1978  graph->notifyChanges();
1979  return true;
1980 }
1981 
1983 {
1984  GroupBoxH->setEnabled(!automaticBox->isChecked());
1985 }
1986 
1988 {
1989  QString from = histogramBeginBox->text();
1990  QString to = histogramEndBox->text();
1991  QString step = binSizeBox->text();
1992  QRegExp nonDigit("\\D");
1993 
1994  if (histogramBeginBox->text().isEmpty())
1995  {
1996  QMessageBox::critical(this, tr("Input error"), tr("Please enter a valid start limit!"));
1997  histogramBeginBox->setFocus();
1998  return false;
1999  }
2000 
2001  if (histogramEndBox->text().isEmpty())
2002  {
2003  QMessageBox::critical(this, tr("Input error"), tr("Please enter a valid end limit!"));
2004  histogramEndBox->setFocus();
2005  return false;
2006  }
2007 
2008  if (binSizeBox->text().isEmpty())
2009  {
2010  QMessageBox::critical(this, tr("Input error"), tr("Please enter a valid bin size value!"));
2011  binSizeBox->setFocus();
2012  return false;
2013  }
2014 
2015  from = from.remove(".");
2016  to = to.remove(".");
2017  step = step.remove(".");
2018 
2019  int pos=from.indexOf("-",0);
2020  if(pos==0)
2021  from=from.replace(pos,1,"");
2022 
2023  pos=to.indexOf("-",0);
2024  if(pos==0)
2025  to=to.replace(pos,1,"");
2026 
2027  double start,end, stp;
2028  // bool error = false;
2029  if (from.contains(nonDigit))
2030  {
2031  try
2032  {
2033  MyParser parser;
2034  parser.SetExpr(histogramBeginBox->text());
2035  start=parser.Eval();
2036  }
2037  catch(mu::ParserError &e)
2038  {
2039  QMessageBox::critical(this, tr("Start limit error"), QStringFromString(e.GetMsg()));
2040  histogramBeginBox->setFocus();
2041  // error = true;
2042  return false;
2043  }
2044  }
2045  else
2046  start = histogramBeginBox->text().toDouble();
2047 
2048  if (to.contains(nonDigit))
2049  {
2050  try
2051  {
2052  MyParser parser;
2053  parser.SetExpr(histogramEndBox->text());
2054  end=parser.Eval();
2055  }
2056  catch(mu::ParserError &e)
2057  {
2058  QMessageBox::critical(this, tr("End limit error"), QStringFromString(e.GetMsg()));
2059  histogramEndBox->setFocus();
2060  // error=true;
2061  return false;
2062  }
2063  }
2064  else
2065  end=histogramEndBox->text().toDouble();
2066 
2067  if (start>=end)
2068  {
2069  QMessageBox::critical(this, tr("Input error"), tr("Please enter limits that satisfy: begin < end!"));
2070  histogramEndBox->setFocus();
2071  return false;
2072  }
2073 
2074  if (step.contains(nonDigit))
2075  {
2076  try
2077  {
2078  MyParser parser;
2079  parser.SetExpr(binSizeBox->text());
2080  stp=parser.Eval();
2081  }
2082  catch(mu::ParserError &e)
2083  {
2084  QMessageBox::critical(this, tr("Bin size input error"),QStringFromString(e.GetMsg()));
2085  binSizeBox->setFocus();
2086  // error=true;
2087  return false;
2088  }
2089  }
2090  else
2091  stp=binSizeBox->text().toDouble();
2092 
2093  if (stp <=0)
2094  {
2095  QMessageBox::critical(this, tr("Bin size input error"), tr("Please enter a positive bin size value!"));
2096  binSizeBox->setFocus();
2097  return false;
2098  }
2099 
2100  return true;
2101 }
2102 void PlotDialog::setPiePenStyle(const Qt::PenStyle& style)
2103 {
2104  if(style == Qt::SolidLine)
2105  boxPieLineStyle->setCurrentIndex(0);
2106  if(style == Qt::DashLine)
2107  boxPieLineStyle->setCurrentIndex(1);
2108  if(style == Qt::DotLine)
2109  boxPieLineStyle->setCurrentIndex(2);
2110  if(style == Qt::DashDotLine)
2111  boxPieLineStyle->setCurrentIndex(3);
2112  if(style == Qt::DashDotDotLine)
2113  boxPieLineStyle->setCurrentIndex(4);
2114 }
2115 
2116 void PlotDialog::setBoxType(int index)
2117 {
2118  boxCoeffLabel->hide();
2119  boxRangeLabel->hide();
2120  boxRange->hide();
2121  boxCoef->hide();
2122  boxCntLabel->hide();
2123  boxCnt->hide();
2124 
2125  if (index != BoxCurve::NoBox && index != BoxCurve::WindBox)
2126  {
2127  boxRange->show();
2128  boxRangeLabel->show();
2129  int id = boxRange->currentIndex() + 1;
2130  if (id == BoxCurve::UserDef)
2131  {
2132  boxCoef->show();
2133  boxCoeffLabel->show();
2134  }
2135  else if (id == BoxCurve::SD || id == BoxCurve::SE)
2136  {
2137  boxCntLabel->show();
2138  boxCnt->show();
2139  }
2140  }
2141 }
2142 
2144 {
2145  boxCoeffLabel->hide();
2146  boxCoef->hide();
2147  boxCntLabel->hide();
2148  boxCnt->hide();
2149 
2150  index++;
2151  if (index == BoxCurve::UserDef)
2152  {
2153  boxCoeffLabel->show();
2154  boxCoef->show();
2155  }
2156  else if (index == BoxCurve::SD || index == BoxCurve::SE)
2157  {
2158  boxCntLabel->show();
2159  boxCnt->show();
2160  }
2161 }
2162 
2164 {
2165  whiskerCoeffLabel->hide();
2166  boxWhiskersCoef->hide();
2167  whiskerCntLabel->hide();
2168  whiskerCnt->hide();
2169 
2170  if (index == BoxCurve::UserDef)
2171  {
2172  whiskerCoeffLabel->show();
2173  boxWhiskersCoef->show();
2174  }
2175  else if (index == BoxCurve::SD || index == BoxCurve::SE)
2176  {
2177  whiskerCntLabel->show();
2178  whiskerCnt->show();
2179  }
2180 }
2181 
2183 {
2184  if (angleMag)
2185  {
2186  GroupBoxVectEnd->setTitle(tr("Vector Data"));
2187  labelXEnd->setText(tr("Angle"));
2188  labelYEnd->setText(tr("Magnitude"));
2189  labelPosition->show();
2190  vectPosBox->show();
2191  }
2192  else
2193  {
2194  GroupBoxVectEnd->setTitle(tr("End Point"));
2195  labelXEnd->setText(tr("X End"));
2196  labelYEnd->setText(tr("Y End"));
2197  labelPosition->hide();
2198  vectPosBox->hide();
2199  }
2200 }
2201 
2203 {
2204  if (grayScaleBox->isChecked() || defaultScaleBox->isChecked())
2205  colorMapEditor->hide();
2206  else
2207  {
2208  colorMapEditor->show();
2209  colorMapEditor->setFocus();
2210  }
2211 }
2212 
2214 {
2215  if (autoContourBox->isChecked())
2216  defaultPenBox->hide();
2217  else
2218  defaultPenBox->show();
2219 }
2220 
2221 void PlotDialog::updateTreeWidgetItem(QTreeWidgetItem *item)
2222 {
2223  if (item->type() != QTreeWidgetItem::Type)
2224  return;
2225 
2226  if (item->isExpanded())
2227  item->setIcon(0, QIcon(":/folder_open.xpm"));
2228  else
2229  item->setIcon(0, QIcon(":/folder_closed.xpm"));
2230 }
2231 
2233 {
2234  boxBackgroundColor->setEnabled(alpha);
2235  if (alpha != boxBackgroundColor->color().alpha())
2236  {
2237  QColor c = boxBackgroundColor->color();
2238  c.setAlpha(alpha);
2240  }
2241 
2242  if (boxAll->isChecked())
2243  {
2244  QWidgetList allPlots = d_ml->graphPtrs();
2245  for (int i=0; i<allPlots.count();i++)
2246  {
2247  Graph* g = (Graph*)allPlots.at(i);
2248  if (g)
2249  {
2250  QColor c = boxBackgroundColor->color();
2251  c.setAlpha(boxBackgroundTransparency->value());
2252  g->setBackgroundColor(c);
2253  }
2254  }
2255  }
2256  else
2257  {
2258  LayerItem *item = (LayerItem *)listBox->currentItem();
2259  if (!item)
2260  return;
2261  Graph *g = item->graph();
2262  if (g)
2263  {
2264  QColor c = boxBackgroundColor->color();
2265  c.setAlpha(boxBackgroundTransparency->value());
2266  g->setBackgroundColor(c);
2267  }
2268  }
2269 }
2270 
2272 {
2273  boxCanvasColor->setEnabled(alpha);
2274  if (alpha != boxCanvasColor->color().alpha())
2275  {
2276  QColor c = boxCanvasColor->color();
2277  c.setAlpha(alpha);
2279  }
2280 
2281  if (boxAll->isChecked())
2282  {
2283  QWidgetList allPlots = d_ml->graphPtrs();
2284  for (int i=0; i<allPlots.count();i++)
2285  {
2286  Graph* g = (Graph*)allPlots.at(i);
2287  if (g)
2288  {
2289  QColor c = boxCanvasColor->color();
2290  c.setAlpha(boxCanvasTransparency->value());
2291  g->setCanvasBackground(c);
2292  }
2293  }
2294  }
2295  else
2296  {
2297  LayerItem *item = (LayerItem *)listBox->currentItem();
2298  if (!item)
2299  return;
2300  Graph *g = item->graph();
2301  if (g)
2302  {
2303  QColor c = boxCanvasColor->color();
2304  c.setAlpha(boxCanvasTransparency->value());
2305  g->setCanvasBackground(c);
2306  }
2307  }
2308 }
2309 
2311 {
2312  if (c.alpha() != boxCanvasTransparency->value())
2313  {
2314  boxCanvasTransparency->setValue(c.alpha());
2315  }
2316  if (boxAll->isChecked())
2317  {
2318  QWidgetList allPlots = d_ml->graphPtrs();
2319  for (int i=0; i<allPlots.count();i++)
2320  {
2321  Graph* g=(Graph*)allPlots.at(i);
2322  if (g)
2323  {
2324  c.setAlpha(boxCanvasTransparency->value());
2325  g->setCanvasBackground(c);
2326  g->replot();
2327  }
2328  }
2329  }
2330  else
2331  {
2332  LayerItem *item = (LayerItem *)listBox->currentItem();
2333  if (!item)
2334  return;
2335  Graph *g = item->graph();
2336  if (g)
2337  {
2338  c.setAlpha(boxCanvasTransparency->value());
2339  g->setCanvasBackground(c);
2340  g->replot();
2341  }
2342  }
2343 }
2344 
2346 {
2347  if (c.alpha() != boxBackgroundTransparency->value())
2348  {
2349  boxBackgroundTransparency->setValue(c.alpha());
2350  }
2351  if (boxAll->isChecked())
2352  {
2353  QWidgetList allPlots = d_ml->graphPtrs();
2354  for (int i=0; i<(int)allPlots.count();i++)
2355  {
2356  Graph* g=(Graph*)allPlots.at(i);
2357  if (g)
2358  {
2359  c.setAlpha(boxBackgroundTransparency->value());
2360  g->setBackgroundColor(c);
2361  g->replot();
2362  }
2363  }
2364  }
2365  else
2366  {
2367  LayerItem *item = (LayerItem *)listBox->currentItem();
2368  if (!item)
2369  return;
2370  Graph *g = item->graph();
2371  if (g)
2372  {
2373  c.setAlpha(boxBackgroundTransparency->value());
2374  g->setBackgroundColor(c);
2375  g->replot();
2376  }
2377  }
2378 }
2379 
2381 {
2382  if (boxAll->isChecked())
2383  {
2384  QWidgetList allPlots = d_ml->graphPtrs();
2385  for (int i=0; i<allPlots.count();i++)
2386  {
2387  Graph* g=(Graph*)allPlots.at(i);
2388  if (g)
2389  g->setFrame(boxBorderWidth->value(), c);
2390  }
2391  }
2392  else
2393  {
2394  LayerItem *item = (LayerItem *)listBox->currentItem();
2395  if (!item)
2396  return;
2397  Graph *g = item->graph();
2398  if (g)
2399  g->setFrame(boxBorderWidth->value(), c);
2400  }
2401  d_ml->notifyChanges();
2402 }
2403 
2405 {
2406  if (privateTabWidget->currentWidget() != layerPage)
2407  return;
2408 
2409  if (boxAll->isChecked())
2410  {
2411  QWidgetList allPlots = d_ml->graphPtrs();
2412  for (int i=0; i<allPlots.count();i++)
2413  {
2414  Graph* g = (Graph*)allPlots.at(i);
2415  if (g)
2416  g->setAntialiasing(on);
2417  }
2418  }
2419  else
2420  {
2421  LayerItem *item = (LayerItem *)listBox->currentItem();
2422  if (!item)
2423  return;
2424  Graph *g = item->graph();
2425  if (g)
2426  g->setAntialiasing(on);
2427  }
2428 }
2429 
2431 {
2432  if (privateTabWidget->currentWidget() != layerPage)
2433  return;
2434 
2435  if (boxAll->isChecked())
2436  {
2437  QWidgetList allPlots = d_ml->graphPtrs();
2438  for (int i=0; i<allPlots.count();i++)
2439  {
2440  Graph* g=(Graph*)allPlots.at(i);
2441  if (g)
2442  g->setFrame(width, boxBorderColor->color());
2443  }
2444  }
2445  else
2446  {
2447  LayerItem *item = (LayerItem *)listBox->currentItem();
2448  if (!item)
2449  return;
2450  Graph *g = item->graph();
2451  if (g)
2452  g->setFrame(width, boxBorderColor->color());
2453  }
2454  d_ml->notifyChanges();
2455 }
2456 
2458 {
2459  if (privateTabWidget->currentWidget() != layerPage)
2460  return;
2461 
2462  if (boxAll->isChecked())
2463  {
2464  QWidgetList allPlots = d_ml->graphPtrs();
2465  for (int i=0; i<allPlots.count();i++)
2466  {
2467  Graph* g=(Graph*)allPlots.at(i);
2468  if (g)
2469  g->setMargin(width);
2470  }
2471  }
2472  else
2473  {
2474  LayerItem *item = (LayerItem *)listBox->currentItem();
2475  if (!item)
2476  return;
2477  Graph *g = item->graph();
2478  if (g)
2479  g->setMargin(width);
2480  }
2481 }
2482 
2484 {
2485  bool ok;
2486  QFont font = QFontDialog::getFont(&ok,titleFont,this);
2487  if ( ok ) {
2488  titleFont = font;
2489  } else {
2490  return;
2491  }
2492 }
2493 
2495 {
2496  bool ok;
2497  QFont font = QFontDialog::getFont(&ok,axesFont,this);
2498  if ( ok ) {
2499  axesFont = font;
2500  } else {
2501  return;
2502  }
2503 }
2504 
2506 {
2507  bool ok;
2508  QFont font = QFontDialog::getFont(&ok,numbersFont,this);
2509  if ( ok ) {
2510  numbersFont = font;
2511  } else {
2512  return;
2513  }
2514 }
2515 
2517 {
2518  bool ok;
2519  QFont font = QFontDialog::getFont(&ok, legendFont,this);
2520  if ( ok ) {
2521  legendFont = font;
2522  } else {
2523  return;
2524  }
2525 }
2526 
2527 void PlotDialog::initFonts(const QFont& titlefont, const QFont& axesfont, const QFont& numbersfont, const QFont& legendfont)
2528 {
2529  axesFont = axesfont;
2530  titleFont = titlefont;
2531  numbersFont = numbersfont;
2532  legendFont = legendfont;
2533 }
2534 
2535 void PlotDialog::closeEvent(QCloseEvent* e)
2536 {
2537  ApplicationWindow *app = (ApplicationWindow *)this->parent();
2538  if (app)
2539  app->d_extended_plot_dialog = btnMore->isChecked ();
2540 
2541  e->accept();
2542 }
2543 
2544 
2550 LayerItem::LayerItem(Graph *g, QTreeWidgetItem *parent, const QString& s)
2551  : QTreeWidgetItem( parent, QStringList(s), LayerTreeItem ),
2552  d_graph(g)
2553 {
2554  setIcon(0, QPixmap(":/layer_disabled.xpm"));
2555  if (g)
2556  insertCurvesList();
2557 }
2558 
2560 {
2561  if (on)
2562  setIcon(0, QPixmap(":/layer_enabled.xpm"));
2563  else
2564  setIcon(0, QPixmap(":/layer_disabled.xpm"));
2565 }
2566 
2568 {
2569  for (int i=0; i<d_graph->curves(); i++)
2570  {
2571  QString plotAssociation = QString();
2572  const QwtPlotItem *it = (QwtPlotItem *)d_graph->plotItem(i);
2573  if (!it)
2574  continue;
2575 
2576  if (it->rtti() == QwtPlotItem::Rtti_PlotCurve)
2577  {
2578  PlotCurve *c = (PlotCurve *)it;
2579  if (c->type() != Graph::Function)
2580  {
2581  QString s = ((DataCurve *)it)->plotAssociation();
2582  QString table = ((DataCurve *)it)->table()->name();
2583  plotAssociation = table + ": " + s.remove(table + "_");
2584  }
2585  else
2586  plotAssociation = it->title().text();
2587  }
2588  else
2589  plotAssociation = it->title().text();
2590 
2591  addChild(new CurveTreeItem(it, this, plotAssociation));
2592  }
2593 }
2594 
2595 
2601 CurveTreeItem::CurveTreeItem(const QwtPlotItem *curve, LayerItem *parent, const QString& s)
2602  : QTreeWidgetItem( parent, QStringList(s), PlotCurveTreeItem ),
2603  d_curve(curve)
2604 {
2605  setIcon(0, QPixmap(":/graph_disabled.xpm"));
2606 }
2607 
2609 {
2610  if (on)
2611  setIcon(0, QPixmap(":/graph.xpm"));
2612  else
2613  setIcon(0, QPixmap(":/graph_disabled.xpm"));
2614 }
2615 
2617 {
2618 Graph *g = graph();
2619 if (!g)
2620  return -1;
2621 
2622 return g->plotItemIndex((QwtPlotItem *)d_curve);
2623 }
2624 
2626 {
2627 Graph *g = graph();
2628 if (!g)
2629  return -1;
2630 
2631 int index = g->plotItemIndex((QwtPlotItem *)d_curve);
2632 return g->curveType(index);
2633 }
PlotDialog::setTitlesFont
void setTitlesFont()
Definition: PlotDialog.cpp:2483
PlotDialog::symbolPage
QWidget * symbolPage
Definition: PlotDialog.h:182
QwtPieCurve::color
QColor color(int i) const
Definition: QwtPieCurve.cpp:98
ApplicationWindow::showCurveWorksheet
void showCurveWorksheet()
Definition: ApplicationWindow.cpp:6029
QwtErrorPlotCurve::plusSide
bool plusSide()
Definition: QwtErrorPlotCurve.h:70
PlotDialog::contourWidthBox
QSpinBox * contourWidthBox
Definition: PlotDialog.h:216
CurveTreeItem::PlotCurveTreeItem
@ PlotCurveTreeItem
Definition: PlotDialog.h:254
BoxCurve::SE
@ SE
Definition: BoxCurve.h:41
PlotDialog::boxXAxis
QComboBox * boxXAxis
Definition: PlotDialog.h:215
PlotDialog::levelsGroupBox
QGroupBox * levelsGroupBox
Definition: PlotDialog.h:217
PlotDialog::validInput
bool validInput()
Definition: PlotDialog.cpp:1987
MyParser.h
LayerItem::LayerTreeItem
@ LayerTreeItem
Definition: PlotDialog.h:234
PlotDialog::boxFillSymbol
QCheckBox * boxFillSymbol
Definition: PlotDialog.h:210
Graph::setAntialiasing
void setAntialiasing(bool on=true, bool update=true)
Enables/Disables antialiasing of plot items.
Definition: Graph.cpp:5239
QwtHistogram::autoBinning
bool autoBinning()
Definition: QwtHistogram.h:42
Graph::plotItemIndex
int plotItemIndex(QwtPlotItem *it) const
get plot item by index
Definition: Graph.cpp:2811
Table::column
Column * column(int index) const
Return column number 'index'.
Definition: Table.h:121
QwtHistogram::loadData
virtual bool loadData()
Definition: QwtHistogram.cpp:99
PlotDialog::yEndBox
QComboBox * yEndBox
Definition: PlotDialog.h:206
PlotDialog::d_ml
MultiLayer * d_ml
Definition: PlotDialog.h:158
PlotDialog::whiskerRangeLabel
QLabel * whiskerRangeLabel
Definition: PlotDialog.h:212
Spectrogram::Default
@ Default
Definition: Spectrogram.h:48
PlotDialog::initSpectrogramPage
void initSpectrogramPage()
Definition: PlotDialog.cpp:727
PlotDialog::offsetBox
QSpinBox * offsetBox
Definition: PlotDialog.h:204
PatternBox::getSelectedPattern
Qt::BrushStyle getSelectedPattern() const
Definition: PatternBox.cpp:169
BoxCurve::setMeanStyle
void setMeanStyle(QwtSymbol::Style s)
Definition: BoxCurve.h:55
PlotDialog::defaultContourBox
QRadioButton * defaultContourBox
Definition: PlotDialog.h:219
CurveTreeItem
CurveTreeItem tree widget item class.
Definition: PlotDialog.h:252
Spectrogram::setLevelsNumber
void setLevelsNumber(int levels)
Definition: Spectrogram.cpp:84
ColorMapEditor.h
PlotDialog::headAngleBox
QSpinBox * headAngleBox
Definition: PlotDialog.h:207
PlotDialog::showStatistics
void showStatistics()
Definition: PlotDialog.cpp:1056
PlotDialog::histogramBeginBox
QLineEdit * histogramBeginBox
Definition: PlotDialog.h:201
FunctionCurve.h
PlotDialog::customScaleBox
QRadioButton * customScaleBox
Definition: PlotDialog.h:219
SymbolBox::selectedSymbol
QwtSymbol::Style selectedSymbol() const
Definition: SymbolBox.cpp:167
PlotDialog::boxPieLineWidth
QSpinBox * boxPieLineWidth
Definition: PlotDialog.h:168
BoxCurve::p99Style
QwtSymbol::Style p99Style()
Definition: BoxCurve.h:59
PlotDialog::capBox
QComboBox * capBox
Definition: PlotDialog.h:196
PlotDialog::changePlotType
void changePlotType(int plotType)
Definition: PlotDialog.cpp:244
PlotDialog::setPlotType
int setPlotType(CurveTreeItem *item)
Definition: PlotDialog.cpp:1422
PlotDialog::columnNames
QStringList columnNames
Definition: PlotDialog.h:159
QwtHistogram::mean
double mean()
Definition: QwtHistogram.h:50
ColorButton
A button used for color selection.
Definition: ColorButton.h:54
PlotDialog::changeErrorBarsThrough
void changeErrorBarsThrough()
Definition: PlotDialog.cpp:1199
PlotDialog::defaultPenBox
QGroupBox * defaultPenBox
Definition: PlotDialog.h:218
PlotDialog::boxYAxis
QComboBox * boxYAxis
Definition: PlotDialog.h:215
ApplicationWindow::logInfo
QString logInfo
Definition: ApplicationWindow.h:992
PlotDialog::labelXEnd
QLabel * labelXEnd
Definition: PlotDialog.h:198
Graph::Function
@ Function
Definition: Graph.h:131
QwtErrorPlotCurve::width
int width()
Definition: QwtErrorPlotCurve.h:55
PlotDialog::boxMinStyle
SymbolBox * boxMinStyle
Definition: PlotDialog.h:221
PlotDialog::numbersFont
QFont numbersFont
Definition: PlotDialog.h:156
QwtErrorPlotCurve
Error bars curve.
Definition: QwtErrorPlotCurve.h:37
MultiLayer::scaleLayersOnPrint
bool scaleLayersOnPrint()
Definition: MultiLayer.h:93
Column.h
BoxCurve::minStyle
QwtSymbol::Style minStyle()
Definition: BoxCurve.h:49
PlotDialog::boxCanvasTransparency
QSpinBox * boxCanvasTransparency
Definition: PlotDialog.h:167
PlotDialog::buttonStatistics
QPushButton * buttonStatistics
Definition: PlotDialog.h:203
PlotDialog::gapBox
QSpinBox * gapBox
Definition: PlotDialog.h:204
PlotDialog::updateAntialiasing
void updateAntialiasing(bool on)
Definition: PlotDialog.cpp:2404
QStringFromString
QString QStringFromString(const std::string &x)
Definition: QStringStdString.h:15
PlotDialog::boxAntialiasing
QCheckBox * boxAntialiasing
Definition: PlotDialog.h:165
QwtHistogram::standardDeviation
double standardDeviation()
Definition: QwtHistogram.h:51
PlotDialog::selectCurve
void selectCurve(int index)
Definition: PlotDialog.cpp:1041
PlotDialog::boxMeanStyle
SymbolBox * boxMeanStyle
Definition: PlotDialog.h:221
PatternBox::setPattern
void setPattern(const Qt::BrushStyle &c)
Definition: PatternBox.cpp:156
PlotDialog::changeErrorBarsPlus
void changeErrorBarsPlus()
Definition: PlotDialog.cpp:1165
PlotDialog::setBoxType
void setBoxType(int index)
Definition: PlotDialog.cpp:2116
PlotDialog::clearTabWidget
void clearTabWidget()
Definition: PlotDialog.cpp:1381
CurveTreeItem::setActive
void setActive(bool on)
Definition: PlotDialog.cpp:2608
PlotDialog::plusBox
QCheckBox * plusBox
Definition: PlotDialog.h:190
PlotDialog::boxSymbolStyle
SymbolBox * boxSymbolStyle
Definition: PlotDialog.h:185
MultiLayer
An MDI window (MyWidget) managing one or more Graph objects.
Definition: MultiLayer.h:67
PlotDialog::vectPosBox
QComboBox * vectPosBox
Definition: PlotDialog.h:215
PlotDialog::boxPage
QWidget * boxPage
Definition: PlotDialog.h:205
PlotDialog::fillBoxSymbols
void fillBoxSymbols()
Definition: PlotDialog.cpp:824
PatternBox
Pattern combo box.
Definition: PatternBox.h:36
LayerItem::LayerItem
LayerItem(Graph *g, QTreeWidgetItem *parent, const QString &s)
Definition: PlotDialog.cpp:2550
PlotDialog::btnWorksheet
QPushButton * btnWorksheet
Definition: PlotDialog.h:173
PlotDialog::removeSelectedCurve
void removeSelectedCurve()
Definition: PlotDialog.cpp:1144
PlotDialog::boxRangeLabel
QLabel * boxRangeLabel
Definition: PlotDialog.h:213
PlotDialog.h
PlotDialog::boxEdgeWidth
QSpinBox * boxEdgeWidth
Definition: PlotDialog.h:207
PlotDialog::initHistogramPage
void initHistogramPage()
Definition: PlotDialog.cpp:894
PlotDialog::boxPieLineColor
ColorButton * boxPieLineColor
Definition: PlotDialog.h:169
PenWidget
Definition: PenWidget.h:50
QwtErrorPlotCurve::minusSide
bool minusSide()
Definition: QwtErrorPlotCurve.h:73
PlotDialog::headLengthBox
QSpinBox * headLengthBox
Definition: PlotDialog.h:207
PlotDialog::xBox
QCheckBox * xBox
Definition: PlotDialog.h:192
PlotDialog::boxEdgeColor
ColorButton * boxEdgeColor
Definition: PlotDialog.h:211
ColorMapEditor::colorMap
QwtLinearColorMap colorMap()
Definition: ColorMapEditor.h:45
MultiLayer::printCropmarks
void printCropmarks(bool on)
Definition: MultiLayer.h:97
PlotDialog::btnEditCurve
QPushButton * btnEditCurve
Definition: PlotDialog.h:203
Spectrogram::GrayScale
@ GrayScale
Definition: Spectrogram.h:48
PlotDialog::minusBox
QCheckBox * minusBox
Definition: PlotDialog.h:191
PlotDialog::defaultScaleBox
QRadioButton * defaultScaleBox
Definition: PlotDialog.h:219
QwtPieCurve::setRay
void setRay(int size)
Definition: QwtPieCurve.h:42
LayerItem::d_graph
Graph * d_graph
Definition: PlotDialog.h:242
PlotDialog::boxCanvasColor
ColorButton * boxCanvasColor
Definition: PlotDialog.h:166
PlotDialog::pickBackgroundColor
void pickBackgroundColor(QColor)
Definition: PlotDialog.cpp:2345
PlotDialog::initPercentilePage
void initPercentilePage()
Definition: PlotDialog.cpp:663
PlotDialog::boxPieLineStyle
QComboBox * boxPieLineStyle
Definition: PlotDialog.h:171
Plot::frameColor
QColor frameColor()
Definition: Plot.cpp:129
Graph::Pie
@ Pie
Definition: Graph.h:129
PlotDialog::GroupBoxVectEnd
QGroupBox * GroupBoxVectEnd
Definition: PlotDialog.h:214
Graph::updateErrorBars
void updateErrorBars(QwtErrorPlotCurve *er, bool xErr, int width, int cap, const QColor &c, bool plus, bool minus, bool through)
Definition: Graph.cpp:3064
MyWidget::name
virtual QString name()
Return the window name.
Definition: MyWidget.h:81
PlotDialog::setLegendsFont
void setLegendsFont()
Definition: PlotDialog.cpp:2516
SymbolBox.h
PlotDialog::initSymbolsPage
void initSymbolsPage()
Definition: PlotDialog.cpp:525
QwtPieCurve::pattern
Qt::BrushStyle pattern()
Definition: QwtPieCurve.h:44
PlotDialog::boxPiePattern
PatternBox * boxPiePattern
Definition: PlotDialog.h:170
Graph::ContourMap
@ ContourMap
Definition: Graph.h:131
CurveTreeItem::d_curve
const QwtPlotItem * d_curve
Definition: PlotDialog.h:265
QwtHistogram::end
double end()
Definition: QwtHistogram.h:44
PlotDialog::axesPage
QWidget * axesPage
Definition: PlotDialog.h:205
Graph::notifyChanges
void notifyChanges()
Definition: Graph.cpp:192
PenWidget.h
ColorButton::colorIndex
static unsigned int colorIndex(const QColor &c)
Return the index for a given color.
Definition: ColorButton.cpp:145
Graph::VectXYAM
@ VectXYAM
Definition: Graph.h:131
ApplicationWindow::showPlotAssociations
void showPlotAssociations(int curve)
Definition: ApplicationWindow.cpp:5276
PlotDialog::setAxesLabelsFont
void setAxesLabelsFont()
Definition: PlotDialog.cpp:2494
ColorButton.h
MultiLayer::activeGraph
Graph * activeGraph()
Definition: MultiLayer.h:124
PlotDialog::colorScaleBox
QComboBox * colorScaleBox
Definition: PlotDialog.h:215
SymbolBox
Plot symbol combo box.
Definition: SymbolBox.h:37
MyParser
Mathematical parser class based on muParser.
Definition: MyParser.h:52
Graph::Spline
@ Spline
Definition: Graph.h:130
PlotDialog::acceptParams
bool acceptParams()
Definition: PlotDialog.cpp:1728
CurveTreeItem::plotItemType
int plotItemType()
Definition: PlotDialog.cpp:2625
PlotDialog::labelPosition
QLabel * labelPosition
Definition: PlotDialog.h:198
QwtPieCurve.h
Graph::setBarsGap
void setBarsGap(int curve, int gapPercent, int offset)
Used for VerticalBars, HorizontalBars and Histograms.
Definition: Graph.cpp:3530
PlotDialog::customVectorsPage
void customVectorsPage(bool angleMag)
Definition: PlotDialog.cpp:2182
PlotDialog::colorBox
ColorButton * colorBox
Definition: PlotDialog.h:193
Table
MDI window providing a spreadsheet table with column logic.
Definition: Table.h:51
BoxCurve::boxRange
double boxRange()
Definition: BoxCurve.h:70
MyParser::SetExpr
void SetExpr(const QString &x)
Definition: MyParser.h:56
PlotDialog::legendFont
QFont legendFont
Definition: PlotDialog.h:156
PlotDialog::levelsBox
QSpinBox * levelsBox
Definition: PlotDialog.h:216
Spectrogram::defaultColorMap
static QwtLinearColorMap defaultColorMap()
Definition: Spectrogram.cpp:240
BoxCurve::setBoxStyle
void setBoxStyle(int style)
Definition: BoxCurve.cpp:271
PlotDialog::initBoxPage
void initBoxPage()
Definition: PlotDialog.cpp:561
BoxCurve::SD
@ SD
Definition: BoxCurve.h:41
BoxCurve::boxWidth
int boxWidth()
Definition: BoxCurve.h:67
PlotDialog::showPlotAssociations
void showPlotAssociations(QTreeWidgetItem *item, int)
Definition: PlotDialog.cpp:173
VectorCurve::headAngle
int headAngle()
Definition: VectorCurve.h:76
Spectrogram::hasColorScale
bool hasColorScale()
Definition: Spectrogram.cpp:96
QwtErrorPlotCurve::color
QColor color()
Definition: QwtErrorPlotCurve.h:58
PlotDialog::pickErrorBarsColor
void pickErrorBarsColor(QColor)
Definition: PlotDialog.cpp:1233
Graph::antialiasing
bool antialiasing()
Definition: Graph.h:692
PlotDialog::boxRadius
QSpinBox * boxRadius
Definition: PlotDialog.h:168
PlotDialog::filledHeadBox
QCheckBox * filledHeadBox
Definition: PlotDialog.h:208
ColorMapEditor
Definition: ColorMapEditor.h:39
PlotDialog::linePage
QWidget * linePage
Definition: PlotDialog.h:177
PlotDialog::box1Style
SymbolBox * box1Style
Definition: PlotDialog.h:221
MultiLayer::setScaleLayersOnPrint
void setScaleLayersOnPrint(bool on)
Definition: MultiLayer.h:94
PlotDialog::boxAll
QCheckBox * boxAll
Definition: PlotDialog.h:165
BoxCurve::boxRangeType
int boxRangeType()
Definition: BoxCurve.h:71
PlotDialog::changeErrorBarsType
void changeErrorBarsType()
Definition: PlotDialog.cpp:1216
PlotDialog::initPiePage
void initPiePage()
Definition: PlotDialog.cpp:384
Spectrogram::colorScaleAxis
int colorScaleAxis()
Definition: Spectrogram.h:57
ApplicationWindow::d_extended_plot_dialog
bool d_extended_plot_dialog
Definition: ApplicationWindow.h:928
MultiLayer::printCropmarksEnabled
bool printCropmarksEnabled()
Definition: MultiLayer.h:96
PlotDialog::setActiveCurve
void setActiveCurve(CurveTreeItem *item)
Definition: PlotDialog.cpp:1521
ColorButton::color
QColor color() const
Get the color of the display part.
Definition: ColorButton.cpp:140
PlotDialog::vectWidthBox
QSpinBox * vectWidthBox
Definition: PlotDialog.h:207
BoxCurve::setMinStyle
void setMinStyle(QwtSymbol::Style s)
Definition: BoxCurve.h:50
PlotDialog::changeMargin
void changeMargin(int)
Definition: PlotDialog.cpp:2457
PlotDialog::updateBackgroundTransparency
void updateBackgroundTransparency(int alpha)
Definition: PlotDialog.cpp:2232
BoxCurve::boxStyle
int boxStyle()
Definition: BoxCurve.h:64
PlotDialog::btnMore
QPushButton * btnMore
Definition: PlotDialog.h:174
PlotDialog::setMultiLayer
void setMultiLayer(MultiLayer *ml)
Definition: PlotDialog.cpp:1008
PlotDialog::spectrogramPage
QWidget * spectrogramPage
Definition: PlotDialog.h:188
PlotDialog::boxRange
QComboBox * boxRange
Definition: PlotDialog.h:206
BoxCurve::setWhiskersRange
void setWhiskersRange(int type, double coeff)
Definition: BoxCurve.cpp:303
Graph::VectXYXY
@ VectXYXY
Definition: Graph.h:130
PlotDialog::printPage
QWidget * printPage
Definition: PlotDialog.h:163
CurveTreeItem::plotItem
const QwtPlotItem * plotItem()
Definition: PlotDialog.h:260
PlotDialog::showAll
void showAll(bool all)
Definition: PlotDialog.cpp:152
SymbolBox::setStyle
void setStyle(const QwtSymbol::Style &c)
Definition: SymbolBox.cpp:154
PlotDialog::pickBorderColor
void pickBorderColor(QColor)
Definition: PlotDialog.cpp:2380
PenWidget::setPen
void setPen(const QPen &pen)
Definition: PenWidget.cpp:157
CurveTreeItem::plotItemIndex
int plotItemIndex()
Definition: PlotDialog.cpp:2616
BoxCurve::whiskersRange
double whiskersRange()
Definition: BoxCurve.h:74
QwtPieCurve::setBrushStyle
void setBrushStyle(const Qt::BrushStyle &style)
Definition: QwtPieCurve.cpp:104
PlotDialog::initAxesPage
void initAxesPage()
Definition: PlotDialog.cpp:456
QwtPieCurve::setFirstColor
void setFirstColor(int index)
Definition: QwtPieCurve.h:47
PlotDialog::xEndBox
QComboBox * xEndBox
Definition: PlotDialog.h:206
PlotDialog::vectPage
QWidget * vectPage
Definition: PlotDialog.h:205
PlotDialog::spacingPage
QWidget * spacingPage
Definition: PlotDialog.h:200
Spectrogram::matrix
Matrix * matrix()
Definition: Spectrogram.h:51
QwtPieCurve::ray
int ray()
Definition: QwtPieCurve.h:41
PlotDialog::setAxesNumbersFont
void setAxesNumbersFont()
Definition: PlotDialog.cpp:2505
QwtErrorPlotCurve.h
LayerItem::graph
Graph * graph()
Definition: PlotDialog.h:237
PlotDialog::initLayerPage
void initLayerPage()
Definition: PlotDialog.cpp:314
PlotDialog::piePage
QWidget * piePage
Definition: PlotDialog.h:163
BoxCurve::setBoxRange
void setBoxRange(int type, double coeff)
Definition: BoxCurve.cpp:278
Spectrogram::setDefaultColorMap
void setDefaultColorMap()
Definition: Spectrogram.cpp:210
Graph::setCurveStyle
void setCurveStyle(int index, int s)
Definition: Graph.cpp:4848
PatternBox.h
MyWidget::notifyChanges
void notifyChanges()
Notifies the main application that the window has been modified.
Definition: MyWidget.h:134
PlotDialog::buttonApply
QPushButton * buttonApply
Definition: PlotDialog.h:173
PlotDialog::buttonOk
QPushButton * buttonOk
Definition: PlotDialog.h:174
PlotDialog::grayScaleBox
QRadioButton * grayScaleBox
Definition: PlotDialog.h:219
PlotDialog::insertTabs
void insertTabs(int plot_type)
Definition: PlotDialog.cpp:1308
Graph::setCurveType
void setCurveType(int curve, CurveType type, bool update=true)
Change the type of the given curve.
Definition: Graph.cpp:2949
Graph::replot
void replot()
Definition: Graph.h:249
Graph::plotWidget
Plot * plotWidget() const
Accessor method for d_plot.
Definition: Graph.h:155
PlotDialog::closeEvent
void closeEvent(QCloseEvent *e)
Definition: PlotDialog.cpp:2535
Graph::HorizontalBars
@ HorizontalBars
Definition: Graph.h:130
PlotDialog::btnAxesLabels
QPushButton * btnAxesLabels
Definition: PlotDialog.h:161
ApplicationWindow::newTable
Table * newTable()
Creates an empty table.
Definition: ApplicationWindow.cpp:2522
PlotDialog::boxCntLabel
QLabel * boxCntLabel
Definition: PlotDialog.h:213
PlotDialog::boxFillColor
ColorButton * boxFillColor
Definition: PlotDialog.h:184
Plot::paletteBackgroundColor
const QColor & paletteBackgroundColor() const
Definition: Plot.cpp:629
ApplicationWindow::table
Table * table(const QString &name)
Definition: ApplicationWindow.cpp:2806
PlotDialog::initSpacingPage
void initSpacingPage()
Definition: PlotDialog.cpp:927
Graph::updateScale
void updateScale()
Definition: Graph.cpp:3496
PlotDialog::showDefaultContourLinesBox
void showDefaultContourLinesBox(bool show)
Definition: PlotDialog.cpp:2213
CurveTreeItem::CurveTreeItem
CurveTreeItem(const QwtPlotItem *curve, LayerItem *parent, const QString &s)
Definition: PlotDialog.cpp:2601
VectorCurve::headLength
int headLength()
Definition: VectorCurve.h:73
PlotDialog::whiskerCoeffLabel
QLabel * whiskerCoeffLabel
Definition: PlotDialog.h:212
QStringStdString.h
PlotDialog::colorMapEditor
ColorMapEditor * colorMapEditor
Definition: PlotDialog.h:162
PlotDialog::btnLegend
QPushButton * btnLegend
Definition: PlotDialog.h:161
MultiLayer::setFonts
void setFonts(const QFont &titleFnt, const QFont &scaleFnt, const QFont &numbersFnt, const QFont &legendFnt)
Definition: MultiLayer.cpp:874
QwtErrorPlotCurve::capLength
int capLength()
Definition: QwtErrorPlotCurve.h:52
QwtErrorPlotCurve::throughSymbol
bool throughSymbol()
Definition: QwtErrorPlotCurve.h:67
BoxCurve::setBoxWidth
void setBoxWidth(int width)
Definition: BoxCurve.h:68
PlotDialog::boxMargin
QSpinBox * boxMargin
Definition: PlotDialog.h:167
PlotDialog::initFontsPage
void initFontsPage()
Definition: PlotDialog.cpp:286
CurveTreeItem::graph
Graph * graph()
Definition: PlotDialog.h:257
Graph::curves
int curves() const
Definition: Graph.h:193
PlotDialog::boxBorderWidth
QSpinBox * boxBorderWidth
Definition: PlotDialog.h:167
PlotDialog::boxAreaColor
ColorButton * boxAreaColor
Definition: PlotDialog.h:181
PlotDialog::editCurve
void editCurve()
Definition: PlotDialog.cpp:214
Graph::Scatter
@ Scatter
Definition: Graph.h:129
PlotDialog::axisScaleBox
QGroupBox * axisScaleBox
Definition: PlotDialog.h:217
PlotDialog::initErrorsPage
void initErrorsPage()
Definition: PlotDialog.cpp:836
Table::setHeader
void setHeader(QStringList header)
Definition: Table.cpp:1000
Graph::removeCurve
void removeCurve(int index)
Removes a curve defined by its index.
Definition: Graph.cpp:3592
Graph::setMargin
void setMargin(int d)
Definition: Graph.cpp:4192
LayerItem::setActive
void setActive(bool select)
Definition: PlotDialog.cpp:2559
Spectrogram::setGrayScale
void setGrayScale()
Definition: Spectrogram.cpp:195
VectorCurve::color
QColor color()
Definition: VectorCurve.cpp:211
PlotDialog::autoContourBox
QRadioButton * autoContourBox
Definition: PlotDialog.h:219
Graph::getPenStyle
static Qt::PenStyle getPenStyle(const QString &s)
Definition: Graph.cpp:4329
PlotDialog::fillGroupBox
QGroupBox * fillGroupBox
Definition: PlotDialog.h:189
PlotDialog::changeErrorBarsMinus
void changeErrorBarsMinus()
Definition: PlotDialog.cpp:1182
VectorCurve::position
int position()
Definition: VectorCurve.h:82
Spectrogram
Definition: Spectrogram.h:43
PlotDialog::errorsPage
QWidget * errorsPage
Definition: PlotDialog.h:188
PlotDialog::boxBackgroundTransparency
QSpinBox * boxBackgroundTransparency
Definition: PlotDialog.h:167
PlotDialog::setPiePenStyle
void setPiePenStyle(const Qt::PenStyle &style)
Definition: PlotDialog.cpp:2102
PlotDialog::box99Style
SymbolBox * box99Style
Definition: PlotDialog.h:221
QwtBarCurve::offset
int offset() const
Definition: QwtBarCurve.h:52
PlotCurve
Abstract 2D plot curve class.
Definition: PlotCurve.h:37
VectorCurve.h
ApplicationWindow
SciDAVis's main window.
Definition: ApplicationWindow.h:122
Graph::Line
@ Line
Definition: Graph.h:129
BoxCurve::setMaxStyle
void setMaxStyle(QwtSymbol::Style s)
Definition: BoxCurve.h:53
LayerItem
LayerItem tree widget item class.
Definition: PlotDialog.h:232
Plot
Plot window class.
Definition: Plot.h:44
PlotDialog::automaticBox
QCheckBox * automaticBox
Definition: PlotDialog.h:202
PlotDialog::boxPenWidth
QSpinBox * boxPenWidth
Definition: PlotDialog.h:180
PlotDialog::boxFirstColor
ColorButton * boxFirstColor
Definition: PlotDialog.h:169
PlotDialog::initVectPage
void initVectPage()
Definition: PlotDialog.cpp:947
PlotDialog::initFonts
void initFonts(const QFont &titlefont, const QFont &axesfont, const QFont &numbersfont, const QFont &legendfont)
Definition: PlotDialog.cpp:2527
PlotDialog::whiskerCntLabel
QLabel * whiskerCntLabel
Definition: PlotDialog.h:213
PlotDialog::boxScaleLayers
QCheckBox * boxScaleLayers
Definition: PlotDialog.h:165
PlotDialog::boxSymbolSize
QSpinBox * boxSymbolSize
Definition: PlotDialog.h:183
Spectrogram::colorBarWidth
int colorBarWidth()
Definition: Spectrogram.cpp:162
Graph::curveType
int curveType(int curveIndex)
Definition: Graph.cpp:4355
QwtErrorPlotCurve::xErrors
bool xErrors()
Definition: QwtErrorPlotCurve.cpp:193
PlotDialog::updateEndPointColumns
void updateEndPointColumns(const QString &text)
Definition: PlotDialog.cpp:1706
PlotDialog::widthBox
QComboBox * widthBox
Definition: PlotDialog.h:195
BoxCurve::p1Style
QwtSymbol::Style p1Style()
Definition: BoxCurve.h:62
Graph::setBackgroundColor
void setBackgroundColor(const QColor &color)
Definition: Graph.cpp:4213
PlotDialog::fillSymbols
void fillSymbols()
Definition: PlotDialog.cpp:830
PlotDialog::updateCanvasTransparency
void updateCanvasTransparency(int alpha)
Definition: PlotDialog.cpp:2271
PlotDialog::btnAxesNumbers
QPushButton * btnAxesNumbers
Definition: PlotDialog.h:161
PlotDialog::boxType
QComboBox * boxType
Definition: PlotDialog.h:206
PlotDialog::setActiveLayer
void setActiveLayer(LayerItem *item)
Definition: PlotDialog.cpp:1481
PlotDialog::boxCoeffLabel
QLabel * boxCoeffLabel
Definition: PlotDialog.h:212
PlotDialog::whiskerCnt
QDoubleSpinBox * whiskerCnt
Definition: PlotDialog.h:222
Graph::setCurveBrush
void setCurveBrush(int index, const QBrush &b)
Definition: Graph.cpp:4894
PlotDialog::boxConnect
QComboBox * boxConnect
Definition: PlotDialog.h:178
PlotDialog::fontsPage
QWidget * fontsPage
Definition: PlotDialog.h:163
BoxCurve.h
QwtHistogram.h
PlotCurve::type
int type() const
Definition: PlotCurve.h:42
PlotDialog::boxContourStyle
QComboBox * boxContourStyle
Definition: PlotDialog.h:215
PlotDialog::histogramEndBox
QLineEdit * histogramEndBox
Definition: PlotDialog.h:201
PlotDialog::boxMaxStyle
SymbolBox * boxMaxStyle
Definition: PlotDialog.h:221
Spectrogram::colorMapPolicy
ColorMapPolicy colorMapPolicy()
Definition: Spectrogram.h:73
PlotDialog::imageGroupBox
QGroupBox * imageGroupBox
Definition: PlotDialog.h:217
PlotDialog::throughBox
QCheckBox * throughBox
Definition: PlotDialog.h:197
PlotDialog::layerPage
QWidget * layerPage
Definition: PlotDialog.h:163
PlotDialog::boxPercSize
QSpinBox * boxPercSize
Definition: PlotDialog.h:207
QwtHistogram::maximum
double maximum()
Definition: QwtHistogram.h:53
PlotDialog::boxSymbolColor
ColorButton * boxSymbolColor
Definition: PlotDialog.h:184
PlotDialog::btnTitle
QPushButton * btnTitle
Definition: PlotDialog.h:161
QwtHistogram::setBinning
void setBinning(bool autoBin, double size, double begin, double end)
Definition: QwtHistogram.cpp:91
BoxCurve::WindBox
@ WindBox
Definition: BoxCurve.h:40
QwtPieCurve::firstColor
int firstColor()
Definition: QwtPieCurve.h:48
ColorMapEditor::setColorMap
void setColorMap(const QwtLinearColorMap &map)
Definition: ColorMapEditor.cpp:114
PlotDialog::GroupBoxH
QGroupBox * GroupBoxH
Definition: PlotDialog.h:199
PlotDialog::vectColorBox
ColorButton * vectColorBox
Definition: PlotDialog.h:194
BoxCurve
Box curve.
Definition: BoxCurve.h:38
DataCurve
Definition: PlotCurve.h:52
PlotDialog::showColorMapEditor
void showColorMapEditor(bool show)
Definition: PlotDialog.cpp:2202
Spectrogram::setColorBarWidth
void setColorBarWidth(int width)
Definition: Spectrogram.cpp:172
PlotDialog::boxCoef
QSpinBox * boxCoef
Definition: PlotDialog.h:209
Graph::ColorMap
@ ColorMap
Definition: Graph.h:131
Spectrogram::showColorScale
void showColorScale(int axis, bool on=true)
Definition: Spectrogram.cpp:106
VectorCurve::filledArrowHead
bool filledArrowHead()
Definition: VectorCurve.h:79
VectorCurve
Vector curve class.
Definition: VectorCurve.h:39
Graph::updateVectorsLayout
void updateVectorsLayout(int curve, const QColor &color, int width, int arrowLength, int arrowAngle, bool filled, int position, const QString &xEndColName=QString(), const QString &yEndColName=QString())
Definition: Graph.cpp:3452
PlotDialog::titleFont
QFont titleFont
Definition: PlotDialog.h:156
PlotDialog::boxWidth
QSpinBox * boxWidth
Definition: PlotDialog.h:204
ColorMapEditor::setRange
void setRange(double min, double max)
Definition: ColorMapEditor.cpp:143
PlotDialog::boxPlotType
QComboBox * boxPlotType
Definition: PlotDialog.h:176
Graph::ErrorBars
@ ErrorBars
Definition: Graph.h:130
Graph::setAutoScale
void setAutoScale()
Definition: Graph.cpp:1256
PlotDialog::curvePlotTypeBox
QWidget * curvePlotTypeBox
Definition: PlotDialog.h:163
PlotDialog::levelsColorBox
ColorButton * levelsColorBox
Definition: PlotDialog.h:193
PlotDialog::histogramPage
QWidget * histogramPage
Definition: PlotDialog.h:200
LayerItem::insertCurvesList
void insertCurvesList()
Definition: PlotDialog.cpp:2567
PlotDialog::boxPattern
PatternBox * boxPattern
Definition: PlotDialog.h:186
Spectrogram::levels
int levels()
Definition: Spectrogram.h:53
Graph::setCanvasBackground
void setCanvasBackground(const QColor &color)
Definition: Graph.cpp:4223
PlotDialog::updateTreeWidgetItem
void updateTreeWidgetItem(QTreeWidgetItem *item)
Definition: PlotDialog.cpp:2221
Graph::GrayMap
@ GrayMap
Definition: Graph.h:131
Spectrogram::setCustomColorMap
void setCustomColorMap(const QwtLinearColorMap &map)
Definition: Spectrogram.cpp:225
PlotDialog::contextMenuEvent
void contextMenuEvent(QContextMenuEvent *e)
Definition: PlotDialog.cpp:1114
Graph::CurveType
CurveType
Definition: Graph.h:129
PlotDialog::initPrintPage
void initPrintPage()
Definition: PlotDialog.cpp:440
PlotDialog::showAreaColor
void showAreaColor(bool show)
Definition: PlotDialog.cpp:1250
Graph
A 2D-plotting widget.
Definition: Graph.h:119
ApplicationWindow::showResults
void showResults(bool ok)
Definition: ApplicationWindow.cpp:6550
Graph::setFrame
void setFrame(int width=1, const QColor &color=QColor(Qt::black))
Definition: Graph.cpp:4201
PlotDialog::colorScaleWidthBox
QSpinBox * colorScaleWidthBox
Definition: PlotDialog.h:216
PlotDialog::axesFont
QFont axesFont
Definition: PlotDialog.h:156
Spectrogram.h
Graph::Histogram
@ Histogram
Definition: Graph.h:130
BoxCurve::setP1Style
void setP1Style(QwtSymbol::Style s)
Definition: BoxCurve.h:61
QwtBarCurve::gap
int gap() const
Definition: QwtBarCurve.h:49
PlotDialog::boxBackgroundColor
ColorButton * boxBackgroundColor
Definition: PlotDialog.h:166
PlotDialog::updateBorder
void updateBorder(int width)
Definition: PlotDialog.cpp:2430
Spectrogram::Custom
@ Custom
Definition: Spectrogram.h:48
PlotDialog::setBoxRangeType
void setBoxRangeType(int index)
Definition: PlotDialog.cpp:2143
PlotDialog::PlotDialog
PlotDialog(bool showExtended, QWidget *parent=0, Qt::WindowFlags fl=0)
Definition: PlotDialog.cpp:69
QwtHistogram::begin
double begin()
Definition: QwtHistogram.h:43
Graph::Box
@ Box
Definition: Graph.h:131
MultiLayer::graphPtrs
QWidgetList graphPtrs()
Definition: MultiLayer.h:72
PlotDialog::binSizeBox
QLineEdit * binSizeBox
Definition: PlotDialog.h:201
PlotDialog::initLinePage
void initLinePage()
Definition: PlotDialog.cpp:481
Graph::VerticalSteps
@ VerticalSteps
Definition: Graph.h:131
PlotDialog::setWhiskersRange
void setWhiskersRange(int index)
Definition: PlotDialog.cpp:2163
PlotDialog::boxWhiskersCoef
QSpinBox * boxWhiskersCoef
Definition: PlotDialog.h:209
QwtPieCurve
Pie plot class.
Definition: QwtPieCurve.h:34
ApplicationWindow.h
PlotDialog::quit
void quit()
Definition: PlotDialog.cpp:1400
PlotDialog::boxPrintCrops
QCheckBox * boxPrintCrops
Definition: PlotDialog.h:165
BoxCurve::UserDef
@ UserDef
Definition: BoxCurve.h:41
ApplicationWindow::showFunctionDialog
void showFunctionDialog()
Definition: ApplicationWindow.cpp:8332
Graph::updatePlot
void updatePlot()
Definition: Graph.cpp:3474
PlotDialog::listBox
QTreeWidget * listBox
Definition: PlotDialog.h:164
QwtHistogram::minimum
double minimum()
Definition: QwtHistogram.h:52
PlotDialog::boxCnt
QDoubleSpinBox * boxCnt
Definition: PlotDialog.h:222
BoxCurve::NoBox
@ NoBox
Definition: BoxCurve.h:40
QwtBarCurve
Bar curve.
Definition: QwtBarCurve.h:37
PlotDialog::setAutomaticBinning
void setAutomaticBinning()
Definition: PlotDialog.cpp:1982
QwtHistogram
Histogram class.
Definition: QwtHistogram.h:33
Table.h
ApplicationWindow::generateUniqueName
QString generateUniqueName(const QString &name, bool increment=true)
Definition: ApplicationWindow.cpp:13503
BoxCurve::maxStyle
QwtSymbol::Style maxStyle()
Definition: BoxCurve.h:52
PlotDialog::percentilePage
QWidget * percentilePage
Definition: PlotDialog.h:205
Graph::LineSymbols
@ LineSymbols
Definition: Graph.h:129
PlotDialog::boxFillSymbols
QCheckBox * boxFillSymbols
Definition: PlotDialog.h:210
PlotDialog::pickCanvasColor
void pickCanvasColor(QColor)
Definition: PlotDialog.cpp:2310
VectorCurve::width
int width()
Definition: VectorCurve.cpp:201
PlotDialog::showWorksheet
void showWorksheet()
Definition: PlotDialog.cpp:1406
QwtHistogram::binSize
double binSize()
Definition: QwtHistogram.h:45
PlotDialog::boxPercFillColor
ColorButton * boxPercFillColor
Definition: PlotDialog.h:211
PenWidget::pen
QPen pen() const
Definition: PenWidget.h:56
PlotDialog::penWidget
PenWidget * penWidget
Definition: PlotDialog.h:179
BoxCurve::whiskersRangeType
int whiskersRangeType()
Definition: BoxCurve.h:75
BoxCurve::meanStyle
QwtSymbol::Style meanStyle()
Definition: BoxCurve.h:56
Column::setValueAt
void setValueAt(int row, double new_value)
Set the content of row 'row'.
Definition: Column.cpp:229
Graph::VerticalBars
@ VerticalBars
Definition: Graph.h:129
PlotDialog::labelYEnd
QLabel * labelYEnd
Definition: PlotDialog.h:198
PlotDialog::boxWhiskersRange
QComboBox * boxWhiskersRange
Definition: PlotDialog.h:206
ColorButton::setColor
void setColor(const QColor &c)
Set the color of the display part.
Definition: ColorButton.cpp:132
PlotDialog::buttonCancel
QPushButton * buttonCancel
Definition: PlotDialog.h:175
PlotDialog::boxBorderColor
ColorButton * boxBorderColor
Definition: PlotDialog.h:166
Graph::plotItem
QwtPlotItem * plotItem(int index)
get plotted item by index
Definition: Graph.cpp:2803
PlotDialog::updateTabWindow
void updateTabWindow(QTreeWidgetItem *currentItem, QTreeWidgetItem *previousItem)
Definition: PlotDialog.cpp:1256
PlotDialog::privateTabWidget
QTabWidget * privateTabWidget
Definition: PlotDialog.h:187
BoxCurve::setP99Style
void setP99Style(QwtSymbol::Style s)
Definition: BoxCurve.h:58