plotmatrix.h
Go to the documentation of this file.
1 #ifndef _PLOT_MATRIX_H_
2 #define _PLOT_MATRIX_H_
3 
4 #include <qframe.h>
5 #include <QGridLayout>
6 #include "qwt_plot.h"
7 #include "plotwidget.h"
8 
9 class PlotMatrix: public QFrame
10 {
11  Q_OBJECT
12 
13 public:
14  PlotMatrix(QString name, PlotDataMapRef &datamap, QWidget * parent = nullptr );
15  virtual ~PlotMatrix();
16 
17  void addRow();
18  void addColumn();
19  void removeColumn(unsigned column_to_delete);
20  void removeRow(unsigned row_to_delete);
21 
22  void removeEmpty();
23 
24  unsigned rowsCount() const;
25  unsigned colsCount() const;
26  unsigned plotCount() const;
27 
28  bool isRowEmpty(unsigned row ) const;
29  bool isColumnEmpty(unsigned row ) const;
30 
31  PlotWidget* plotAt( unsigned row, unsigned column );
32  const PlotWidget* plotAt( unsigned row, unsigned column ) const;
33 
34  PlotWidget* plotAt( unsigned index );
35  const PlotWidget* plotAt( unsigned index ) const;
36 
37  void setAxisScale(QwtPlot::Axis axisId, unsigned row, unsigned col,
38  double min, double max, double step = 0 );
39 
40  QDomElement xmlSaveState(QDomDocument &doc) const;
41 
42  bool xmlLoadState(QDomElement &plotmatrix_element );
43 
44  void updateLayout();
45 
46  void replot();
47 
48  void setHorizontalLink(bool linked);
49 
50  void setName(const QString &new_name) ;
51 
52  const QString& name() const;
53 
54  QGridLayout* gridLayout();
55 
56 public slots:
58 
60 
61  void maximumZoomOut();
62 
63 
64 private slots:
65  // void swapWidgetByName(QString name_a, QString name_b);
66  void on_singlePlotScaleChanged(PlotWidget* modified_plot, QRectF range);
67 
68  void on_legendSizeChanged(int point_size);
69 
70 private:
71  void alignAxes(unsigned rowOrColumn, QwtPlot::Axis axisId );
72  void alignScaleBorder( unsigned rowOrColumn, QwtPlot::Axis axisId );
73  PlotWidget *addPlotWidget( unsigned row, unsigned col);
74  void swapPlots( unsigned rowA, unsigned colA, unsigned rowB, unsigned colB);
75 
76  QGridLayout *_layout;
77  unsigned _num_rows;
78  unsigned _num_cols;
80 
82 
83  QString _name;
85 
86 signals:
87  void plotAdded(PlotWidget*);
88  void undoableChange();
89 
90 };
91 
92 #endif
void maximumZoomOutVertical()
Definition: plotmatrix.cpp:387
QGridLayout * gridLayout()
Definition: plotmatrix.cpp:369
void setAxisScale(QwtPlot::Axis axisId, unsigned row, unsigned col, double min, double max, double step=0)
Definition: plotmatrix.cpp:254
int _legend_point_size
Definition: plotmatrix.h:84
bool isColumnEmpty(unsigned row) const
Definition: plotmatrix.cpp:198
QDomElement xmlSaveState(QDomDocument &doc) const
Definition: plotmatrix.cpp:265
void addRow()
Definition: plotmatrix.cpp:54
bool xmlLoadState(QDomElement &plotmatrix_element)
Definition: plotmatrix.cpp:288
void swapPlots(unsigned rowA, unsigned colA, unsigned rowB, unsigned colB)
Definition: plotmatrix.cpp:90
unsigned _num_rows
Definition: plotmatrix.h:77
PlotWidget * plotAt(unsigned row, unsigned column)
Definition: plotmatrix.cpp:223
const QString & name() const
Definition: plotmatrix.cpp:364
unsigned plotCount() const
Definition: plotmatrix.cpp:193
void alignScaleBorder(unsigned rowOrColumn, QwtPlot::Axis axisId)
Definition: plotmatrix.cpp:485
Axis
Axis index.
Definition: qwt_plot.h:93
QGridLayout * _layout
Definition: plotmatrix.h:76
unsigned colsCount() const
Definition: plotmatrix.cpp:188
void removeRow(unsigned row_to_delete)
Definition: plotmatrix.cpp:131
bool isRowEmpty(unsigned row) const
Definition: plotmatrix.cpp:210
void alignAxes(unsigned rowOrColumn, QwtPlot::Axis axisId)
Definition: plotmatrix.cpp:451
virtual ~PlotMatrix()
Definition: plotmatrix.cpp:181
unsigned rowsCount() const
Definition: plotmatrix.cpp:183
void on_legendSizeChanged(int point_size)
Definition: plotmatrix.cpp:437
bool _horizontal_link
Definition: plotmatrix.h:79
void on_singlePlotScaleChanged(PlotWidget *modified_plot, QRectF range)
Definition: plotmatrix.cpp:414
unsigned _num_cols
Definition: plotmatrix.h:78
void undoableChange()
QString _name
Definition: plotmatrix.h:83
unsigned int step
PlotDataMapRef & _mapped_data
Definition: plotmatrix.h:81
void updateLayout()
Definition: plotmatrix.cpp:328
void plotAdded(PlotWidget *)
void replot()
Definition: plotmatrix.cpp:343
void removeEmpty()
Definition: plotmatrix.cpp:157
int min(int a, int b)
PlotWidget * addPlotWidget(unsigned row, unsigned col)
Definition: plotmatrix.cpp:29
void setHorizontalLink(bool linked)
Definition: plotmatrix.cpp:353
void setName(const QString &new_name)
Definition: plotmatrix.cpp:359
PlotMatrix(QString name, PlotDataMapRef &datamap, QWidget *parent=nullptr)
Definition: plotmatrix.cpp:13
void addColumn()
Definition: plotmatrix.cpp:72
void removeColumn(unsigned column_to_delete)
Definition: plotmatrix.cpp:103
void maximumZoomOut()
Definition: plotmatrix.cpp:400
void maximumZoomOutHorizontal()
Definition: plotmatrix.cpp:374


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:17