OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
PlotDataset.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
10#include "OTGui/Plot1DCfg.h"
12
13// Qt header
14#include <QtCore/qstring.h>
15#include <QtGui/qcolor.h>
16
17// std header
18#include <string>
19
20class QwtSymbol;
21class QwtPlotCurve;
22class QwtPolarCurve;
23
24namespace ot {
25
26 class Plot;
27 class PolarPlotData;
28
32 public:
33 PlotDataset(Plot* _ownerPlot, int _id, const QString& _title, double* _dataX, double* _dataY, long _dataSize);
34 virtual ~PlotDataset();
35
36 // ###########################################################################
37
38 // Setter
39
40 void replaceData(double* _dataX, double* _dataY, long _dataSize);
41
42 void setYim(double* _dataYim) { m_dataYim = _dataYim; }
43
44 void setCurveIsVisibile(bool _isVisible = true, bool _repaint = true);
45
46 void setCurveWidth(double _penSize, bool _repaint = true);
47
48 void setCurveColor(const QColor& _color, bool _repaint = true);
49
50 void setCurvePointsVisible(bool _isVisible = true, bool _repaint = true);
51
52 void setCurvePointInnerColor(const QColor& _color, bool _repaint = true);
53
54 void setCurvePointOuterColor(const QColor& _color, bool _repaint = true);
55
56 void setCurvePointSize(int _size, bool _repaint = true);
57
58 void setCurvePointOuterColorWidth(double _size, bool _repaint = true);
59
60 void attach(void);
61
62 void detach(void);
63
64 void setCurveTitle(const QString& _title);
65 const QString& getCurveTitle(void) const { return m_curveTitle; };
66
67 void setDimmed(bool _isDimmed, bool _repaint = true);
68
69 void setEntityID(unsigned long long _entityID) { m_entityID = _entityID; }
70 void setEntityVersion(unsigned long long _entityVersion) { m_entityVersion = _entityVersion; }
71 void setCurveEntityID(unsigned long long _entityID) { m_curveEntityID = _entityID; }
72 void setCurveEntityVersion(unsigned long long _entityVersion) { m_curveEntityVersion = _entityVersion; }
73 void setTreeItemID(unsigned long long _treeItemID) { m_curveTreeItemID = _treeItemID; }
74 void setAxisTitleX(const std::string& _title) { m_axisTitleX = _title; }
75 void setAxisTitleY(const std::string& _title) { m_axisTitleY = _title; }
76
77 void calculateData(Plot1DCfg::AxisQuantity _axisQuantity);
78
79 // ###########################################################################
80
81 // Getter
82
83 bool getCurveIsVisible(void) const { return m_isVisible; };
84
85 int id(void) const { return m_id; }
86
87 bool getDataAt(int _index, double& _x, double& _y);
88
89 bool getData(double*& _x, double*& _y, long& _size);
90
91 bool getYim(double*& _yim, long& _size);
92
93 bool getCopyOfData(double*& _x, double*& _y, long& _size);
94
95 bool getCopyOfYim(double*& _yim, long& _size);
96
97 unsigned long long getEntityID(void) { return m_entityID; }
98 unsigned long long getEntityVersion(void) { return m_entityVersion; }
99 unsigned long long getCurveEntityID(void) { return m_curveEntityID; }
100 unsigned long long getCurveEntityVersion(void) { return m_curveEntityVersion; }
101 unsigned long long getTreeItemID(void) { return m_curveTreeItemID; }
102 std::string getAxisTitleX(void) { return m_axisTitleX; }
103 std::string getAxisTitleY(void) { return m_axisTitleY; }
104
105 void updateVisualization(void);
106
107 private:
108
109 void memFree(void);
110
111 friend class Plot;
112
113 Plot* m_ownerPlot;
114
115 int m_id;
116 PolarPlotData* m_polarData;
117 double* m_dataX;
118 double* m_dataXcalc;
119 double* m_dataY;
120 double* m_dataYim;
121 double* m_dataYcalc;
122 long m_dataSize;
123
124 bool m_isAttatched;
125 bool m_isVisible;
126 bool m_isDimmed;
127
128 QString m_curveTitle;
129
130 QwtPlotCurve* m_cartesianCurve;
131 QwtPolarCurve* m_polarCurve;
132
133 QwtSymbol* m_cartesianCurvePointSymbol;
134 QwtSymbol* m_polarCurvePointSymbol;
135
136 QColor m_curveColor;
137 double m_curvePenSize;
138
139 bool m_curvePointsVisible;
140 QColor m_curvePointOutterColor;
141 QColor m_curvePointInnerColor;
142 double m_curvePointOutterColorWidth;
143 int m_curvePointSize;
144
145 unsigned long long m_entityID;
146 unsigned long long m_entityVersion;
147 unsigned long long m_curveEntityID;
148 unsigned long long m_curveEntityVersion;
149 unsigned long long m_curveTreeItemID;
150
151 std::string m_axisTitleX;
152 std::string m_axisTitleY;
153 };
154
155}
This file contains defines that may be used simplyfy class creation.
#define OT_DECL_NODEFAULT(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:22
#define OT_DECL_NOCOPY(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:14
#define OT_WIDGETS_API_EXPORT
Definition OTWidgetsAPIExport.h:12
AxisQuantity
Definition Plot1DCfg.h:26
Definition PlotDataset.h:29
void setEntityVersion(unsigned long long _entityVersion)
Definition PlotDataset.h:70
int id(void) const
Definition PlotDataset.h:85
unsigned long long getTreeItemID(void)
Definition PlotDataset.h:101
void setAxisTitleY(const std::string &_title)
Definition PlotDataset.h:75
unsigned long long getEntityID(void)
Definition PlotDataset.h:97
void setTreeItemID(unsigned long long _treeItemID)
Definition PlotDataset.h:73
unsigned long long getCurveEntityID(void)
Definition PlotDataset.h:99
void setAxisTitleX(const std::string &_title)
Definition PlotDataset.h:74
unsigned long long getEntityVersion(void)
Definition PlotDataset.h:98
void setCurveEntityID(unsigned long long _entityID)
Definition PlotDataset.h:71
bool getCurveIsVisible(void) const
Definition PlotDataset.h:83
unsigned long long getCurveEntityVersion(void)
Definition PlotDataset.h:100
const QString & getCurveTitle(void) const
Definition PlotDataset.h:65
void setEntityID(unsigned long long _entityID)
Definition PlotDataset.h:69
void setYim(double *_dataYim)
Definition PlotDataset.h:42
std::string getAxisTitleY(void)
Definition PlotDataset.h:103
std::string getAxisTitleX(void)
Definition PlotDataset.h:102
void setCurveEntityVersion(unsigned long long _entityVersion)
Definition PlotDataset.h:72
Definition Plot.h:39
Definition PolarPlotData.h:17
Definition Connector.h:8