Version: 0.6.0
featurerenderer.h
1 /******************************************************************************
2  * Project: wxGIS
3  * Purpose: wxGISSimpleRenderer class.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2009,2011,2013 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/carto/renderer.h"
24 #include "wxgis/display/symbol.h"
25 
27 
35 class WXDLLIMPEXP_GIS_CRT wxGISFeatureRenderer :
36  public wxGISRenderer
37 {
38  DECLARE_CLASS(wxGISFeatureRenderer)
39 public:
40  wxGISFeatureRenderer(wxGISLayer* pwxGISLayer = NULL);
41  virtual ~wxGISFeatureRenderer(void);
42  virtual bool CanRender(wxGISLayer* const pwxGISLayer) const;
43  virtual bool Draw(wxGISEnumDrawPhase DrawPhase, wxGISDisplay* const pDisplay, ITrackCancel* const pTrackCancel = NULL);
44 
45  virtual void SetSymbol(wxGISSymbol *pSymbol);
46  virtual void Draw(const wxGISSpatialTreeCursor& Cursor, wxGISEnumDrawPhase DrawPhase, wxGISDisplay *pDisplay, ITrackCancel *pTrackCancel = NULL);
47  virtual bool Apply(ITrackCancel* const pTrackCancel = NULL);
48  virtual void FeatureChanged(const wxGISFeature &Feature);
49 protected:
50  wxGISFeatureLayer* m_pwxGISFeatureLayer;
51  wxGISSymbol* m_pSymbol;
52  wxCriticalSection m_CritSect;
53 };
54 
55 
56 //WX_DECLARE_STRING_HASH_MAP( wxGISSymbol*, wxGISUniqueValuesSymbolMap );
57 WX_DECLARE_HASH_MAP(long, wxGISSymbol*, wxIntegerHash, wxIntegerEqual, wxGISUniqueValuesSymbolMap);
58 
59 
67 class WXDLLIMPEXP_GIS_CRT wxGISUniqueValueRenderer :
69 {
70  DECLARE_CLASS(wxGISFeatureRenderer)
71 public:
72  wxGISUniqueValueRenderer(wxGISLayer* pwxGISLayer = NULL);
73  virtual ~wxGISUniqueValueRenderer(void);
74  virtual void AddValue(int nField, const wxString &sValue, wxGISSymbol* const Symbol);
75  virtual void SetSymbol(wxGISSymbol *pSymbol);
76  virtual void Draw(const wxGISSpatialTreeCursor& Cursor, wxGISEnumDrawPhase DrawPhase, wxGISDisplay *pDisplay, ITrackCancel *pTrackCancel = NULL);
77  virtual bool Apply(ITrackCancel* const pTrackCancel = NULL);
78  virtual void FeatureChanged(const wxGISFeature &Feature);
79 
80  typedef struct _uniq_value{
81  wxString sField;
82  wxString sValue;
83  wxGISSymbol* Symbol;
84  }UNIQ_VALUE;
85 protected:
86  wxVector<UNIQ_VALUE> m_astUniqueValues;
87  //wxArrayInt m_naCheckFields;
88  wxGISUniqueValuesSymbolMap m_omSymbols;
89  wxGISFeatureDataset *m_pwxGISFeatureDataset;
90 };
Definition: symbol.h:35
Definition: gisdisplay.h:43
A TrackCancel interface class.
Definition: core.h:144
Definition: gdalinh.h:117
Definition: featurelayer.h:35
Definition: layer.h:35
Definition: featurerenderer.h:80
Definition: featuredataset.h:32
Definition: featurerenderer.h:35
The base class for renderers.
Definition: renderer.h:31
Definition: featurerenderer.h:67
Definition: symbol.h:18