Version: 0.6.0
xylinerenderer.h
1 // Name: xylinerenderer.h
3 // Purpose: xy line renderer declaration.
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 XYLINERENDERER_H_
11 #define XYLINERENDERER_H_
12 
13 #include <wx/xy/xyrenderer.h>
14 #include <wx/art.h>
15 
16 class WXDLLIMPEXP_FREECHART XYLineRendererBase : public XYRenderer
17 {
18  DECLARE_CLASS(XYLineRendererBase)
19 public:
20  XYLineRendererBase(bool drawSymbols, bool drawLines, int defaultWidth = 1, int defaultStyle = wxSOLID);
21  virtual ~XYLineRendererBase();
22 
28  virtual void SetSerieColour(size_t serie, wxColour *colour);
29 
35  virtual wxColour GetSerieColour(size_t serie);
36 
42  void SetSeriePen(size_t serie, wxPen *pen);
43 
49  wxPen *GetSeriePen(size_t serie);
50 
51  virtual void Draw(wxDC &dc, wxRect rc, Axis *horizAxis, Axis *vertAxis, XYDataset *dataset);
52 
53  //
54  // Renderer
55  //
56  virtual void DrawLegendSymbol(wxDC &dc, wxRect rcSymbol, size_t serie);
57 
58 protected:
59  virtual void DrawLines(wxDC &dc, wxRect rc, Axis *horizAxis, Axis *vertAxis, XYDataset *dataset) = 0;
60  virtual void DrawSymbols(wxDC &dc, wxRect rc, Axis *horizAxis, Axis *vertAxis, XYDataset *dataset);
61 
62  bool m_drawSymbols;
63  bool m_drawLines;
64 
65 private:
66  PenMap m_seriePens;
67 
68  int m_defaultPenWidth;
69  int m_defaultPenStyle;
70 };
71 
75 class WXDLLIMPEXP_FREECHART XYLineRenderer : public XYLineRendererBase
76 {
77  DECLARE_CLASS(XYLineRenderer)
78 public:
86  XYLineRenderer(bool drawSymbols = false, bool drawLines = true, int defaultWidth = 1, int defaultStyle = wxSOLID);
87  virtual ~XYLineRenderer();
88 
89 
90 protected:
91  virtual void DrawLines(wxDC &dc, wxRect rc, Axis *horizAxis, Axis *vertAxis, XYDataset *dataset);
92 };
93 
99 class WXDLLIMPEXP_FREECHART XYLineStepRenderer : public XYLineRendererBase
100 {
101  DECLARE_CLASS(XYLineStepRenderer)
102 public:
103  XYLineStepRenderer(int defaultWidth = 1, int defaultStyle = wxSOLID);
104  virtual ~XYLineStepRenderer();
105 
106 
107 protected:
108  virtual void DrawLines(wxDC &dc, wxRect rc, Axis *horizAxis, Axis *vertAxis, XYDataset *dataset);
109 
110 private:
111  size_t GetFirstVisibleIndex(Axis *horizAxis, Axis *vertAxis, XYDataset *dataset, size_t serie);
112 };
113 
114 #endif /*XYLINERENDERER_H_*/
Definition: xylinerenderer.h:99
Definition: xylinerenderer.h:75
Definition: axis.h:62
virtual void SetSerieColour(size_t serie, wxColour *color)
Definition: renderer.cpp:22
Definition: xylinerenderer.h:16
virtual wxColour GetSerieColour(size_t serie)
Definition: renderer.cpp:28
virtual void DrawLegendSymbol(wxDC &dc, wxRect rcSymbol, size_t serie)
Definition: renderer.cpp:50
virtual void Draw(wxDC &dc, wxRect rc, Axis *horizAxis, Axis *vertAxis, XYDataset *dataset)=0
Definition: xydataset.h:21
Definition: xyrenderer.h:20