Version: 0.6.0
featurelayer.h
1 /******************************************************************************
2  * Project: wxGIS
3  * Purpose: FeatureLayer header.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2009,2011,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/carto/layer.h"
24 #include "wxgis/datasource/featuredataset.h"
25 #include "wxgis/datasource/vectorop.h"
26 #include "wxgis/carto/featurerenderer.h"
27 
35 class WXDLLIMPEXP_GIS_CRT wxGISFeatureLayer :
36  public wxGISLayer
37 {
38  DECLARE_CLASS(wxGISFeatureLayer)
39 public:
40  wxGISFeatureLayer(const wxString &sName = _("new feature layer"), wxGISDataset* pwxGISDataset = NULL);
41  virtual ~wxGISFeatureLayer(void);
42 //wxGISLayer
43  virtual bool Draw(wxGISEnumDrawPhase DrawPhase, ITrackCancel* const pTrackCancel = NULL);
44  virtual bool IsValid(void) const;
45  virtual bool IsCacheNeeded(void) const;
46  virtual wxGISEnumDatasetType GetType(void) const {return enumGISFeatureDataset;};
47  virtual void SetSpatialReference(const wxGISSpatialReference &SpatialReference);
48  virtual void SetRenderer(wxGISRenderer* pRenderer);
49  virtual bool IsLoading() const;
50 //wxGISFeatureLayer
51  virtual wxGISSpatialTreeCursor Idetify(const wxGISGeometry &Geom);
52  virtual wxGISSpatialTreeCursor SearchGeometry(const OGREnvelope &Env = OGREnvelope());
53  virtual OGRwkbGeometryType GetGeometryType(void) const;
54  virtual wxGISFeature GetFeatureByID (long nFID);
55  //events
56  void OnDSClosed(wxFeatureDSEvent& event);
57  void OnDSFeaturesAdded(wxFeatureDSEvent& event);
58  void OnDSFeatureAdded(wxFeatureDSEvent& event);
59  void OnDSFeatureDeleted(wxFeatureDSEvent& event);
60  void OnDSFeatureChanged(wxFeatureDSEvent& event);
61 protected:
62  //virtual void LoadGeometry(void);
63  virtual long GetPointsInGeometry(const wxGISGeometry& Geom) const;
64 protected:
65  wxGISFeatureDataset* m_pwxGISFeatureDataset;
66  wxGISFeatureRenderer* m_pFeatureRenderer;
67  long m_nConnectionPointDSCookie;
68  wxGISSpatialTree* m_pSpatialTree;
69 private:
70  DECLARE_EVENT_TABLE()
71 };
The FeatureDS class event.
Definition: vectorop.h:40
Definition: gdalinh.h:333
A TrackCancel interface class.
Definition: core.h:144
Definition: gdalinh.h:117
Definition: featurelayer.h:35
Definition: layer.h:35
Definition: spatialtree.h:63
Definition: dataset.h:33
Definition: gdalinh.h:57
Definition: featuredataset.h:32
Definition: featurerenderer.h:35
The base class for renderers.
Definition: renderer.h:31