v2.0.0
Loading...
Searching...
No Matches
lineplot.h
Go to the documentation of this file.
1//=============================================================================================================
23
24#ifndef LINEPLOT_H
25#define LINEPLOT_H
26
27//=============================================================================================================
28// INCLUDES
29//=============================================================================================================
30
31#include "../disp_global.h"
32
33//=============================================================================================================
34// EIGEN INCLUDES
35//=============================================================================================================
36
37#include <Eigen/Core>
38
39//=============================================================================================================
40// QT INCLUDES
41//=============================================================================================================
42
43#include <QWidget>
44#include <QSharedPointer>
45#include <QVector>
46
47//=============================================================================================================
48// FORWARD DECLARATIONS
49//=============================================================================================================
50
51//=============================================================================================================
52// DEFINE NAMESPACE DISPLIB
53//=============================================================================================================
54
55namespace DISPLIB
56{
57
58//=============================================================================================================
59// DISPLIB FORWARD DECLARATIONS
60//=============================================================================================================
61
62//=============================================================================================================
72class DISPSHARED_EXPORT LinePlot : public QWidget
73{
74 Q_OBJECT
75
76public:
77 typedef QSharedPointer<LinePlot> SPtr;
78 typedef QSharedPointer<const LinePlot> ConstSPtr;
79
80 //=========================================================================================================
86 LinePlot(QWidget* parent = nullptr);
87
88 //=========================================================================================================
96 LinePlot(const QVector<double>& y,
97 const QString& title = "",
98 QWidget* parent = nullptr);
99
100 //=========================================================================================================
109 LinePlot(const QVector<double>& x,
110 const QVector<double>& y,
111 const QString& title = "",
112 QWidget* parent = nullptr);
113
114 //=========================================================================================================
118 virtual ~LinePlot();
119
120 //=========================================================================================================
126 void setTitle(const QString& p_sTitle);
127
128 //=========================================================================================================
134 void setXLabel(const QString& p_sXLabel);
135
136 //=========================================================================================================
142 void setYLabel(const QString& p_sYLabel);
143
144 //=========================================================================================================
150 void updateData(const QVector<double>& y);
151
152 //=========================================================================================================
159 void updateData(const QVector<double>& x,
160 const QVector<double>& y);
161
162protected:
163 //=========================================================================================================
169 void paintEvent(QPaintEvent* event) override;
170
171private:
172 QString m_sTitle;
173 QString m_sXLabel;
174 QString m_sYLabel;
175 QVector<double> m_vecXData;
176 QVector<double> m_vecYData;
177 double m_dMinX;
178 double m_dMaxX;
179 double m_dMinY;
180 double m_dMaxY;
181};
182
183//=============================================================================================================
184// INLINE DEFINITIONS
185//=============================================================================================================
186
187} // NAMESPACE
188
189#endif // LINEPLOT_H
Export macros and build-info hooks for the DISPLIB shared library.
#define DISPSHARED_EXPORT
Definition disp_global.h:38
2-D display widgets and visualisation helpers (charts, topography, colour maps).
void updateData(const QVector< double > &y)
Definition lineplot.cpp:126
void paintEvent(QPaintEvent *event) override
Definition lineplot.cpp:171
LinePlot(QWidget *parent=nullptr)
Definition lineplot.cpp:45
void setTitle(const QString &p_sTitle)
Definition lineplot.cpp:102
void setXLabel(const QString &p_sXLabel)
Definition lineplot.cpp:110
QSharedPointer< LinePlot > SPtr
Definition lineplot.h:77
void setYLabel(const QString &p_sYLabel)
Definition lineplot.cpp:118
QSharedPointer< const LinePlot > ConstSPtr
Definition lineplot.h:78