VR-Forces 4.1 Class Documentation
obstacleFeature.h
Go to the documentation of this file.
1 
2 
3 
4 
5 #pragma once
6 
7 #include <features/feature.h>
8 #include <features/featureSet.h>
9 
10 namespace MAKVRinTerra
11 {
18  {
19  public:
20  static const char* TypeName;
21 
22  typedef boost::shared_ptr<DtObstacleFeature> Ptr;
23  typedef boost::shared_ptr<const DtObstacleFeature> CPtr;
24 
25  static CPtr GetPtr(const DtObstacleFeature&);
26 
27  DtFeature::CPtr getPtr() const;
28  virtual CPtr getObstaclePtr() const = 0;
29 
30  DtFeatureGeometry geometry() const;
31  virtual DtFeatureGeometry::Area obstacle() const = 0;
32  };
33 
35 
37  {
38  public:
39  explicit DtObstacleFeatureSetAdapter(DtFeatureSet* fs, const DtProj& proj);
40 
41  void forEachFeature(ForEachFunction func, DtWaitType) const;
42  DtObstacleFeatureSet* filter(const DtQuery& query, DtLoadType) const;
43  DtObstacleFeatureSet* clone() const;
44  DtQuery schema() const;
45  bool loaded(double) const;
46  unsigned numberOfFeatures() const;
47 
48  private:
49  boost::scoped_ptr<DtFeatureSet> myFeatureSet;
51  };
52 
53  template <>
55  {
56  public:
57  DtFeature::CPtr getPtr() const { return DtFeature::Ptr(clone()); }
59 
60  DtFeatureGeometry geometry() const { return myWrappedFeature->geometry(); }
61  DtFeatureGeometry::Area obstacle() const { return myWrappedFeature->obstacle(); }
62 
64  {
65  myWrappedFeature->forEachAttribute(func);
66  }
67 
68  unsigned numberOfAttributes(const Key::String& str) const
69  {
70  return myWrappedFeature->numberOfAttributes(str);
71  }
72 
73  boost::optional<Attribute> attribute(const Key& key) const
74  {
75  return myWrappedFeature->attribute(key);
76  }
77 
78  protected:
80  : myWrappedFeature(f.getObstaclePtr()) { }
81 
83  : myWrappedFeature(f) { }
84 
85  virtual DtFeatureWrapper* clone() const = 0;
86 
88  };
89 }

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)