VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ogrFeatureSet.h
Go to the documentation of this file.
1 
5 #pragma once
6 
9 
10 #include <boost/scoped_ptr.hpp>
11 #include <boost/shared_ptr.hpp>
12 
13 #include <features/featureSet.h>
14 #include <features/feature.h>
15 #include <features/query.h>
16 
18 
19 #if WIN32
20 #include <gdal.h>
21 class OGRFeature;
22 class GDALDataset;
23 #else
24 #include <ogrsf_frmts.h>
25 //#include <gdal_priv.h>
26 #endif
27 
28 #include <set>
29 
30 namespace MAKVRinTerra
31 {
33  {
34  public:
35  typedef std::vector<DtFeatureGeometry> GeometryVector;
36 
38  boost::shared_ptr<OGRFeature> feature,
39  DtFeatureGeometry geometry,
40  DtFeature::CPtr defaults);
41 
42  unsigned numberOfAttributes(const Key::String &) const;
43 
44  boost::optional<Attribute> attribute(const Key & k) const;
45 
46  DtFeatureGeometry geometry() const;
47 
48  void forEachAttribute(ForEachFunction) const;
49 
51  {
52  return DetachCallback();
53  }
54 
55  bool isDeleted() const
56  {
57  return false;
58  }
59 
60  private:
61  boost::shared_ptr<OGRFeature> myFeature;
64  };
65 
67  {
68  public:
69  typedef boost::shared_ptr<DtOgrDataSource> Ptr;
70 
74  static DtFeatureSet* Make(std::string file, std::string layerName = "");
75 
77  explicit DtOgrDataSource(std::string file, std::string layerName = "");
78 
79  std::string label() const;
80  bool isIndexed() const;
81 
82  protected:
83  std::string myFile;
84  boost::shared_ptr<GDALDataset> myDataSource;
85  };
86 
88  {
89  public:
91 
92  DtOgrLayer(
93  boost::shared_ptr<GDALDataset>,
94  int layerNum,
95  bool indexed,
96  const std::string& srcPath,
97  const std::string& configLayerName = "");
98 
99  std::string label() const;
100  void forEachFeatureParallel(const ForEachFunction&) const;
101  DetachCallback forEachFeatureAsync(const ForEachFunction&) const;
102  DtFeatureSet* filter(
103  const DtQuery& query,
104  const boost::optional<DtFeatureGeometry>&,
105  DtLoadType) const;
106  DtFeatureSet* clone() const;
107  bool loaded(double) const;
108  DetachCallback addLoadedCallback(const LoadedCallback&) const;
109  bool elided() const;
110  bool empty() const;
111  bool isIndexed() const;
112 
113  protected:
114  explicit DtOgrLayer(const DtOgrLayer& from);
115  DtOgrLayer(const DtOgrLayer& from, boost::optional<DtFeatureGeometry> filter);
116 
117  typedef std::set<DtFeature::Key> AttributeSet;
118 
119  boost::shared_ptr<GDALDataset> myDataSource;
121  boost::optional<DtFeatureGeometry> myGeometryFilter;
124  std::string myLayerName;
125  std::string myConfigLayerName;
128  std::string myLabel;
129  };
130 }
Represents a set of DtFeature objects or others which conform to the DtFeature concept.
Definition: featureSet.h:101
boost::shared_ptr< DtOgrDataSource > Ptr
Definition: ogrFeatureSet.h:69
boost::function< void(const Feature &)> ForEachFunction
Callback type type for iterating through features.
Definition: featureSet.h:151
#define DT_DLL_features
stop complaining about multiple independent base classes for boost::noncopyable this should probably ...
Definition: featuresDefines.h:36
DtProj::CPtr myGeometryProjection
Definition: ogrFeatureSet.h:120
boost::function< void()> DetachCallback
Callback type for disconnecting other callbacks.
Definition: featureSet.h:123
Definition: ogrFeatureSet.h:66
Key used to lookup attributes.
Definition: feature.h:66
std::vector< DtFeatureGeometry > GeometryVector
Definition: ogrFeatureSet.h:35
boost::shared_ptr< const DtFeature > CPtr
Definition: feature.h:44
boost::shared_ptr< GDALDataset > myDataSource
Definition: ogrFeatureSet.h:119
boost::shared_ptr< OGRFeature > myFeature
Definition: ogrFeatureSet.h:61
Definition: ogrFeatureSet.h:32
boost::shared_ptr< GDALDataset > myDataSource
Definition: ogrFeatureSet.h:84
boost::function< void()> DetachCallback
Callback used to detach the user from a feature so the users callback is not called anymore...
Definition: feature.h:178
Definition: ogrFeatureSet.h:87
boost::function< void(const Key &, const Attribute &)> ForEachFunction
Callback used to iterating through attributes with ForEachAttribute.
Definition: feature.h:149
Represents a set of characeters a DtFeature object can have.
Definition: query.h:38
bool isDeleted() const
Check to see if feature has been deleted.
Definition: ogrFeatureSet.h:55
boost::function< void()> DeleteCallback
User supplied callback called when feature is deleted.
Definition: feature.h:181
DtFeatureGeometry myGeometry
Definition: ogrFeatureSet.h:62
boost::shared_ptr< const DtProj > CPtr
Definition: proj.h:48
boost::optional< DtFeatureGeometry > myGeometryFilter
Definition: ogrFeatureSet.h:121
DetachCallback addDeleteCallback(const DeleteCallback &) const
Add a user supplied callback to the feature to be called when the feature is deleted.
Definition: ogrFeatureSet.h:50
Create a new MAK exception type that inherits from boost::exception.
Definition: taggedException.h:15
std::set< DtFeature::Key > AttributeSet
Definition: ogrFeatureSet.h:117
std::string myLayerName
Definition: ogrFeatureSet.h:124
std::string myConfigLayerName
Definition: ogrFeatureSet.h:125
DtLoadType
Used to indicate whether to load features.
Definition: featureSet.h:36
DtFeature::CPtr myDefaults
Definition: ogrFeatureSet.h:63
std::string myFile
Definition: ogrFeatureSet.h:83
DtFeature::CPtr myDefaults
Definition: ogrFeatureSet.h:126
DtFeatureSet used to combine multiple feature sets into one.
Definition: featureSetList.h:21
Represents a GIS feature.
Definition: feature.h:37
boost::function< void()> LoadedCallback
Callback type type for async notification of feature set loading.
Definition: featureSet.h:154
bool myIndexedFlag
Definition: ogrFeatureSet.h:127
std::string myLabel
Definition: ogrFeatureSet.h:128
Represents a feature geometry.
Definition: featureGeometry.h:35
int myLayerNumber
Definition: ogrFeatureSet.h:123
DtTaggedException< DtOgrLayer > Exception
Definition: ogrFeatureSet.h:90
AttributeSet myAttributes
Definition: ogrFeatureSet.h:122

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)