VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
areaFeature.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <features/feature.h>
13 #include <features/featureSet.h>
14 
15 namespace MAKVRinTerra
16 {
22  : public DtFeature
23  , public DtObjectDebugger<DtAreaFeature>
24  {
25  public:
26 
28  static const char* TypeName;
29 
30  typedef boost::shared_ptr<DtAreaFeature> Ptr;
31  typedef boost::shared_ptr<const DtAreaFeature> CPtr;
32 
33  DtAreaFeature* clone() const = 0;
34 
36  virtual DtFeatureGeometry::Area area() const;
37  };
38 
40 
42  {
43  public:
46  {
48  std::string type;
49 
51  double buffer;
52 
54  bool unioned;
55 
56  explicit Config(
57  const std::string& type, double buffer=0, bool unioned=false);
58 
59  bool operator<(const Config& other) const;
60  };
61 
62  struct AreaCollector;
63 
64  explicit DtAreaFeatureSetAdapter(
65  DtFeatureSet* fs, const DtProj& proj, const Config& cfg);
66 
67  std::string label() const;
68  void forEachFeatureParallel(const ForEachFunction& func) const;
69  DetachCallback forEachFeatureAsync(const ForEachFunction&) const;
70  DtAreaFeatureSet* filter(
71  const DtQuery& query, const boost::optional<DtFeatureGeometry>&, DtLoadType) const;
72  DtAreaFeatureSet* clone() const;
73  bool loaded(double) const;
74  DetachCallback addLoadedCallback(const LoadedCallback&) const;
75  unsigned numberOfFeatures() const;
76  bool elided() const;
77  bool empty() const;
78 
79  protected:
80  explicit DtAreaFeatureSetAdapter(
81  DtFeatureSet* fs, const DtAreaFeatureSetAdapter& from);
82 
83  boost::scoped_ptr<DtFeatureSet> myFeatureSet;
86  };
87 
88  template <typename T>
90  : public DtAreaFeature
91  //, public DtObjectDebugger< DtFeatureWrapper<DtAreaFeature,T> >
92  {
93  public:
94  typedef boost::shared_ptr<DtFeatureWrapper> Ptr;
95  typedef boost::shared_ptr<const DtFeatureWrapper> CPtr;
96 
98  {
99  return new DtFeatureWrapper(*this);
100  }
101 
103  {
104  return myWrapper.wrappedFeature().area();
105  }
106 
108  {
109  return area();
110  }
111 
113  {
114  myWrapper.forEachAttribute(func);
115  }
116 
117  unsigned numberOfAttributes(const Key::String& str) const
118  {
119  return myWrapper.numberOfAttributes(str);
120  }
121 
122  boost::optional<Attribute> attribute(const Key& key) const
123  {
124  return myWrapper.attribute(key);
125  }
126 
128  {
129  return myWrapper.addDeleteCallback(callback);
130  }
131 
132  bool isDeleted() const
133  {
134  return myWrapper.isDeleted();
135  }
136 
137  void setDeleted()
138  {
139  myWrapper.setDeleted();
140  }
141 
142  explicit DtFeatureWrapper(const DtFeatureWrapper& from)
143  : myWrapper(from.myWrapper)
144  {
145  }
146 
148  : myWrapper(f)
149  {
150  }
151 
153  : myWrapper(f)
154  {
155  }
156 
157  explicit DtFeatureWrapper(const DtAreaFeature& f)
158  : myWrapper(f.clone())
159  {
160  }
161 
162  private:
164  };
165 }
166 

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)