-
Notifications
You must be signed in to change notification settings - Fork 1
/
GCP_Graph.h
88 lines (74 loc) · 2.32 KB
/
GCP_Graph.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef GCP_GraphH
#define GCP_GraphH
#include "GCP_FormComponent.h"
#include "GCP_Vector.h"
#include "GCP_Button.h"
#include "GCP_Label.h"
#include "GCP_ContextMenu.h"
namespace gcp
{
enum GCPE_GraphType
{
ESPHERICAL_GRAPH,
ENORMAL_GRAPH,
ETEMP_GRAPH
};
class GCP_Graph;
typedef GCP_SPointer<GCP_Graph> gcp_spGraph;
class GCP_Graph : public GCP_FormComponent
{
private:
typedef std::pair<double, double> cell;
//Original Values
GCP_Vector<cell> _values;
double _maxValue;
double _minValue;
double _maxIndex, _maxIndexLegend;
double _minIndex, _minIndexLegend;
double _sizeStep;
gcp_spStyle legendStyle;
double _timestepCff; // minx..maxx - > 0...360
double _iSphericalSelectedIndex;
bool _hasnegative;
bool _bMouseMoved;
bool _bRecalculated; //new _resizedGraph is calculated when reveived new data
GCP_Point<int> _lastMousePos;
double _dLastMouseDir;
gcp_spButton sizeUp, sizeDown;
GCP_Vector<gcp_spButton> menu;
GCP_SPointer<GCP_ContextMenu> ToolSetMenu;
gcp_spGraph _resizedGraph;
///
void recalculateSize(double step);
void checkMaxValue(double newmaxvalue);
void checkMaxIndex(double index);
void checkForNegative();
void addNewValue(double index, const double value);
void initButtons();
const cell& getCell(const unsigned int i) const;
public:
GCPE_GraphType type;
GCP_Graph(GCPE_GraphType type = ENORMAL_GRAPH);
void toggleCircle(void *obj);
void toggleNormal(void *obj);
void toggleSizeUp(void *obj);
void toggleSizeDown(void *obj);
unsigned int size() const;
unsigned int sizeWithCurrentStep() const;
double getValue(const unsigned int i) const;
double getIndex(const unsigned int i) const;
double getIndexWithCurrentStep(const unsigned int i) const;
void addValue(double index, const double value);
void setValue(double index, const double value);
double getStep() const;
double getValue(double index, const double defaultvalue) const;
double getValueWithCurrentStep(const unsigned int i) const;
void setIndexRange(double index_min, double index_max);
void clear();
void getMaxMinIndex(double &max_index, double &min_index);
double getMaxValue();
void OnDraw(const GCP_Event& event);
gcp_formEvent OnEvent(const GCP_Event &event);
};
}
#endif