Version: 0.6.0
symbol.h
1 /******************************************************************************
2  * Project: wxGIS
3  * Purpose: symbols for feature renderer
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2013-2014 Dmitry Baryshnikov
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  ****************************************************************************/
21 #pragma once
22 
23 #include "wxgis/display/gisdisplay.h"
24 #include "wxgis/display/color.h"
25 #include "wxgis/datasource/gdalinh.h"
26 #include "wxgis/core/pointer.h"
27 
35 class WXDLLIMPEXP_GIS_DSP wxGISSymbol :
36  public wxObject,
37  public wxGISPointer
38 {
39  DECLARE_CLASS(wxGISSymbol)
40 public:
41  wxGISSymbol();
42  wxGISSymbol(const wxGISColor& Color);
43  virtual ~wxGISSymbol();
44  virtual void SetupDisplay(wxGISDisplay* const pDisplay);
45  virtual void Draw(const wxGISGeometry &Geometry, int nLevel = 0) = 0;
46  virtual wxGISColor GetColor() const;
47  virtual void SetColor(const wxGISColor& Color);
48 protected:
49  wxGISColor m_Color;
50  wxGISDisplay* m_pDisplay;
51 };
52 
59 enum wxGISEnumLineCup
60 {
61  enumGISLineCupSquare,
62  enumGISLineCupRound,
63  enumGISLineCupButt
64 };
65 
72 enum wxGISEnumLineJoin
73 {
74  enumGISLineJoinMiter,
75  enumGISLineJoinBevel,
76  enumGISLineJoinRound
77 };
78 
86 class WXDLLIMPEXP_GIS_DSP wxGISSimpleLineSymbol : public wxGISSymbol
87 {
88  DECLARE_CLASS(wxGISSimpleLineSymbol)
89 public:
91  wxGISSimpleLineSymbol(const wxGISColor& Color, double dfWidth);
92  virtual ~wxGISSimpleLineSymbol(void);
93  virtual void Draw(const wxGISGeometry &Geometry, int nLevel = 0);
94  virtual void SetStyleToDisplay();
95  virtual void SetLimitStyleToDisplay();
96  virtual bool DrawPreserved(const OGRLineString* pLine, bool bIsRing = false);
97  virtual double GetWidth() const;
98  virtual void SetWidth(double dfWidth);
99  virtual wxGISEnumLineCup GeCup() const;
100  virtual void SetCup(wxGISEnumLineCup eCup);
101  virtual wxGISEnumLineJoin GetJoin() const;
102  virtual void SetJoin(wxGISEnumLineJoin eJoin);
103  virtual double GetMiterLimit() const;
104  virtual void SetMiterLimit(double dfMiterLimit);
105  virtual wxGISSimpleLineSymbol* Clone() const;
106 protected:
107  double m_dfWidth;
108  wxGISEnumLineCup m_eCup;
109  wxGISEnumLineJoin m_eJoin;
110  double m_dfMiterLimit;
111 };
112 
119 enum wxGISEnumFillRule
120 {
121  enumGISFillRuleWinding,
122  enumGISFillRuleOdd
123 };
124 
131 class WXDLLIMPEXP_GIS_DSP wxGISSimpleFillSymbol : public wxGISSymbol
132 {
133  DECLARE_CLASS(wxGISSimpleFillSymbol)
134 public:
136  wxGISSimpleFillSymbol(const wxGISColor& Color, wxGISSimpleLineSymbol *pLineSymbol);
137  virtual ~wxGISSimpleFillSymbol();
138  virtual void Draw(const wxGISGeometry &Geometry, int nLevel = 0);
139  virtual void SetupDisplay(wxGISDisplay* const pDisplay);
140  virtual wxGISEnumFillRule GetFillRule() const;
141  virtual void SetFillRule(wxGISEnumFillRule eFillRule);
142  virtual wxGISSimpleLineSymbol *GetSimpleLineSymbol() const;
143  virtual void SetSimpleLineSymbol(wxGISSimpleLineSymbol *pLineSymbol);
144  virtual wxGISSimpleFillSymbol* Clone() const;
145 protected:
146  wxGISSimpleLineSymbol *m_pLineSymbol;
147  wxGISEnumFillRule m_eFillRule;
148 };
149 
156 class WXDLLIMPEXP_GIS_DSP wxGISSimpleCircleSymbol : public wxGISSimpleFillSymbol
157 {
158  DECLARE_CLASS(wxGISSimpleCircleSymbol)
159 public:
161  wxGISSimpleCircleSymbol(const wxGISColor& Color, wxGISSimpleLineSymbol *pLineSymbol);
162  virtual ~wxGISSimpleCircleSymbol();
163  virtual void Draw(const wxGISGeometry &Geometry, int nLevel = 0);
164  virtual wxGISSimpleCircleSymbol* Clone() const;
165 };
166 
167 
174 class WXDLLIMPEXP_GIS_DSP wxGISSimpleEllipseSymbol : public wxGISSimpleFillSymbol
175 {
176  DECLARE_CLASS(wxGISSimpleEllipseSymbol)
177 public:
179  wxGISSimpleEllipseSymbol(const wxGISColor& Color, wxGISSimpleLineSymbol *pLineSymbol);
180  virtual ~wxGISSimpleEllipseSymbol();
181  virtual void Draw(const wxGISGeometry &Geometry, int nLevel = 0);
182  virtual wxGISSimpleEllipseSymbol* Clone() const;
183 };
184 
191 class WXDLLIMPEXP_GIS_DSP wxGISSimpleMarkerSymbol : public wxGISSymbol
192 {
193  DECLARE_CLASS(wxGISSimpleMarkerSymbol)
194 public:
196  wxGISSimpleMarkerSymbol(const wxGISColor& Color, double dfSize);
197  virtual ~wxGISSimpleMarkerSymbol();
198  virtual void Draw(const wxGISGeometry &Geometry, int nLevel = 0);
199  virtual void SetSize(double dfSize);
200  virtual double GetSize() const;
201  virtual void SetOutlineColor(const wxGISColor &Color);
202  virtual wxGISColor GetOutlineColor() const;
203  virtual void SetOutlineSize(double dfSize);
204  virtual double GetOutlineSize() const;
205  virtual wxGISSimpleMarkerSymbol* Clone() const;
206 protected:
207  double m_dfSize, m_dfOutlineSize;
208  wxGISColor m_OutlineColor;
209 };
210 
211 
218 class WXDLLIMPEXP_GIS_DSP wxGISSimpleCollectionSymbol : public wxGISSymbol
219 {
220  DECLARE_CLASS(wxGISSimpleCollectionSymbol)
221 public:
223  wxGISSimpleCollectionSymbol(const wxGISColor& Color, wxGISSimpleMarkerSymbol* pMarkerSymbol, wxGISSimpleLineSymbol* pLineSymbol, wxGISSimpleFillSymbol* pFillSymbol);
224  virtual ~wxGISSimpleCollectionSymbol();
225  virtual void Draw(const wxGISGeometry &Geometry, int nLevel = 0);
226  virtual void SetupDisplay(wxGISDisplay* const pDisplay);
227  virtual wxGISSimpleCollectionSymbol* Clone() const;
228  virtual wxGISSimpleMarkerSymbol* GetMarkerSymbol() const;
229  virtual wxGISSimpleLineSymbol* GetLineSymbol() const;
230  virtual wxGISSimpleFillSymbol* GetFillSymbol() const;
231 protected:
232  wxGISSimpleMarkerSymbol* m_pMarkerSymbol;
233  wxGISSimpleLineSymbol* m_pLineSymbol;
234  wxGISSimpleFillSymbol* m_pFillSymbol;
235 };
Definition: symbol.h:174
Definition: symbol.h:35
Definition: symbol.h:218
Definition: symbol.h:86
Definition: gdalinh.h:333
Definition: pointer.h:55
Definition: symbol.h:191
Definition: gisdisplay.h:43
Definition: color.h:34
Definition: symbol.h:156
Definition: symbol.h:131