Version: 0.6.0
featuredataset.h
1 /******************************************************************************
2  * Project: wxGIS
3  * Purpose: FeatureDataset class.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2009-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/datasource/table.h"
24 
32 class WXDLLIMPEXP_GIS_DS wxGISFeatureDataset :
33  public wxGISTable
34 {
35  DECLARE_CLASS(wxGISFeatureDataset)
36 public:
37  wxGISFeatureDataset(const CPLString &sPath, int nSubType, OGRLayer* poLayer = NULL, OGRCompatibleDataSource* poDS = NULL);
38  virtual ~wxGISFeatureDataset(void);
39 //wxGISTable
40  virtual const wxGISSpatialReference GetSpatialReference(void);
41  virtual void Close(void);
42  virtual bool Open(int iLayer = 0, bool bUpdate = true, bool bShared = true, bool bCache = true, ITrackCancel* const pTrackCancel = NULL);
43  virtual wxGISDataset* GetSubset(size_t nIndex);
44  virtual wxGISDataset* GetSubset(const wxString & sSubsetName);
45  virtual bool IsCached(void) const;
46  virtual bool IsCaching(void) const;
47  virtual void Cache(ITrackCancel* const pTrackCancel = NULL);
48  virtual void StopCaching(void);
49  virtual void SetEncoding(const wxFontEncoding &oEncoding);
50  virtual char **GetFileList();
51  //editing
52  virtual OGRErr DeleteFeature(long nFID);
53  virtual OGRErr StoreFeature(wxGISFeature &Feature);
54  virtual OGRErr SetFeature(const wxGISFeature &Feature);
55 //wxGISFeatureDataset
56  virtual void SetCached(bool bCached);
57  virtual OGREnvelope GetEnvelope(void);
58  virtual OGRwkbGeometryType GetGeometryType(void) const;
59  virtual wxString GetGeometryColumn(void) const;
60  virtual OGRErr SetFilter(const wxGISSpatialFilter &SpaFilter = wxGISNullSpatialFilter);
61  virtual wxFeatureCursor Search(const wxGISSpatialFilter &SpaFilter, bool bOnlyFirst = false, ITrackCancel* const pTrackCancel = NULL);
62  virtual wxGISSpatialTreeCursor SearchGeometry(const OGREnvelope &Env);
63 protected:
64  virtual void SetInternalValues(void);
65  virtual bool IsContainer() const;
66 protected:
67  OGREnvelope m_stExtent;
68  OGRwkbGeometryType m_eGeomType;
69  wxGISSpatialTree* m_pSpatialTree;
70  bool m_bOLCFastGetExtent;
71 };
72 
80 class WXDLLIMPEXP_GIS_DS wxGISFeatureDatasetCached :
81  public wxGISFeatureDataset
82 {
83  DECLARE_CLASS(wxGISFeatureDatasetCached)
84  friend class wxGISQuadTree;
85 public:
86  wxGISFeatureDatasetCached(const CPLString &sPath, int nSubType, OGRLayer* poLayer = NULL, OGRCompatibleDataSource* poDS = NULL);
87  virtual ~wxGISFeatureDatasetCached(void);
88 //wxGISTable
89  virtual void Close(void);
90  virtual wxGISDataset* GetSubset(size_t nIndex);
91  virtual wxGISDataset* GetSubset(const wxString & sSubsetName);
92  virtual void Cache(ITrackCancel* const pTrackCancel = NULL);
93  virtual void SetEncoding(const wxFontEncoding &oEncoding);
94  //wxGISFeatureDataset
95  virtual OGREnvelope GetEnvelope(void);
96  /*
97  virtual OGRErr SetFilter(wxGISQueryFilter* pQFilter);
98  */
99  //wxGISTable
100  virtual void Reset(void);
101  virtual wxGISFeature Next(void);
102  virtual wxGISFeature GetFeatureByID(long nFID);
103  virtual wxGISFeature GetFeature(long nIndex);
104  virtual size_t GetFeatureCount(bool bForce = false, ITrackCancel* const pTrackCancel = NULL);
105  virtual OGRErr DeleteFeature(long nFID);
106  virtual OGRErr StoreFeature(wxGISFeature &Feature);
107  virtual OGRErr SetFeature(const wxGISFeature &Feature);
108 protected:
109  std::map<long, wxGISFeature> m_omFeatures;
110 };
Definition: featuredataset.h:80
Definition: table.h:37
A TrackCancel interface class.
Definition: core.h:144
Definition: gdalinh.h:117
The class represents an array of OGRFeatures, received by some selection.
Definition: cursor.h:33
Definition: spatialtree.h:63
Definition: dataset.h:33
Definition: filter.h:49
Definition: gdalinh.h:57
Definition: spatialtree.h:297
Definition: featuredataset.h:32