.Simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
PlotData.h
1 // PlotData.h - PlotData class declaration.
2 // Written By Jesse Z. Zhong
3 #ifndef __Plot_Data_H__
4 #define __Plot_Data_H__
5 #pragma region Includes
6 #include <QString>
7 #include <QVector>
8 #include <QColor>
9 #pragma endregion
10 namespace DataVisualizerGUI {
11 
15  class PlotData {
16 
18  static const QColor DefaultColor;
19 
20  public:
21  // Public members.
22  QString Name;
23  QVector<double> X;
24  QVector<double> Y;
25  QColor Color;
26 
27  public:
31  PlotData();
32 
37  PlotData& operator=(const PlotData& source);
38 
49  void AddPoint(double x, double y);
50 
60  void AddX(double x);
61 
71  void AddY(double y);
72 
73 #pragma region Accessors
74 
81  inline double GetXOffset() const;
82 
89  inline double GetYOffset() const;
90 
99  void SetXYOffset(double x, double y);
100 
108  inline void SetXOffset(double val);
109 
117  inline void SetYOffset(double val);
118 
125  inline double GetXLower() const;
126 
133  inline double GetXUpper() const;
134 
141  inline double GetYLower() const;
142 
149  inline double GetYUpper() const;
150 
157  inline void SetXLower(double val);
158 
165  inline void SetXUpper(double val);
166 
173  inline void SetYLower(double val);
174 
179  inline void SetYUpper(double val);
180 
187  inline bool GetSelected() const;
188 
195  inline void SetSelected(bool selected);
196 #pragma endregion
197  protected:
198 #pragma region Members
199  double xOffset_;
200  double yOffset_;
201  double xLower_;
202  double xUpper_;
203  double yLower_;
204  double yUpper_;
205  bool Selected_;
206 #pragma endregion
207  };
208 }
209 
210 #endif // !__Plot_Data_H__
double GetXOffset() const
Returns the assigned offset used to shift/translate all data points along the x-axis.
Definition: PlotData.cpp:55
void AddPoint(double x, double y)
Adds a single new point on both the x and y components.
Definition: PlotData.cpp:38
double GetXUpper() const
Returns the highest value of all points along the x-axis.
Definition: PlotData.cpp:106
void SetYOffset(double val)
Assigns an offset for the y axis by which all points along the y-axis will be shifted/translated by...
Definition: PlotData.cpp:91
PlotData & operator=(const PlotData &source)
Overloads the assignment operator to allow for assigning/overwriting the values of one plot data with...
Definition: PlotData.cpp:23
double GetXLower() const
Returns the lowest value of all points along the x-axis.
Definition: PlotData.cpp:102
void SetXYOffset(double x, double y)
Assigns offsets for the x and y axis by which all points along those axises will be shifted/translate...
Definition: PlotData.cpp:63
void AddY(double y)
Adds a single new point on the y component.
Definition: PlotData.cpp:49
void SetSelected(bool selected)
Assigns a flag/boolean indicated whether the plot has been selected by the user using the mouse...
Definition: PlotData.cpp:138
QString Name
The name of the plot/curve.
Definition: PlotData.h:22
void SetXLower(double val)
Assigns the lower bound of the x-axis.
Definition: PlotData.cpp:118
void SetXOffset(double val)
Assigns an offset for the x axis by which all points along the x-axis will be shifted/translated by...
Definition: PlotData.cpp:80
bool GetSelected() const
Returns a flag/boolean indicating whether the plot has been selected by the user using the mouse...
Definition: PlotData.cpp:134
double GetYOffset() const
Returns the assigned offset used to shift/translate all data points along the y-axis.
Definition: PlotData.cpp:59
double GetYLower() const
Returns the lowest value of all points along the y-axis.
Definition: PlotData.cpp:110
double xOffset_
Value by which all values on the x-axis will be shifted by.
Definition: PlotData.h:199
double GetYUpper() const
Returns the highest value of all points along the y-axis.
Definition: PlotData.cpp:114
double xLower_
The lower bound of the viewport along the x-axis.
Definition: PlotData.h:201
double yOffset_
Value by which all values on the y-axis will be shifted by.
Definition: PlotData.h:200
double yLower_
The lower bound of the viewport along the y-axis.
Definition: PlotData.h:203
Structure for storing data for individual curves.
Definition: PlotData.h:15
void AddX(double x)
Adds a single new point on the x component.
Definition: PlotData.cpp:43
double yUpper_
The upper bound of the viewport along the y-axis.
Definition: PlotData.h:204
bool Selected_
A flag indicating if the user has selected the plot with the mouse.
Definition: PlotData.h:205
QVector< double > X
X-axis data points.
Definition: PlotData.h:23
double xUpper_
The upper bound of the viewport along the x-axis.
Definition: PlotData.h:202
QVector< double > Y
Y-axis data points.
Definition: PlotData.h:24
void SetYLower(double val)
Assigns the lower bound of the y-axis.
Definition: PlotData.cpp:126
void SetXUpper(double val)
Assigns the upper bound of the x-axis.
Definition: PlotData.cpp:122
QColor Color
The expected color of the plot.
Definition: PlotData.h:25
PlotData()
Constructor.
Definition: PlotData.cpp:10
void SetYUpper(double val)
Assigns the upper bound of the y-axis.
Definition: PlotData.cpp:130