plotmatrix.h
Go to the documentation of this file.
00001 #ifndef _PLOT_MATRIX_H_
00002 #define _PLOT_MATRIX_H_
00003 
00004 #include <qframe.h>
00005 #include <QGridLayout>
00006 #include "qwt_plot.h"
00007 #include "plotwidget.h"
00008 
00009 class PlotMatrix: public QFrame
00010 {
00011     Q_OBJECT
00012 
00013 public:
00014     PlotMatrix(QString name, PlotDataMapRef &datamap, QWidget * parent = nullptr );
00015     virtual ~PlotMatrix();
00016 
00017     void addRow();
00018     void addColumn();
00019     void removeColumn(unsigned column_to_delete);
00020     void removeRow(unsigned row_to_delete);
00021 
00022     void removeEmpty();
00023 
00024     unsigned rowsCount() const;
00025     unsigned colsCount() const;
00026     unsigned plotCount() const;
00027 
00028     bool isRowEmpty(unsigned row ) const;
00029     bool isColumnEmpty(unsigned row ) const;
00030 
00031     PlotWidget* plotAt( unsigned row, unsigned column );
00032     const PlotWidget* plotAt( unsigned row, unsigned column ) const;
00033 
00034     PlotWidget* plotAt( unsigned index );
00035     const PlotWidget* plotAt( unsigned index ) const;
00036 
00037     void setAxisScale(QwtPlot::Axis axisId, unsigned row, unsigned col,
00038                       double min, double max, double step = 0 );
00039 
00040     QDomElement xmlSaveState(QDomDocument &doc) const;
00041 
00042     bool xmlLoadState(QDomElement &plotmatrix_element );
00043 
00044     void updateLayout();
00045 
00046     void replot();
00047 
00048     void setHorizontalLink(bool linked);
00049 
00050     void setName(const QString &new_name) ;
00051 
00052     const QString& name() const;
00053 
00054     QGridLayout* gridLayout();
00055 
00056 public slots:
00057     void maximumZoomOutHorizontal();
00058 
00059     void maximumZoomOutVertical();
00060 
00061     void maximumZoomOut();
00062 
00063 
00064 private slots:
00065     //  void swapWidgetByName(QString name_a, QString name_b);
00066     void on_singlePlotScaleChanged(PlotWidget* modified_plot, QRectF range);
00067 
00068     void on_legendSizeChanged(int point_size);
00069 
00070 private:
00071     void alignAxes(unsigned rowOrColumn, QwtPlot::Axis axisId );
00072     void alignScaleBorder( unsigned rowOrColumn, QwtPlot::Axis axisId );
00073     PlotWidget *addPlotWidget( unsigned row, unsigned col);
00074     void swapPlots( unsigned rowA, unsigned colA, unsigned rowB, unsigned colB);
00075 
00076     QGridLayout *_layout;
00077     unsigned _num_rows;
00078     unsigned _num_cols;
00079     bool _horizontal_link;
00080 
00081     PlotDataMapRef& _mapped_data;
00082 
00083     QString _name;
00084     int _legend_point_size;
00085 
00086 signals:
00087     void plotAdded(PlotWidget*);
00088     void undoableChange();
00089 
00090 };
00091 
00092 #endif


plotjuggler
Author(s): Davide Faconti
autogenerated on Wed Jul 3 2019 19:28:04