v2.0.0
Loading...
Searching...
No Matches
lineplot.h
Go to the documentation of this file.
1//=============================================================================================================
35
36#ifndef LINEPLOT_H
37#define LINEPLOT_H
38
39//=============================================================================================================
40// INCLUDES
41//=============================================================================================================
42
43#include "../disp_global.h"
44
45//=============================================================================================================
46// EIGEN INCLUDES
47//=============================================================================================================
48
49#include <Eigen/Core>
50
51//=============================================================================================================
52// QT INCLUDES
53//=============================================================================================================
54
55#include <QWidget>
56#include <QSharedPointer>
57#include <QVector>
58
59//=============================================================================================================
60// FORWARD DECLARATIONS
61//=============================================================================================================
62
63//=============================================================================================================
64// DEFINE NAMESPACE DISPLIB
65//=============================================================================================================
66
67namespace DISPLIB
68{
69
70//=============================================================================================================
71// DISPLIB FORWARD DECLARATIONS
72//=============================================================================================================
73
74//=============================================================================================================
80class DISPSHARED_EXPORT LinePlot : public QWidget
81{
82 Q_OBJECT
83
84public:
85 typedef QSharedPointer<LinePlot> SPtr;
86 typedef QSharedPointer<const LinePlot> ConstSPtr;
87
88 //=========================================================================================================
94 LinePlot(QWidget *parent = nullptr);
95
96 //=========================================================================================================
104 LinePlot(const QVector<double>& y,
105 const QString& title = "",
106 QWidget *parent = nullptr);
107
108 //=========================================================================================================
117 LinePlot(const QVector<double>& x,
118 const QVector<double>& y,
119 const QString& title = "",
120 QWidget *parent = nullptr);
121
122 //=========================================================================================================
126 virtual ~LinePlot();
127
128 //=========================================================================================================
134 void setTitle(const QString &p_sTitle);
135
136 //=========================================================================================================
142 void setXLabel(const QString &p_sXLabel);
143
144 //=========================================================================================================
150 void setYLabel(const QString &p_sYLabel);
151
152 //=========================================================================================================
158 void updateData(const QVector<double>& y);
159
160 //=========================================================================================================
167 void updateData(const QVector<double>& x,
168 const QVector<double>& y);
169
170protected:
171 //=========================================================================================================
177 void paintEvent(QPaintEvent *event) override;
178
179private:
180 QString m_sTitle;
181 QString m_sXLabel;
182 QString m_sYLabel;
183 QVector<double> m_vecXData;
184 QVector<double> m_vecYData;
185 double m_dMinX;
186 double m_dMaxX;
187 double m_dMinY;
188 double m_dMaxY;
189};
190
191//=============================================================================================================
192// INLINE DEFINITIONS
193//=============================================================================================================
194
195} // NAMESPACE
196
197#endif // LINEPLOT_H
disp library export/import macros.
#define DISPSHARED_EXPORT
Definition disp_global.h:51
2-D display widgets and visualisation helpers (charts, topography, colour maps).
void updateData(const QVector< double > &y)
Definition lineplot.cpp:146
void paintEvent(QPaintEvent *event) override
Definition lineplot.cpp:187
LinePlot(QWidget *parent=nullptr)
Definition lineplot.cpp:65
void setTitle(const QString &p_sTitle)
Definition lineplot.cpp:122
void setXLabel(const QString &p_sXLabel)
Definition lineplot.cpp:130
QSharedPointer< LinePlot > SPtr
Definition lineplot.h:85
void setYLabel(const QString &p_sYLabel)
Definition lineplot.cpp:138
QSharedPointer< const LinePlot > ConstSPtr
Definition lineplot.h:86