wxFreeChart
marker.h
1 // Name: marker.h
3 // Purpose: markers declarations
4 // Author: Moskvichev Andrey V.
5 // Created: 2008/11/07
6 // Copyright: (c) 2008-2010 Moskvichev Andrey V.
7 // Licence: wxWidgets licence
9 
10 #ifndef MARKER_H_
11 #define MARKER_H_
12 
13 #include <wx/wxfreechartdefs.h>
14 #include <wx/drawobject.h>
15 #include <wx/areadraw.h>
16 
17 #include <wx/dynarray.h>
18 
19 class Axis;
20 
24 class WXDLLIMPEXP_FREECHART Marker : public DrawObject
25 {
26 public:
27  Marker();
28  virtual ~Marker();
29 
37  virtual void Draw(wxDC &dc, wxRect rcData, Axis *horizAxis, Axis *vertAxis) = 0;
38 };
39 
40 WX_DECLARE_USER_EXPORTED_OBJARRAY(Marker *, MarkerArray, WXDLLIMPEXP_FREECHART);
41 
42 #if 0
43 
47 class WXDLLIMPEXP_FREECHART PointMarker : public Marker
48 {
49 public:
50  PointMarker();
51  virtual ~PointMarker();
52 
53  virtual void Draw(wxDC &dc, wxRect rcData, Axis *horizAxis, Axis *vertAxis);
54 
55  void SetText(const wxString &text)
56  {
57  m_text = text;
58  }
59 
60 private:
61  wxString m_text;
62  wxFont m_textFont;
63  wxColour m_textColour;
64 };
65 
66 #endif // #if 0
67 
71 class WXDLLIMPEXP_FREECHART LineMarker : public Marker
72 {
73 public:
74  LineMarker(wxPen linePen);
75 
76  LineMarker(wxColour lineColour, int lineWidth = 1);
77 
78  virtual ~LineMarker();
79 
80  virtual void Draw(wxDC &dc, wxRect rcData, Axis *horizAxis, Axis *vertAxis);
81 
86  void SetVerticalLine(double value);
87 
92  void SetHorizontalLine(double value);
93 
99  void SetValue(double value, bool horizontal);
100 
101 private:
102  wxPen m_linePen;
103 
104  double m_value;
105  bool m_horizontal;
106 };
107 
112 class WXDLLIMPEXP_FREECHART RangeMarker : public Marker
113 {
114 public:
115  RangeMarker(AreaDraw *rangeAreaDraw);
116  virtual ~RangeMarker();
117 
118  virtual void Draw(wxDC &dc, wxRect rcData, Axis *horizAxis, Axis *vertAxis);
119 
125  void SetVerticalRange(double minValue, double maxValue);
126 
132  void SetHorizontalRange(double minValue, double maxValue);
133 
140  void SetRange(double minValue, double maxValue, bool horizontal);
141 
146  void SetRangeAreaDraw(AreaDraw *rangeAreaDraw);
147 
148 private:
149  double m_minValue;
150  double m_maxValue;
151  bool m_horizontal;
152 
153  AreaDraw *m_rangeAreaDraw;
154 };
155 
156 #endif /*MARKER_H_*/
Marker that marks single value, and drawn as line.
Definition: marker.h:71
Markers base class.
Definition: marker.h:24
Base class for objects drawn on chart or perform drawing of another objects (like renderers...
Definition: drawobject.h:22
Base class for all axes.
Definition: axis.h:39
Base class for drawing area background.
Definition: areadraw.h:22
Marker that marks range of data.
Definition: marker.h:112
virtual void Draw(wxDC &dc, wxRect rcData, Axis *horizAxis, Axis *vertAxis)=0
Performs marker drawing.