QtiPlot  0.9.8.2
Graph.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : Graph.h
3  Project : QtiPlot
4  --------------------------------------------------------------------
5  Copyright : (C) 2004-2008 by Ion Vasilief
6  Email (use @ for *) : ion_vasilief*yahoo.fr
7  Description : Graph widget
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  * This program is distributed in the hope that it will be useful, *
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21  * GNU General Public License for more details. *
22  * *
23  * You should have received a copy of the GNU General Public License *
24  * along with this program; if not, write to the Free Software *
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26  * Boston, MA 02110-1301 USA *
27  * *
28  ***************************************************************************/
29 #ifndef GRAPH_H
30 #define GRAPH_H
31 
32 #include <QList>
33 #include <QPointer>
34 #include <QPrinter>
35 #include <QVector>
36 #include <QEvent>
37 #include <QMap>
38 
39 #include <qwt_text.h>
40 #include <qwt_plot.h>
41 #include <qwt_plot_marker.h>
42 #include <qwt_plot_curve.h>
43 
44 #include <AxesDialog.h>
45 #include <PlotToolInterface.h>
46 #include <ScaleDraw.h>
47 #include <FrameWidget.h>
48 #include <float.h>
49 
50 class QwtPlotPanner;
51 class QwtPlotMagnifier;
52 class QwtPlotCurve;
53 class QwtPlotZoomer;
54 class PieCurve;
55 class Table;
56 class ArrowMarker;
57 class ImageWidget;
58 class TitlePicker;
59 class ScalePicker;
60 class CanvasPicker;
61 class ApplicationWindow;
62 class Matrix;
64 class RangeSelectorTool;
65 class ImageProfilesTool;
66 class DataCurve;
67 class PlotCurve;
68 class ErrorBarsCurve;
69 class MultiLayer;
70 class Spectrogram;
71 class FunctionCurve;
72 class VectorCurve;
73 class BoxCurve;
74 class QwtHistogram;
75 class Grid;
76 class TexWidget;
77 class LegendWidget;
78 
80 typedef struct{
81  QColor lCol;
82  float lWidth;
83  int lStyle;
84  double filledArea;
85  QColor aCol;
86  int aStyle;
87  QColor symCol;
88  QColor fillCol;
89  float penWidth;
90  int sSize;
91  int sType;
93 } CurveLayout;
94 
123 class Graph: public QwtPlot
124 {
125  Q_OBJECT
126 
127  public:
128  Graph (int x = 0, int y = 0, int width = 500, int height = 400, QWidget* parent=0, Qt::WFlags f=0);
129  ~Graph();
130 
133  enum Ticks{NoTicks = 0, Out = 1, InOut = 2, In = 3};
134  enum MarkerType{None = -1, Text = 0, Arrow = 1, Image = 2};
141 
143  MultiLayer *multiLayer() const;
144 
146  void setActiveTool(PlotToolInterface *tool);
150  bool hasActiveTool();
151 
152  QList <LegendWidget *> textsList();
155  void select(QWidget *l, bool add = false);
156 
158  QList <FrameWidget *> enrichmentsList(){return d_enrichments;};
159  QList <FrameWidget *> increasingAreaEnrichmentsList();
160 
161  bool hasSeletedItems();
162  void deselect();
163  void deselect(QWidget *);
164  void selectCanvas();
165 
166  QPointer<SelectionMoveResizer> selectionMoveResizer(){return d_markers_selector;};
167 
168  QwtPlotItem* selectedCurveLabels();
170  void restoreCurveLabels(int curveID, const QStringList& lst);
171 
172  Grid *grid(){return (Grid *)d_grid;};
173  QList<QwtPlotItem *> curvesList(){return d_curves;};
174  void setCurvesList(QList<QwtPlotItem *> lst){d_curves = lst;};
175 
176  QwtPlotItem* closestCurve(int xpos, int ypos, int &dist, int &point);
177 
178  void insertMarker(QwtPlotMarker *m);
179 
180  QList<int> getMajorTicksType();
181  void setMajorTicksType(int axis, int type);
182 
183  QList<int> getMinorTicksType();
184  void setMinorTicksType(int axis, int type);
185 
186  int minorTickLength() const;
187  int majorTickLength() const;
188  void setTickLength (int minLength, int majLength);
189 
190  int axesLinewidth() const;
191  void setAxesLinewidth(int width);
192 
193  void axisLabelFormat(int axis, char &f, int &prec) const;
194 
195  int axisLabelFormat(int axis);
196  int axisLabelPrecision(int axis);
197 
198  QColor frameColor();
199  const QColor & paletteBackgroundColor() const;
200 
201  void print(QPainter *, const QRect &rect, const QwtPlotPrintFilter & = QwtPlotPrintFilter());
202  void updateLayout();
203  void setCanvasGeometry(const QRect &canvasRect);
205  void setCanvasGeometry(int x, int y, int w, int h){setCanvasGeometry(QRect(x, y, w, h));};
206  void setCanvasSize(const QSize &size);
208  void setCanvasSize(int w, int h){setCanvasSize(QSize(w, h));};
209 
210  void updateCurveLabels();
211 
212  TexWidget* addTexFormula(const QString& s, const QPixmap& pix);
213 
214  FrameWidget* add(FrameWidget* fw, bool copy = true);
215  void remove(FrameWidget*);
216 
217  QRect boundingRect();
218  void raiseEnrichements();
219  void addLegendItem();
220  bool isPrinting(){return d_is_printing;};
221 
222  void enablePanningMagnifier(bool on = true, int mode = 0);
223  bool hasPanningMagnifierEnabled(){if (d_magnifier && d_panner) return true; return false;};
224  QwtPlotMagnifier* magnifyTool(){return d_magnifier;};
225 
226 #ifdef TEX_OUTPUT
227  static QString escapeTeXSpecialCharacters(const QString &);
228  static QString texSuperscripts(const QString &);
229 #endif
230  void changeCurveIndex(int fromIndex, int toIndex);
231  void enableDouglasPeukerSpeedMode(double tolerance, int maxPoints = 3000);
232 
235 
238 
241 
242  QRectF pageGeometry(){return d_page_rect;}
243  void setPageGeometry(const QRectF& r){d_page_rect = r;}
244 
245  public slots:
246  void copy(Graph* g);
247  void copyCurves(Graph* g);
248  void copyEnrichments(Graph* g);
249  void copyScaleWidget(Graph* g, int i);
250  void copyScaleDraw(Graph* g, int i);
251 
253 
254  bool isPiePlot();
257  PieCurve* plotPie(Table* w,const QString& name, int startRow = 0, int endRow = -1);
259  PieCurve* plotPie(Table* w, const QString& name, const QPen& pen, int brush, int size,
260  int firstColor, int startRow = 0, int endRow = -1, bool visible = true,
261  double d_start_azimuth = 270, double d_view_angle = 90, double d_thickness = 33,
262  double d_horizontal_offset = 0.0, double d_edge_dist = 25, bool d_counter_clockwise = false,
263  bool d_auto_labeling = true, bool d_values = false, bool d_percentages = true,
264  bool d_categories = false, bool d_fixed_labels_pos = true);
265 
266  void removePie();
267  QString pieLegendText();
268  QString savePieCurveLayout();
270 
271  bool addCurves(Table* w, const QStringList& names, int style = 0, double lWidth = 1, int sSize = 3, int startRow = 0, int endRow = -1);
272  DataCurve* insertCurve(Table* w, const QString& name, int style, int startRow = 0, int endRow = -1);
273  DataCurve* insertCurve(Table* w, int xcol, const QString& name, int style);
274  DataCurve* insertCurve(Table* w, const QString& xColName, const QString& yColName, int style, int startRow = 0, int endRow = -1);
275  DataCurve* insertCurve(Table* xt, const QString& xColName, Table* yt, const QString& yColName, int style, int startRow = 0, int endRow = -1);
276  void insertPlotItem(QwtPlotItem *i, int type);
277  void insertCurve(QwtPlotItem *c);
278 
280  void showCurve(int index, bool visible = true);
281  int visibleCurves();
282 
283  void removeCurve(QwtPlotItem *it);
285  void removeCurve(int index);
289  void removeCurve(const QString& s);
293  void removeCurves(const QString& s);
294 
295  void updateCurvesData(Table* w, const QString& yColName);
296  void reloadCurvesData();
297 
298  int curveCount(){return d_curves.size();};
299  bool validCurvesDataSize();
300  double selectedXStartValue();
301  double selectedXEndValue();
302 
304  int curveIndex(QwtPlotItem *c){return d_curves.indexOf(c);};
306  int curveIndex(const QString &title){return plotItemsList().indexOf(title);}
307  DataCurve* dataCurve(int index);
308  FunctionCurve* functionCurve(int index);
310  PlotCurve* curve(int index);
312  PlotCurve* curve(const QString &title){return curve(curveIndex(title));};
314  QString curveTitle(int index);
316  QString curveRange(QwtPlotCurve *c);
317 
319  QStringList analysableCurvesList();
321  QStringList curveNamesList();
323  QStringList plotItemsList();
325  QwtPlotItem* plotItem(int index);
326 
327  void updateCurveNames(const QString& oldName, const QString& newName, bool updateTableName = true);
328 
330 
331  void setCurveStyle(int index, int s);
332  void setCurveFullRange(int curveIndex);
333  void setCurveLineColor(int curveIndex, int colorIndex);
334  void setCurveLineColor(int curveIndex, QColor qColor);
335  void setCurveLineStyle(int curveIndex, Qt::PenStyle style);
336  void setCurveLineWidth(int curveIndex, double width);
337  void setGrayScale();
338  void setIndexedColors();
340 
342 
343  void print();
344  void copyImage();
345  QPixmap graphPixmap(const QSize& size = QSize(), double scaleFontsFactor = 1.0, bool transparent = false);
347  void exportToFile(const QString& fileName);
348  void exportSVG(const QString& fname, const QSizeF& customSize = QSizeF(), int unit = FrameWidget::Pixel, double fontsFactor = 1.0);
349  void exportEMF(const QString& fname, const QSizeF& customSize = QSizeF(), int unit = FrameWidget::Pixel, double fontsFactor = 1.0);
350  void exportTeX(const QString& fname, bool color = true, bool escapeStrings = true, bool fontSizes = true,
351  const QSizeF& customSize = QSizeF(), int unit = FrameWidget::Pixel, double fontsFactor = 1.0);
352 #ifdef TEX_OUTPUT
353  bool isExportingTeX(){return d_is_exporting_tex;};
354  void setTeXExportingMode(bool on = true){d_is_exporting_tex = on;};
355  bool escapeTeXStrings(){return d_tex_escape_strings;};
356  void setEscapeTeXStringsMode(bool on = true){d_tex_escape_strings = on;};
357 #endif
358  void exportVector(const QString& fileName, int res = 0, bool color = true,
359  const QSizeF& customSize = QSizeF (), int unit = FrameWidget::Pixel, double fontsFactor = 1.0);
360  void exportVector(QPrinter *printer, int res = 0, bool color = true,
361  const QSizeF& customSize = QSizeF (), int unit = FrameWidget::Pixel, double fontsFactor = 1.0);
362  void exportImage(const QString& fileName, int quality = 100, bool transparent = false,
363  int dpi = 0, const QSizeF& customSize = QSizeF (),
364  int unit = FrameWidget::Pixel, double fontsFactor = 1.0, int compression = 0);
365 
366  void draw(QPaintDevice *, const QSize& size, double fontsFactor = 1.0);
367  static QSize customPrintSize(const QSizeF& customSize, int unit, int dpi);
369 
370  void updatePlot();
371 
373 
374  ErrorBarsCurve* addErrorBars(const QString& xColName, const QString& yColName, Table *errTable,
375  const QString& errColName, int type = 1, double width = 1, int cap = 8, const QColor& color = QColor(Qt::black),
376  bool through = true, bool minus = true, bool plus = true);
377 
378  ErrorBarsCurve* addErrorBars(const QString& yColName, Table *errTable, const QString& errColName,
379  int type = 1, double width = 1, int cap = 8, const QColor& color = QColor(Qt::black),
380  bool through = true, bool minus = true, bool plus = true);
381 
382  ErrorBarsCurve* addErrorBars(DataCurve *c, Table *errTable, const QString& errColName,
383  int type = 1, double width = 1, int cap = 8, const QColor& color = QColor(Qt::black),
384  bool through = true, bool minus = true, bool plus = true);
385 
386  void updateErrorBars(ErrorBarsCurve *er, bool xErr, double width, int cap, const QColor& c, bool plus, bool minus, bool through);
388  void loadErrorBars(QList<ErrorBarsCurve *> errBars, QList<int> mcIndexes);
389 
393  DataCurve* masterCurve(const QString& xColName, const QString& yColName);
395 
397 
398  bool mousePressed(QEvent *);
399  void contextMenuEvent(QContextMenuEvent *);
400  void closeEvent(QCloseEvent *e);
401  bool focusNextPrevChild ( bool next );
403 
405  void invertScale(int axis);
406  void setScale(int axis, double start, double end, double step = 0.0,
407  int majorTicks = 5, int minorTicks = 5, int type = 0, bool inverted = false,
408  double left_break = -DBL_MAX, double right_break = DBL_MAX, int pos = 50,
409  double stepBeforeBreak = 0.0, double stepAfterBreak = 0.0, int minTicksBeforeBreak = 4,
410  int minTicksAfterBreak = 4, bool log10AfterBreak = false, int breakWidth = 4, bool breakDecoration = true);
411  double axisStep(int axis){return d_user_step[axis];};
412  void setAxisStep(int axis, double step){d_user_step[axis] = step;};
413  void setCanvasCoordinates(const QRectF&);
414 
416 
417  CurveLayout initCurveLayout(int style, int curves = 0, bool guessLayout = true);
418  static CurveLayout initCurveLayout();
419  void updateCurveLayout(PlotCurve* c, const CurveLayout *cL);
421  void guessUniqueCurveLayout(int& colorIndex, int& symbolIndex);
423 
425 
426  void zoomed (const QwtDoubleRect &);
427  void zoom(bool on);
428  void zoomOut();
429  bool zoomOn();
431 
432  void setAutoScale();
433  void updateScale();
434 
436 
437  QString saveToString(bool saveAsTemplate = false);
438  QString saveScale();
439  QString saveScaleTitles();
440  QString saveFonts();
441  QString saveMarkers();
442  QString saveCurveLayout(int index);
443  QString saveAxesTitleColors();
444  QString saveAxesColors();
445  QString saveEnabledAxes();
446  QString saveCanvas();
447  QString saveTitle();
448  QString saveAxesTitleAlignement();
449  QString saveEnabledTickLabels();
450  QString saveTicksType();
451  QString saveCurves();
452  QString saveLabelsFormat();
453  QString saveLabelsRotation();
454  QString saveAxesLabelsType();
455  QString saveAxesBaseline();
456  QString saveAxesFormulas();
457  QString saveAxesBackbones();
458  QString saveTickLabelsSpace();
459  QString saveLabelsPrefixAndSuffix();
460  QString saveBackgroundImage();
461  void restoreBackgroundImage(const QStringList& lst);
462  void restoreSymbolImage(int index, const QStringList& lst);
463  static QString rgbaName(const QColor& color);
465 
467 
470  LegendWidget* insertText(const QStringList& list, int fileVersion);
471 
473  void removeLegendItem(int index);
474  void insertLegend(const QStringList& lst, int fileVersion);
475 
476  LegendWidget* newLegend(const QString& text = QString());
478  QString legendText(bool layerSpec = false, int fromIndex = 0);
480 
482 
483  LegendWidget* legend();
484  void setLegend(const QString&);
485  void removeLegend();
487 
489 
491  void remove(ArrowMarker* arrow);
492 
494  void addArrow(QStringList list, int fileVersion);
495  QList<ArrowMarker *> arrowsList(){return d_lines;};
496  int numArrows(){return d_lines.count();};
497 
499  void drawLine(bool on, bool arrow = false);
500  bool drawArrow(){return drawArrowOn;};
501  bool drawLineActive(){return drawLineOn;};
502  bool arrowMarkerSelected();
504 
506 
508  ImageWidget* addImage(const QString& fileName);
509  ImageWidget* addImage(const QImage& image);
510 
511  void insertImageMarker(const QStringList& lst, int fileVersion);
512  bool imageMarkerSelected();
514 
516 
517  void removeMarker();
519  void updateMarkersBoundingRect(bool rescaleEvent = true);
520 
527  void setSelectedArrow(ArrowMarker* mrk, bool add = false);
529  bool markerSelected();
531  void deselectMarker();
533 
535 
536  QwtScaleWidget* currentScale();
537  QwtScaleWidget* selectedScale();
538  QRect axisTitleRect(const QwtScaleWidget *scale);
539  bool axisTitleSelected();
540 
541  ScaleDraw::ScaleType axisType(int axis);
542 
543  void setXAxisTitle(const QString& text);
544  void setYAxisTitle(const QString& text);
545  void setRightAxisTitle(const QString& text);
546  void setTopAxisTitle(const QString& text);
547 
548  QString axisTitleString(int axis);
549  void setAxisTitleString(int axis, const QString& text);
550  void setAxisTitle(int axis, const QString& text);
551  void updateAxesTitles();
552  void updateAxisTitle(int axis);
554  void setScaleTitle(int axis, const QString& text);
555 
556  QFont axisTitleFont(int axis);
557  void setAxisTitleFont(int axis,const QFont &fnt);
558 
559  void setAxisFont(int axis, const QFont &fnt);
560  void initFonts(const QFont &scaleTitleFnt,const QFont &numbersFnt);
561 
562  QColor axisTitleColor(int axis);
563  void setAxisTitleColor(int axis, const QColor& c);
564 
565  int axisTitleAlignment (int axis);
566  void setAxisTitleAlignment(int axis, int align);
567 
568  int axisTitleDistance(int axis);
569  void setAxisTitleDistance(int axis, int dist);
570 
571  QColor axisColor(int axis);
572  void setAxisColor(int axis, const QColor& color);
573 
574  QColor axisLabelsColor(int axis);
575  void setAxisLabelsColor(int axis, const QColor& color);
576 
577  void showAxis(int axis, int type, const QString& formatInfo, Table *table, bool axisOn,
578  int majTicksType, int minTicksType, bool labelsOn, const QColor& c, int format,
579  int prec, int rotation, int baselineDist, const QString& formula, const QColor& labelsColor,
580  int spacing = 4, bool backbone = true, const ScaleDraw::ShowTicksPolicy& showTicks = ScaleDraw::ShowAll,
581  const QString& prefix = QString::null, const QString& suffix = QString::null);
582 
583  void enableAxis(int axis, bool on = true);
584  void enableAxisLabels(int axis, bool on = true);
585 
586  int labelsRotation(int axis);
587  void setAxisLabelRotation(int axis, int rotation);
588 
590  void loadAxesLinewidth(int width);
591 
592  void drawAxesBackbones(bool yes);
595  void loadAxesOptions(const QStringList& lst);
596 
597  void setAxisMargin(int axis, int margin);
598 
599  void setMajorTicksType(const QList<int>& lst);
600  void setMajorTicksType(const QStringList& lst);
601 
602  void setMinorTicksType(const QList<int>& lst);
603  void setMinorTicksType(const QStringList& lst);
604 
605  void setAxisTicksLength(int axis, int majTicksType, int minTicksType, int minLength, int majLength);
606  void setTicksLength(int minLength, int majLength);
607  void changeTicksLength(int minLength, int majLength);
609  void setLabelsNumericFormat(const QStringList& l);
610  void setLabelsNumericFormat(int axis, int format, int prec = 6, const QString& formula = QString());
611  void setLabelsDateTimeFormat(int axis, int type, const QString& formatInfo);
612  void setLabelsDayFormat(int axis, int format);
613  void setLabelsMonthFormat(int axis, int format);
614  void recoverObsoleteDateTimeScale(int axis, int type, const QString& origin, const QString& format);
615 
616  QString axisFormatInfo(int axis);
617 
618  void setLabelsTextFormat(int axis, int type, const QString& name, const QStringList& lst);
619  void setLabelsTextFormat(int axis, int type, const QString& labelsColName, Table *table);
620 
621  QString axisFormula(int axis);
622  void setAxisFormula(int axis, const QString &);
624 
626 
627  void setCanvasFrame(int width = 1, const QColor& color = QColor(Qt::black));
628  QColor canvasFrameColor();
629  int canvasFrameWidth();
631 
633 
635  void setCanvasBackgroundImage (const QString & fn = QString(), bool update = true);
636  QPixmap backgroundPixmap(){return d_canvas_bkg_pix;};
638 
640 
641  void setTitleFont(const QFont &fnt);
642  void setTitleColor(const QColor &c);
643  void setTitleAlignment(int align);
644 
645  bool titleSelected();
646  void selectTitle(bool select = true);
648  void clearTitle();
650  void removeTitle();
651  void initTitle( bool on, const QFont& fnt);
653 
654  void disableTools();
656  QPointer<ImageProfilesTool> imageProfilesTool(){return d_image_profiles_tool;}
657 
664  bool enableRangeSelectors(const QObject *status_target=NULL, const char *status_slot="");
665  bool rangeSelectorsEnabled();
666  QPointer<RangeSelectorTool> rangeSelectorTool(){return d_range_selector;};
668 
669  void setFrame(int width = 1, const QColor& color = Qt::black);
670  void setBackgroundColor(const QColor& color);
672 
673  void addFitCurve(QwtPlotCurve *c);
674  void deleteFitCurves();
675  QList<QwtPlotCurve *> fitCurvesList(){return d_fit_curves;};
680  int range(const QString& curveTitle, double *start, double *end);
685  int range(QwtPlotCurve *c, double *start, double *end);
686 
688  void setBarsGap(int curve, int gapPercent, int offset);
689 
691 
692  void modifyFunctionCurve(int curve, int type, const QStringList &formulas, const QString &var,
693  double start, double end, int points, const QMap<QString, double>& constants);
694  FunctionCurve* addFunction(const QStringList &formulas, double start, double end, int points = 100, const QString &var = "x", int type = 0, const QString& title = QString::null);
696  FunctionCurve* insertFunctionCurve(const QString& formula, int points, int fileVersion);
697 
699  QString generateFunctionName(const QString& name = tr("F"));
701 
703  void createTable(const QString& curveName);
704  void createTable(const QwtPlotCurve* curve);
705  void activateGraph();
706 
708 
709  VectorCurve* plotVectors(Table* w, const QStringList& colList, int style, int startRow = 0, int endRow = -1);
710  void updateVectorsLayout(int curve, const QColor& color, double width, int arrowLength, int arrowAngle, bool filled, int position,
711  const QString& xEndColName = QString(), const QString& yEndColName = QString());
713 
715 
716  BoxCurve* openBoxDiagram(Table *w, const QStringList& l, int fileVersion);
717  void plotBox(Table *w, const QStringList& names, int startRow = 0, int endRow = -1);
718  BoxCurve * boxCurve(int index);
720 
722 
723  void resizeEvent(QResizeEvent *e);
724  void scaleFonts(double factor);
726 
727  void notifyChanges();
728 
729  void updateSecondaryAxis(int axis, bool changeFormat = false);
730  int oppositeAxis(int axis);
731  void updateOppositeScaleDiv(int axis);
732 
734  void enableAutoscaling(bool on = true){d_auto_scale = on;};
735 
737  void setAutoscaleFonts(bool on = true){autoScaleFonts = on;};
738 
739  static int obsoleteSymbolStyle(int type);
740  static QString penStyleName(Qt::PenStyle style);
741  static Qt::PenStyle getPenStyle(const QString& s);
742  static Qt::PenStyle getPenStyle(int style);
743  static void showPlotErrorMessage(QWidget *parent, const QStringList& emptyColumns);
744 
745  void showTitleContextMenu();
746  void copyTitle();
747  void cutTitle();
748 
749  void clearAxisTitle();
750  void removeAxisTitle();
751  void cutAxisTitle();
752  void copyAxisTitle();
753  void showAxisTitleMenu();
754  void showAxisContextMenu(int axis);
755  void hideSelectedAxis();
756  void showGrids();
757 
759  void showGrid();
761  void showGrid(int axis);
762  void setGridOnTop(bool on = true, bool update = true);
763  bool hasGridOnTop(){return d_grid_on_top;}
764 
765  void showAxisDialog();
766  void showScaleDialog();
767 
773  void restoreSpectrogram(ApplicationWindow *app, const QStringList& lst);
777  QwtHistogram* restoreHistogram(Matrix *m, const QStringList& l);
778 
779  bool antialiasing(){return d_antialiasing;};
781  void setAntialiasing(bool on = true, bool update = true);
782 
783  void disableCurveAntialiasing(bool disable, int maxPoints);
784  bool isCurveAntialiasingEnabled(QwtPlotItem *it);
787 
788  void setCurrentColor(const QColor& c);
789  void notifyColorChange(const QColor& c){emit currentColorChanged(c);};
790  void setCurrentFont(const QFont& f);
791  void notifyFontChange(const QFont& f){emit currentFontChanged(f);};
792  void enableTextEditor();
793 
794  void showMissingDataGap(bool on = true, bool update = true);
796 
798 
802  void setWaterfallOffset(int x, int y, bool update = false);
803  void setWaterfallXOffset(int);
804  void setWaterfallYOffset(int);
805  void setWaterfallSideLines(bool on = true);
806  void setWaterfallFillColor(const QColor&);
807  void updateWaterfallFill(bool on);
809  void updateDataCurves();
810  void reverseCurveOrder();
811 
812 signals:
813  void selectedGraph(Graph*);
814  void selectedCanvas(Graph*);
815  void closedGraph();
816  void drawLineEnded(bool);
817  void cursorInfo(const QString&);
818  void showPlotDialog(int);
819 
820  void viewLineDialog();
821  void viewTitleDialog();
822  void modifiedGraph();
823  void hiddenPlot(QWidget*);
824 
825  void showContextMenu();
826  void showCurveContextMenu(QwtPlotItem *);
827  void showMarkerPopupMenu();
828 
829  void showAxisDialog(int);
830  void axisDblClicked(int);
831 
832  void showAxisTitleDialog();
833 
834  void dataRangeChanged();
835  void showFitResults(const QString&);
836  void currentFontChanged(const QFont&);
837  void currentColorChanged(const QColor&);
838  void enableTextEditor(Graph *);
839  void axisDivChanged(Graph *, int);
840  void updatedLayout(Graph *);
842 
843  private slots:
844  void selectorDeleted();
845 
846  private:
847  QString parseAxisTitle(int axis);
848  QList<FrameWidget*> stackingOrderEnrichmentsList() const;
850  QwtDoubleInterval axisBoundingInterval(int axis);
851  void deselectCurves();
852 
853  void dropEvent(QDropEvent*);
854  void dragEnterEvent(QDragEnterEvent*);
855  void showEvent (QShowEvent * event);
856  void printFrame(QPainter *painter, const QRect &rect) const;
857  void printCanvas(QPainter *painter, const QRect &canvasRect,
858  const QwtScaleMap map[axisCnt], const QwtPlotPrintFilter &pfilter) const;
859  virtual void printScale (QPainter *, int axisId, int startDist, int endDist,
860  int baseDist, const QRect &) const;
861  virtual void drawItems (QPainter *painter, const QRect &rect,
862  const QwtScaleMap map[axisCnt], const QwtPlotPrintFilter &pfilter) const;
863 
864  void drawInwardTicks(QPainter *painter, const QRect &rect,
865  const QwtScaleMap&map, int axis, bool min, bool maj) const;
866  void drawBreak(QPainter *painter, const QRect &rect, const QwtScaleMap &map, int axis) const;
867 
868  QwtPlotZoomer *d_zoomer[2];
875  QList<QwtPlotItem*> d_curves;
877  QList<QwtPlotCurve *>d_fit_curves;
891  QVector<double> d_user_step;
893  QList<ArrowMarker*> d_lines;
897  QPointer<SelectionMoveResizer> d_markers_selector;
899  QPointer<RangeSelectorTool> d_range_selector;
900  QPointer<ImageProfilesTool> d_image_profiles_tool;
909 #ifdef TEX_OUTPUT
910  bool d_is_exporting_tex;
911  bool d_tex_escape_strings;
912 #endif
913  QList<FrameWidget*> d_enrichments;
914  QwtPlotMagnifier *d_magnifier;
915  QwtPlotPanner *d_panner;
916 
921  QStringList d_axis_titles;
922 
925 
927  QRectF d_page_rect;
928 };
929 
930 class ScaledFontsPrintFilter: public QwtPlotPrintFilter
931 {
932 
933 public:
934  ScaledFontsPrintFilter(double factor){d_factor = factor;};
935  virtual QFont font(const QFont &f, Item item) const
936  {
937  if (d_factor == 1.0 || d_factor <= 0.0)
938  return f;
939 
940  if (item == Title || item == AxisScale || item == AxisTitle || item == Marker){
941  QFont fnt(f);
942  fnt.setPointSizeF(d_factor*f.pointSizeF());
943  return fnt;
944  }
945  return f;
946  }
947 
948  double scaleFontsFactor(){return d_factor;}
949 
950 private:
951  double d_factor;
952 };
953 #endif // GRAPH_H
int d_waterfall_offset_x
Definition: Graph.h:926
void setScale(int axis, double start, double end, double step=0.0, int majorTicks=5, int minorTicks=5, int type=0, bool inverted=false, double left_break=-DBL_MAX, double right_break=DBL_MAX, int pos=50, double stepBeforeBreak=0.0, double stepAfterBreak=0.0, int minTicksBeforeBreak=4, int minTicksAfterBreak=4, bool log10AfterBreak=false, int breakWidth=4, bool breakDecoration=true)
Definition: Graph.cpp:1418
QString saveAxesColors()
Definition: Graph.cpp:1030
bool hasGridOnTop()
Definition: Graph.h:763
void updateSecondaryAxis(int axis, bool changeFormat=false)
Definition: Graph.cpp:1309
void setRightAxisTitle(const QString &text)
Definition: Graph.cpp:1116
bool hasPanningMagnifierEnabled()
Definition: Graph.h:223
void drawLine(bool on, bool arrow=false)
Draws a line/arrow depending on the value of "arrow".
Definition: Graph.cpp:4156
virtual QFont font(const QFont &f, Item item) const
Definition: Graph.h:935
FunctionCurve * insertFunctionCurve(const QString &formula, int points, int fileVersion)
Used when reading from a project file with version < 0.9.5.
Definition: Graph.cpp:4261
QString saveAxesBaseline()
Definition: Graph.cpp:577
void updateDataCurves()
Definition: Graph.cpp:7499
Definition: Graph.h:135
void updateAxisTitle(int axis)
Definition: Graph.cpp:3742
void showTitleContextMenu()
Definition: Graph.cpp:4667
void select(QWidget *l, bool add=false)
Definition: Graph.cpp:361
PlotCurve * curve(const QString &title)
get curve by name
Definition: Graph.h:312
Definition: Graph.h:140
QColor lCol
line color
Definition: Graph.h:81
void setAxisTitleFont(int axis, const QFont &fnt)
Definition: Graph.cpp:976
DataCurve * masterCurve(ErrorBarsCurve *er)
Returns a valid master curve for the error bars curve.
Definition: Graph.cpp:5854
bool mousePressed(QEvent *)
Definition: Graph.cpp:7368
QRectF pageGeometry()
Definition: Graph.h:242
void showCurveContextMenu(QwtPlotItem *)
void updateCurveLayout(PlotCurve *c, const CurveLayout *cL)
Definition: Graph.cpp:3199
void updateVectorsLayout(int curve, const QColor &color, double width, int arrowLength, int arrowAngle, bool filled, int position, const QString &xEndColName=QString(), const QString &yEndColName=QString())
Definition: Graph.cpp:3701
void setLabelsNumericFormat(const QStringList &l)
Used for restoring project files.
Definition: Graph.cpp:509
void setTitleFont(const QFont &fnt)
Definition: Graph.cpp:1093
void deselect()
Definition: Graph.cpp:1999
QPointer< ImageProfilesTool > imageProfilesTool()
Definition: Graph.h:656
void modifyFunctionCurve(int curve, int type, const QStringList &formulas, const QString &var, double start, double end, int points, const QMap< QString, double > &constants)
Definition: Graph.cpp:4164
int curveCount()
Definition: Graph.h:298
bool rangeSelectorsEnabled()
Definition: Graph.cpp:7086
void deleteFitCurves()
Definition: Graph.cpp:5309
An MDI window (MdiSubWindow) managing one or more Graph objects.
Definition: MultiLayer.h:64
void setActiveTool(PlotToolInterface *tool)
Change the active tool, deleting the old one if it exists.
Definition: Graph.cpp:5172
bool axisTitleSelected()
Definition: Graph.cpp:5910
bool zoomOn()
Definition: Graph.cpp:3991
ScalePicker * scalePicker
Definition: Graph.h:870
void drawBreak(QPainter *painter, const QRect &rect, const QwtScaleMap &map, int axis) const
Definition: Graph.cpp:6332
void setCanvasCoordinates(const QRectF &)
Definition: Graph.cpp:1500
void raiseEnrichements()
Definition: Graph.cpp:7023
LegendWidget * insertText(const QStringList &list, int fileVersion)
Used when opening a project file.
Definition: Graph.cpp:2805
void reloadCurvesData()
Definition: Graph.cpp:2199
void print()
Definition: Graph.cpp:1768
void updateMarkersBoundingRect(bool rescaleEvent=true)
Keep the markers on screen each time the scales are modified by adding/removing curves.
Definition: Graph.cpp:4468
void removeCurve(QwtPlotItem *it)
Definition: Graph.cpp:3842
void insertMarker(QwtPlotMarker *m)
Definition: Graph.cpp:6465
QString saveMarkers()
Definition: Graph.cpp:2952
QStringList analysableCurvesList()
Returns the names of all the curves suitable for data analysis, as a string list. The list excludes e...
Definition: Graph.cpp:1506
void enableTextEditor()
Definition: Graph.cpp:310
QList< ArrowMarker * > arrowsList()
Definition: Graph.h:495
Vector curve class.
Definition: VectorCurve.h:38
void deselectCurves()
Definition: Graph.cpp:2009
void contextMenuEvent(QContextMenuEvent *)
Definition: Graph.cpp:3964
void updateOppositeScaleDiv(int axis)
Definition: Graph.cpp:1363
void setCurveLineWidth(int curveIndex, double width)
Definition: Graph.cpp:5723
QString legendText(bool layerSpec=false, int fromIndex=0)
Creates a new legend text using the curves titles.
Definition: Graph.cpp:2075
Definition: Graph.h:137
void setAxisTitleColor(int axis, const QColor &c)
Definition: Graph.cpp:2444
QwtPlotPanner * d_panner
Definition: Graph.h:915
Definition: Graph.h:132
void removeCurves(const QString &s)
Removes all curves defined by the title/plot association string s.
Definition: Graph.cpp:3810
bool drawLineOn
Definition: Graph.h:883
void restoreBackgroundImage(const QStringList &lst)
Definition: Graph.cpp:4450
void insertImageMarker(const QStringList &lst, int fileVersion)
Definition: Graph.cpp:4129
void insertLegend(const QStringList &lst, int fileVersion)
Definition: Graph.cpp:2799
Definition: Graph.h:140
bool isWaterfallPlot()
Definition: Graph.h:799
QwtDoubleInterval axisBoundingInterval(int axis)
Finds bounding interval of the plot data.
Definition: Graph.cpp:1393
int curveIndex(const QString &title)
map curve title to index
Definition: Graph.h:306
bool d_antialiasing
Render hint for plot items.
Definition: Graph.h:879
FrameWidget * add(FrameWidget *fw, bool copy=true)
Definition: Graph.cpp:6967
void showAxisDialog()
Definition: Graph.cpp:4755
Definition: Graph.h:137
A 2D-plotting widget.
Definition: Graph.h:123
void drawInwardTicks(QPainter *painter, const QRect &rect, const QwtScaleMap &map, int axis, bool min, bool maj) const
Definition: Graph.cpp:6176
PlotToolInterface * d_peak_fit_tool
Definition: Graph.h:902
QList< FrameWidget * > d_enrichments
Definition: Graph.h:913
Definition: Graph.h:131
void updateAxesTitles()
Definition: Graph.cpp:3736
VectorCurve * plotVectors(Table *w, const QStringList &colList, int style, int startRow=0, int endRow=-1)
Definition: Graph.cpp:3674
void setMajorTicksType(int axis, int type)
Definition: Graph.cpp:6496
Definition: Graph.h:132
QString curveRange(QwtPlotCurve *c)
returns the curve range information as a string: "curve_name [start:end]"
Definition: Graph.cpp:1524
QColor canvasFrameColor()
Definition: Graph.cpp:2221
void showMarkerPopupMenu()
int sType
symbol type (shape)
Definition: Graph.h:91
void selectCanvas()
Definition: Graph.cpp:278
void axisDivChanged(Graph *, int)
FrameWidget * activeEnrichment()
Definition: Graph.h:157
void setLegend(const QString &)
Definition: Graph.cpp:2746
void setIndexedColors()
Definition: Graph.cpp:5798
double d_Douglas_Peuker_tolerance
Definition: Graph.h:917
void insertPlotItem(QwtPlotItem *i, int type)
Definition: Graph.cpp:3394
Error bars curve.
Definition: ErrorBarsCurve.h:36
bool hasSeletedItems()
Definition: Graph.cpp:402
double getDouglasPeukerTolerance()
Definition: Graph.h:234
double d_factor
Definition: Graph.h:951
void printCanvas(QPainter *painter, const QRect &canvasRect, const QwtScaleMap map[axisCnt], const QwtPlotPrintFilter &pfilter) const
Definition: Graph.cpp:6081
bool d_synchronize_scales
Definition: Graph.h:920
Definition: Graph.h:137
void cutTitle()
Definition: Graph.cpp:4679
LegendWidget * addTimeStamp()
Definition: Graph.cpp:2788
int oppositeAxis(int axis)
Definition: Graph.cpp:1343
QPixmap d_canvas_bkg_pix
Definition: Graph.h:924
LegendWidget * addText(LegendWidget *)
Definition: Graph.cpp:2942
int visibleCurves()
Definition: Graph.cpp:5895
void setActiveText(LegendWidget *l)
Definition: Graph.h:154
int sSize
symbol size
Definition: Graph.h:90
Handles parts of the user interaction for a Plot by registering itself as an event filter for its Qwt...
Definition: CanvasPicker.h:40
QColor axisLabelsColor(int axis)
Definition: Graph.cpp:1066
void setSynchronizedScaleDivisions(bool on)
Definition: Graph.h:240
void setTitleColor(const QColor &c)
Definition: Graph.cpp:1075
void setAxisTitleAlignment(int axis, int align)
Definition: Graph.cpp:1135
ImageWidget * addImage(ImageWidget *i)
Definition: Graph.cpp:4093
QString saveLabelsPrefixAndSuffix()
Definition: Graph.cpp:617
void setLabelsTextFormat(int axis, int type, const QString &name, const QStringList &lst)
Definition: Graph.cpp:857
Draws lines and arrows on a QwtPlot.
Definition: ArrowMarker.h:43
double filledArea
flag: toggles area filling under curve; if > 0 it containts the alphaF value of the brush color ...
Definition: Graph.h:84
void showScaleDialog()
Definition: Graph.cpp:4762
void removeLegend()
Definition: Graph.cpp:2755
double axisStep(int axis)
Definition: Graph.h:411
void zoom(bool on)
Definition: Graph.cpp:4005
LegendDisplayMode
Definition: Graph.h:139
QString saveTitle()
Definition: Graph.cpp:2471
Definition: Graph.h:135
void setPageGeometry(const QRectF &r)
Definition: Graph.h:243
void notifyChanges()
Definition: Graph.cpp:273
void exportVector(const QString &fileName, int res=0, bool color=true, const QSizeF &customSize=QSizeF(), int unit=FrameWidget::Pixel, double fontsFactor=1.0)
Definition: Graph.cpp:1752
Definition: Graph.h:140
bool isCurveAntialiasingDisabled()
Definition: Graph.h:785
QString parseAxisTitle(int axis)
Definition: Graph.cpp:1180
QPointer< ImageProfilesTool > d_image_profiles_tool
Definition: Graph.h:900
Spectrogram * plotSpectrogram(Matrix *m, CurveType type)
Add a spectrogram to the graph.
Definition: Graph.cpp:5333
double scaleFontsFactor()
Definition: Graph.h:948
void copyAxisTitle()
Definition: Graph.cpp:4712
PlotToolInterface * activeTool() const
Return the active tool, or NULL if none is active.
Definition: Graph.h:148
void updateWaterfallFill(bool on)
Definition: Graph.cpp:7432
Definition: Graph.h:136
Definition: Grid.h:36
void removeTitle()
Sets title to an empty string and hides the text label.
Definition: Graph.cpp:2059
Definition: Graph.h:132
PlotToolInterface * d_active_tool
The currently active tool, or NULL for default (pointer).
Definition: Graph.h:902
void copyCurves(Graph *g)
Definition: Graph.cpp:4938
void drawAxesBackbones(bool yes)
Definition: Graph.cpp:2247
void removeAxisTitle()
Definition: Graph.cpp:4690
Definition: TexWidget.h:35
void showAxisTitleDialog()
Definition: Graph.h:137
QRect axisTitleRect(const QwtScaleWidget *scale)
Definition: Graph.cpp:5920
void enablePanningMagnifier(bool on=true, int mode=0)
Definition: Graph.cpp:4036
Definition: Graph.h:136
bool isMissingDataGapEnabled()
Definition: Graph.h:795
static QSize customPrintSize(const QSizeF &customSize, int unit, int dpi)
Definition: Graph.cpp:7060
void guessUniqueCurveLayout(int &colorIndex, int &symbolIndex)
Tries to guess not already used curve color and symbol style.
Definition: Graph.cpp:5249
Definition: Spectrogram.h:46
Definition: Graph.h:137
void enableAxisLabels(int axis, bool on=true)
Definition: Graph.cpp:644
Definition: ScreenPickerTool.h:101
void setGrayScale()
Definition: Graph.cpp:5735
void printFrame(QPainter *painter, const QRect &rect) const
Definition: Graph.cpp:6028
void updatedLayout(Graph *)
static int obsoleteSymbolStyle(int type)
Definition: Graph.cpp:4640
void disableImageProfilesTool()
Definition: Graph.cpp:5221
Definition: TitlePicker.h:34
ScaledFontsPrintFilter(double factor)
Definition: Graph.h:934
Definition: Graph.h:139
void setAxisFont(int axis, const QFont &fnt)
Definition: Graph.cpp:468
void setXAxisTitle(const QString &text)
Definition: Graph.cpp:1109
Definition: Graph.h:136
void hiddenPlot(QWidget *)
int canvasFrameWidth()
Definition: Graph.cpp:2227
QString axisFormula(int axis)
Definition: Graph.cpp:6007
int axisTitleDistance(int axis)
Definition: Graph.cpp:1142
void axisLabelFormat(int axis, char &f, int &prec) const
Definition: Graph.cpp:6553
void setCurveStyle(int index, int s)
Definition: Graph.cpp:5098
void copyScaleDraw(Graph *g, int i)
Definition: Graph.cpp:4831
void cursorInfo(const QString &)
int waterfallXOffset()
Definition: Graph.h:800
Definition: Graph.h:135
void setCurrentColor(const QColor &c)
Definition: Graph.cpp:5965
void setLabelsMonthFormat(int axis, int format)
Definition: Graph.cpp:849
AxisTitlePolicy
Definition: Graph.h:140
void selectTitle(bool select=true)
Definition: Graph.cpp:2041
Definition: Graph.h:134
QPointer< RangeSelectorTool > rangeSelectorTool()
Definition: Graph.h:666
const QColor & paletteBackgroundColor() const
Definition: Graph.cpp:6634
void restoreSymbolImage(int index, const QStringList &lst)
Definition: Graph.cpp:2656
Structure containing curve layout parameters.
Definition: Graph.h:80
Definition: ImageWidget.h:37
void setBarsGap(int curve, int gapPercent, int offset)
Used for VerticalBars, HorizontalBars and Histograms.
Definition: Graph.cpp:3785
bool addCurves(Table *w, const QStringList &names, int style=0, double lWidth=1, int sSize=3, int startRow=0, int endRow=-1)
Definition: Graph.cpp:3404
QwtPlotMagnifier * magnifyTool()
Definition: Graph.h:224
int numArrows()
Definition: Graph.h:496
void changeTicksLength(int minLength, int majLength)
Definition: Graph.cpp:732
virtual void printScale(QPainter *, int axisId, int startDist, int endDist, int baseDist, const QRect &) const
Paint a scale into a given rectangle. Paint the scale into a given rectangle (modified code from Qwt)...
Definition: Graph.cpp:7105
int minorTickLength() const
Definition: Graph.cpp:6386
QwtPlotMagnifier * d_magnifier
Definition: Graph.h:914
bool drawArrow()
Definition: Graph.h:500
AxisTitlePolicy d_axis_title_policy
Definition: Graph.h:919
bool imageMarkerSelected()
Definition: Graph.cpp:1991
void showAxisContextMenu(int axis)
Definition: Graph.cpp:4732
QList< QwtPlotCurve * > fitCurvesList()
Definition: Graph.h:675
QColor fillCol
symbol fill color
Definition: Graph.h:88
FunctionCurve * addFunction(const QStringList &formulas, double start, double end, int points=100, const QString &var="x", int type=0, const QString &title=QString::null)
Definition: Graph.cpp:4234
QColor symCol
symbol outline color
Definition: Graph.h:87
void changeCurveIndex(int fromIndex, int toIndex)
Definition: Graph.cpp:7257
void addFitCurve(QwtPlotCurve *c)
Definition: Graph.cpp:5303
ArrowMarker * d_selected_arrow
Pointer to the currently selected line/image.
Definition: Graph.h:895
void restoreCurveLabels(int curveID, const QStringList &lst)
Used when restoring DataCurve curveID from a project file.
Definition: Graph.cpp:5501
int maxAntialisingSize()
Definition: Graph.h:786
static CurveLayout initCurveLayout()
Definition: Graph.cpp:3101
QString saveAxesFormulas()
Definition: Graph.cpp:2390
void addLegendItem()
Definition: Graph.cpp:3948
TitlePicker * titlePicker
Definition: Graph.h:869
QString saveLabelsRotation()
Definition: Graph.cpp:634
Definition: Graph.h:138
#define min(a, b)
Definition: ShapiroWilkTest.cpp:36
Handler for modifying one or more QWidget and/or QwtPlotMarker with mouse or keyboard.
Definition: SelectionMoveResizer.h:89
int speedModeMaxPoints()
Definition: Graph.h:233
double selectedXStartValue()
Definition: Graph.cpp:2984
void clearTitle()
Sets the title to an "almost empty" string: " ", thus keeping the QwtText object visible.
Definition: Graph.cpp:2053
Definition: Graph.h:139
QPixmap graphPixmap(const QSize &size=QSize(), double scaleFontsFactor=1.0, bool transparent=false)
Definition: Graph.cpp:1581
QPointer< SelectionMoveResizer > selectionMoveResizer()
Definition: Graph.h:166
QwtHistogram * restoreHistogram(Matrix *m, const QStringList &l)
Restores a histogram from a project file.
Definition: Graph.cpp:3657
bool d_auto_scale
Flag indicating if the axes limits should be changed in order to show all data each time a curva data...
Definition: Graph.h:906
void setLabelsDateTimeFormat(int axis, int type, const QString &formatInfo)
Definition: Graph.cpp:899
int range(const QString &curveTitle, double *start, double *end)
Definition: Graph.cpp:3059
LegendWidget * newLegend(const QString &text=QString())
Definition: Graph.cpp:2760
QFont axisTitleFont(int axis)
Definition: Graph.cpp:985
FunctionCurve * functionCurve(int index)
Definition: Graph.cpp:3031
void setTicksLength(int minLength, int majLength)
Definition: Graph.cpp:723
Grid * d_grid
Pointer to the grid.
Definition: Graph.h:873
void plotBox(Table *w, const QStringList &names, int startRow=0, int endRow=-1)
Definition: Graph.cpp:5055
LegendWidget * legend()
Definition: Graph.cpp:2736
ArrowMarker * addArrow(ArrowMarker *mrk)
Definition: Graph.cpp:2920
Pie plot class.
Definition: PieCurve.h:36
int majorTickLength() const
Definition: Graph.cpp:6391
void updateLayout()
Adjust plot content to its current size. Must be reimplemented because the base implementation adds a...
Definition: Graph.cpp:6568
void setAxisLabelsColor(int axis, const QColor &color)
Definition: Graph.cpp:999
void setCanvasGeometry(const QRect &canvasRect)
Adjust plot content to its canvas size.
Definition: Graph.cpp:6600
bool titleSelected()
Definition: Graph.cpp:2036
void viewLineDialog()
Graph(int x=0, int y=0, int width=500, int height=400, QWidget *parent=0, Qt::WFlags f=0)
Definition: Graph.cpp:116
Definition: Graph.h:139
void setAxisTitleDistance(int axis, int dist)
Definition: Graph.cpp:1150
void removeLegendItem(int index)
Definition: Graph.cpp:3886
void updateScale()
Definition: Graph.cpp:3762
QString canvasBackgroundFileName()
Definition: Graph.h:634
void selectorDeleted()
Definition: Graph.cpp:355
QRectF d_page_rect
Definition: Graph.h:927
Definition: FrameWidget.h:38
void showGrid()
Convenience function enabling the grid for QwtScaleDraw::Left and Bottom Scales.
Definition: Graph.cpp:4786
PlotCurve * curve(int index)
get curve by index
Definition: Graph.cpp:3009
QString generateFunctionName(const QString &name=tr("F"))
Returns an unique function name.
Definition: Graph.cpp:4214
QwtPlotItem * closestCurve(int xpos, int ypos, int &dist, int &point)
Definition: Graph.cpp:6405
Definition: Graph.h:138
QList< QwtPlotCurve * > d_fit_curves
List storing pointers to the curves resulting after a fit session, in case the user wants to delete t...
Definition: Graph.h:877
bool antialiasing()
Definition: Graph.h:779
void exportTeX(const QString &fname, bool color=true, bool escapeStrings=true, bool fontSizes=true, const QSizeF &customSize=QSizeF(), int unit=FrameWidget::Pixel, double fontsFactor=1.0)
Definition: Graph.cpp:1893
QtiPlot&#39;s main window.
Definition: ApplicationWindow.h:133
int aStyle
area filling style
Definition: Graph.h:86
void setTitleAlignment(int align)
Definition: Graph.cpp:1084
void showGrids()
Definition: Graph.cpp:4781
int lStyle
line style
Definition: Graph.h:83
Definition: Graph.h:132
void notifyColorChange(const QColor &c)
Definition: Graph.h:789
void dataRangeChanged()
static void showPlotErrorMessage(QWidget *parent, const QStringList &emptyColumns)
Definition: Graph.cpp:4648
void viewTitleDialog()
QString axisTitleString(int axis)
Definition: Graph.cpp:1286
int axesLinewidth() const
Definition: Graph.cpp:6376
Ticks
Definition: Graph.h:133
QList< ArrowMarker * > d_lines
Arrows/lines on plot.
Definition: Graph.h:893
Definition: Graph.h:133
int curveIndex(QwtPlotItem *c)
Map curve pointer to index.
Definition: Graph.h:304
int connectType
symbol connection type
Definition: Graph.h:92
bool hasSynchronizedScaleDivisions()
Definition: Graph.h:239
QString saveEnabledAxes()
Definition: Graph.cpp:2211
QList< FrameWidget * > increasingAreaEnrichmentsList()
Definition: Graph.cpp:340
Definition: Graph.h:134
Definition: FunctionCurve.h:37
void recoverObsoleteDateTimeScale(int axis, int type, const QString &origin, const QString &format)
Definition: Graph.cpp:923
static Qt::PenStyle getPenStyle(const QString &s)
Definition: Graph.cpp:4626
void removePie()
Definition: Graph.cpp:3798
int labelsRotation(int axis)
Definition: Graph.cpp:970
void dropEvent(QDropEvent *)
Definition: Graph.cpp:7286
Definition: LegendWidget.h:42
double selectedXEndValue()
Definition: Graph.cpp:2992
Definition: Graph.h:135
QString saveAxesTitleColors()
Definition: Graph.cpp:2454
void draw(QPaintDevice *, const QSize &size, double fontsFactor=1.0)
Definition: Graph.cpp:1857
Histogram class.
Definition: QwtHistogram.h:34
void zoomOut()
Definition: Graph.cpp:4025
void updateCurveNames(const QString &oldName, const QString &newName, bool updateTableName=true)
Definition: Graph.cpp:5661
void exportSVG(const QString &fname, const QSizeF &customSize=QSizeF(), int unit=FrameWidget::Pixel, double fontsFactor=1.0)
Definition: Graph.cpp:1838
void setAxesLinewidth(int width)
Definition: Graph.cpp:2297
float lWidth
line width
Definition: Graph.h:82
Definition: Graph.h:132
QList< QwtPlotItem * > curvesList()
Definition: Graph.h:173
QColor axisTitleColor(int axis)
Definition: Graph.cpp:990
void setCurvesList(QList< QwtPlotItem * > lst)
Definition: Graph.h:174
void setAxisTicksLength(int axis, int majTicksType, int minTicksType, int minLength, int majLength)
Definition: Graph.cpp:695
QString savePieCurveLayout()
Definition: Graph.cpp:2537
Definition: ScaleDraw.h:48
QList< FrameWidget * > stackingOrderEnrichmentsList() const
Definition: Graph.cpp:7352
void showContextMenu()
void copyScaleWidget(Graph *g, int i)
Definition: Graph.cpp:4810
Matrix worksheet class.
Definition: Matrix.h:57
QList< FrameWidget * > enrichmentsList()
Definition: Graph.h:158
BoxCurve * boxCurve(int index)
Definition: Graph.cpp:3040
Definition: PlotCurve.h:96
void resizeEvent(QResizeEvent *e)
Definition: Graph.cpp:4492
void copyTitle()
Definition: Graph.cpp:4685
bool markerSelected()
Definition: Graph.cpp:1919
bool drawArrowOn
Definition: Graph.h:883
QString saveAxesBackbones()
Definition: Graph.cpp:590
void cutAxisTitle()
Definition: Graph.cpp:4706
void closeEvent(QCloseEvent *e)
Definition: Graph.cpp:3985
void showAxis(int axis, int type, const QString &formatInfo, Table *table, bool axisOn, int majTicksType, int minTicksType, bool labelsOn, const QColor &c, int format, int prec, int rotation, int baselineDist, const QString &formula, const QColor &labelsColor, int spacing=4, bool backbone=true, const ScaleDraw::ShowTicksPolicy &showTicks=ScaleDraw::ShowAll, const QString &prefix=QString::null, const QString &suffix=QString::null)
Definition: Graph.cpp:752
void removeMarker()
Definition: Graph.cpp:1928
bool hasActiveTool()
Returns true if a plot/data tool is enabled.
Definition: Graph.cpp:5227
Definition: Graph.h:133
DataCurve * insertCurve(Table *w, const QString &name, int style, int startRow=0, int endRow=-1)
Definition: Graph.cpp:3510
QStringList curveNamesList()
Returns the names of all the QwtPlotCurve items on the plot, as a string list.
Definition: Graph.cpp:1539
void scaleFonts(double factor)
Definition: Graph.cpp:4517
bool autoscaleFonts()
Definition: Graph.h:736
QString saveAxesTitleAlignement()
Definition: Graph.cpp:2508
bool d_is_printing
Flag telling if we are performing a print operation.
Definition: Graph.h:885
int d_max_antialising_size
Definition: Graph.h:881
Definition: Graph.h:139
void setTopAxisTitle(const QString &text)
Definition: Graph.cpp:1123
QString saveCurves()
Definition: Graph.cpp:2684
Definition: Graph.h:131
void updateCurveLabels()
Definition: Graph.cpp:6639
QwtHistogram * addHistogram(Matrix *m)
Add a matrix histogram to the graph.
Definition: Graph.cpp:3640
void exportImage(const QString &fileName, int quality=100, bool transparent=false, int dpi=0, const QSizeF &customSize=QSizeF(), int unit=FrameWidget::Pixel, double fontsFactor=1.0, int compression=0)
Definition: Graph.cpp:1654
QString saveEnabledTickLabels()
Definition: Graph.cpp:557
AxisTitlePolicy axisTitlePolicy()
Definition: Graph.h:236
void selectionChanged(SelectionMoveResizer *)
Definition: Graph.h:133
void reverseCurveOrder()
Definition: Graph.cpp:7485
void disableCurveAntialiasing(bool disable, int maxPoints)
Definition: Graph.cpp:5584
Definition: Graph.h:136
void activateGraph()
Definition: Graph.cpp:284
int axisTitleAlignment(int axis)
Definition: Graph.cpp:1130
float penWidth
symbol outline width
Definition: Graph.h:89
void setAxisTitlePolicy(const AxisTitlePolicy &policy)
Definition: Graph.h:237
int waterfallYOffset()
Definition: Graph.h:801
void setWaterfallXOffset(int)
Definition: Graph.cpp:7401
bool isAutoscalingEnabled()
Definition: Graph.h:733
PieCurve * plotPie(Table *w, const QString &name, int startRow=0, int endRow=-1)
Used when creating a pie plot.
Definition: Graph.cpp:3373
QString saveTicksType()
Definition: Graph.cpp:541
void setCanvasBackgroundImage(const QString &fn=QString(), bool update=true)
Definition: Graph.cpp:6051
int d_speed_mode_points
Definition: Graph.h:918
Definition: Graph.h:132
Definition: FrameWidget.h:44
int axisLabelPrecision(int axis)
Definition: Graph.cpp:6535
Definition: Graph.h:131
void setGridOnTop(bool on=true, bool update=true)
Definition: Graph.cpp:7515
Definition: Graph.h:137
Definition: Graph.h:131
void setAxisColor(int axis, const QColor &color)
Definition: Graph.cpp:1009
Scale
Definition: Graph.h:132
void setWaterfallFillColor(const QColor &)
Definition: Graph.cpp:7470
Definition: Graph.h:133
Definition: Graph.h:136
Definition: Graph.h:140
QList< int > getMinorTicksType()
Definition: Graph.cpp:6503
QwtPlotItem * selectedCurveLabels()
Definition: Graph.cpp:2022
void setTickLength(int minLength, int majLength)
Definition: Graph.cpp:6396
void notifyFontChange(const QFont &f)
Definition: Graph.h:791
void updateCurvesData(Table *w, const QString &yColName)
Definition: Graph.cpp:2176
QString axisFormatInfo(int axis)
Definition: Graph.cpp:5653
DataCurve * dataCurve(int index)
Definition: Graph.cpp:3022
QString curveTitle(int index)
get curve title string by inde (convenience function for scripts)
Definition: Graph.cpp:3050
void showCurve(int index, bool visible=true)
Shows/Hides a curve defined by its index.
Definition: Graph.cpp:5886
void enableDouglasPeukerSpeedMode(double tolerance, int maxPoints=3000)
Definition: Graph.cpp:7322
void modifiedGraph()
void setWaterfallOffset(int x, int y, bool update=false)
Definition: Graph.cpp:7421
Grid * grid()
Definition: Graph.h:172
void showMissingDataGap(bool on=true, bool update=true)
Definition: Graph.cpp:7530
BoxCurve * openBoxDiagram(Table *w, const QStringList &l, int fileVersion)
Definition: Graph.cpp:5140
QwtScaleWidget * currentScale()
Definition: Graph.cpp:5915
QColor aCol
curve area color
Definition: Graph.h:85
QString saveLabelsFormat()
Definition: Graph.cpp:567
void setAutoScale()
Definition: Graph.cpp:3723
void enableAxis(int axis, bool on=true)
Definition: Graph.cpp:475
void setBackgroundColor(const QColor &color)
Definition: Graph.cpp:4576
QColor frameColor()
Definition: Graph.cpp:6023
CanvasPicker * cp
Definition: Graph.h:871
void setYAxisTitle(const QString &text)
Definition: Graph.cpp:1102
void showEvent(QShowEvent *event)
Definition: Graph.cpp:6650
void loadErrorBars(QList< ErrorBarsCurve * > errBars, QList< int > mcIndexes)
Used when restoring project files.
Definition: Graph.cpp:3313
QPixmap backgroundPixmap()
Definition: Graph.h:636
void setCurveFullRange(int curveIndex)
Definition: Graph.cpp:5677
Spectrogram * spectrogram(Matrix *m)
Returns a pointer to the spectrogram which data source is matrix m (the pointer can be NULL) ...
Definition: Graph.cpp:5318
void setCanvasSize(const QSize &size)
Adjust plot content to its canvas size.
Definition: Graph.cpp:6619
void updatePlot()
Definition: Graph.cpp:3750
bool isPrinting()
Definition: Graph.h:220
Definition: PlotToolInterface.h:60
void setAxisFormula(int axis, const QString &)
Definition: Graph.cpp:6016
void currentFontChanged(const QFont &)
bool drawAxesBackbone
Definition: Graph.h:883
Abstract 2D plot curve class.
Definition: PlotCurve.h:41
Definition: Graph.h:135
void loadAxesOptions(const QStringList &lst)
used when opening a project file
Definition: Graph.cpp:2269
void selectedGraph(Graph *)
void currentColorChanged(const QColor &)
Definition: Graph.h:134
void drawLineEnded(bool)
Handles user interaction with a QwtScaleWidget.
Definition: ScalePicker.h:41
void setCanvasSize(int w, int h)
Convenience function for scripts.
Definition: Graph.h:208
static QString penStyleName(Qt::PenStyle style)
Definition: Graph.cpp:4587
void copyEnrichments(Graph *g)
Definition: Graph.cpp:4870
QString saveToString(bool saveAsTemplate=false)
Definition: Graph.cpp:4345
void enableAutoscaling(bool on=true)
Definition: Graph.h:734
QStringList plotItemsList()
Returns the names of all plot items, including spectrograms, as a string list.
Definition: Graph.cpp:1549
bool axesBackbones()
Definition: Graph.h:593
int d_waterfall_offset_y
Definition: Graph.h:926
TexWidget * addTexFormula(const QString &s, const QPixmap &pix)
Definition: Graph.cpp:6959
QPointer< RangeSelectorTool > d_range_selector
The current curve selection, or NULL if none is active.
Definition: Graph.h:899
QwtScaleWidget * selectedScale()
Definition: Graph.cpp:5905
QString saveScale()
Definition: Graph.cpp:2408
void restoreSpectrogram(ApplicationWindow *app, const QStringList &lst)
Restores a spectrogram. Used when opening a project file.
Definition: Graph.cpp:5378
Definition: Graph.h:135
Axis
Definition: Graph.h:131
bool autoScaleFonts
Definition: Graph.h:882
void closedGraph()
void setAxisTitleString(int axis, const QString &text)
Definition: Graph.cpp:1294
ScaleType
Definition: ScaleDraw.h:45
QwtPlotItem * plotItem(int index)
get plotted item by index
Definition: Graph.cpp:3000
QString saveTickLabelsSpace()
Definition: Graph.cpp:600
void dragEnterEvent(QDragEnterEvent *)
Definition: Graph.cpp:7276
void setAxisStep(int axis, double step)
Definition: Graph.h:412
void updateErrorBars(ErrorBarsCurve *er, bool xErr, double width, int cap, const QColor &c, bool plus, bool minus, bool through)
Definition: Graph.cpp:3248
static QString rgbaName(const QColor &color)
Definition: Graph.cpp:2568
void zoomed(const QwtDoubleRect &)
Definition: Graph.cpp:3996
MDI window providing a spreadsheet table with column logic.
Definition: Table.h:57
Box curve.
Definition: BoxCurve.h:37
void setScaleTitle(int axis, const QString &text)
TODO: eliminate this function in version 0.9.1 (used only when restoring project files) ...
Definition: Graph.cpp:1160
void setMinorTicksType(int axis, int type)
Definition: Graph.cpp:6519
void setAutoscaleFonts(bool on=true)
Definition: Graph.h:737
void clearAxisTitle()
Definition: Graph.cpp:4698
void setSelectedArrow(ArrowMarker *mrk, bool add=false)
Set the selected arrow.
Definition: Graph.cpp:418
bool isPiePlot()
Returns true if this Graph is a pie plot, false otherwise.
Definition: Graph.cpp:3322
QString saveAxesLabelsType()
Definition: Graph.cpp:521
Definition: Graph.h:930
int d_min_tick_length
Axes tick lengths.
Definition: Graph.h:908
Definition: RangeSelectorTool.h:57
QVector< double > d_user_step
Stores the step the user specified for the four scale. If step = 0.0, the step will be calculated aut...
Definition: Graph.h:891
void setCanvasGeometry(int x, int y, int w, int h)
Convenience function for scripts.
Definition: Graph.h:205
virtual void drawItems(QPainter *painter, const QRect &rect, const QwtScaleMap map[axisCnt], const QwtPlotPrintFilter &pfilter) const
Definition: Graph.cpp:6106
QString saveBackgroundImage()
Definition: Graph.cpp:4432
void copyImage()
Definition: Graph.cpp:1560
QString saveCurveLayout(int index)
Definition: Graph.cpp:2576
void showFitResults(const QString &)
bool d_disable_curve_antialiasing
Definition: Graph.h:880
Definition: Graph.h:139
QList< QwtPlotItem * > d_curves
List storing pointers to the curves on the plot.
Definition: Graph.h:875
bool enableRangeSelectors(const QObject *status_target=NULL, const char *status_slot="")
Definition: Graph.cpp:5236
Definition: Graph.h:134
void createTable(const QString &curveName)
Provided for convenience in scripts.
Definition: Graph.cpp:4311
QwtPlotZoomer * d_zoomer[2]
Definition: Graph.h:868
void setAntialiasing(bool on=true, bool update=true)
Enables/Disables antialiasing of plot items.
Definition: Graph.cpp:5554
Definition: Graph.h:135
void initFonts(const QFont &scaleTitleFnt, const QFont &numbersFnt)
Definition: Graph.cpp:458
QList< LegendWidget * > textsList()
Definition: Graph.cpp:324
Definition: Graph.h:137
QString saveScaleTitles()
Definition: Graph.cpp:2480
QColor axisColor(int axis)
Definition: Graph.cpp:1057
void showAxisTitleMenu()
Definition: Graph.cpp:4720
void initTitle(bool on, const QFont &fnt)
Definition: Graph.cpp:2065
bool d_missing_data_gap
Flag telling if the curves line should be connected across missing data.
Definition: Graph.h:889
Definition: Graph.h:139
ShowTicksPolicy
Definition: ScaleDraw.h:48
QString pieLegendText()
Definition: Graph.cpp:2157
void setCurveLineColor(int curveIndex, int colorIndex)
Definition: Graph.cpp:5687
void setLabelsDayFormat(int axis, int format)
Definition: Graph.cpp:841
void setAxisLabelRotation(int axis, int rotation)
Definition: Graph.cpp:950
MarkerType
Definition: Graph.h:134
void exportToFile(const QString &fileName)
Provided for convenience in scripts.
Definition: Graph.cpp:1619
void exportEMF(const QString &fname, const QSizeF &customSize=QSizeF(), int unit=FrameWidget::Pixel, double fontsFactor=1.0)
Definition: Graph.cpp:1882
void copy(Graph *g)
Definition: Graph.cpp:4888
Definition: Graph.h:137
~Graph()
Definition: Graph.cpp:5529
bool drawLineActive()
Definition: Graph.h:501
QString saveFonts()
Definition: Graph.cpp:2346
ErrorBarsCurve * addErrorBars(const QString &xColName, const QString &yColName, Table *errTable, const QString &errColName, int type=1, double width=1, int cap=8, const QColor &color=QColor(Qt::black), bool through=true, bool minus=true, bool plus=true)
Definition: Graph.cpp:3287
ScaleDraw::ScaleType axisType(int axis)
Definition: Graph.cpp:492
int d_maj_tick_length
Definition: Graph.h:908
MultiLayer * multiLayer() const
Returns a pointer to the parent MultiLayer object.
Definition: Graph.cpp:265
void setCurveLineStyle(int curveIndex, Qt::PenStyle style)
Definition: Graph.cpp:5711
LegendWidget * activeText()
Definition: Graph.cpp:7018
QRect boundingRect()
Definition: Graph.cpp:7047
void selectedCanvas(Graph *)
bool arrowMarkerSelected()
Definition: Graph.cpp:1986
QStringList d_axis_titles
Definition: Graph.h:921
void setWaterfallYOffset(int)
Definition: Graph.cpp:7411
Definition: Graph.h:132
void setAxisTitle(int axis, const QString &text)
Definition: Graph.cpp:1302
QPointer< SelectionMoveResizer > d_markers_selector
The markers selected for move/resize operations or NULL if none are selected.
Definition: Graph.h:897
QString d_canvas_bkg_path
Definition: Graph.h:923
void showPlotDialog(int)
bool focusNextPrevChild(bool next)
Definition: Graph.cpp:5603
ArrowMarker * selectedArrow()
Definition: Graph.h:528
void setWaterfallSideLines(bool on=true)
Definition: Graph.cpp:7452
void deselectMarker()
Reset any selection states on markers.
Definition: Graph.cpp:290
bool isCurveAntialiasingEnabled(QwtPlotItem *it)
Definition: Graph.cpp:5570
FrameWidget * d_active_enrichment
Pointer to the currently selected text/legend.
Definition: Graph.h:904
void disableTools()
Definition: Graph.cpp:5199
bool validCurvesDataSize()
Definition: Graph.cpp:5510
Definition: Graph.h:136
bool d_grid_on_top
Flag telling if the grid should be drawn on top of data.
Definition: Graph.h:887
void axisDblClicked(int)
void setCanvasFrame(int width=1, const QColor &color=QColor(Qt::black))
Definition: Graph.cpp:2232
void invertScale(int axis)
Set axis scale.
Definition: Graph.cpp:1386
void setCurrentFont(const QFont &f)
Definition: Graph.cpp:5928
CurveType
Definition: Graph.h:135
void setFrame(int width=1, const QColor &color=Qt::black)
Definition: Graph.cpp:4564
QList< int > getMajorTicksType()
Definition: Graph.cpp:6483
void loadAxesLinewidth(int width)
used when opening a project file
Definition: Graph.cpp:2327
void hideSelectedAxis()
Definition: Graph.cpp:4767
void setAxisMargin(int axis, int margin)
Definition: Graph.cpp:485
QString saveCanvas()
Definition: Graph.cpp:2332