VR-Forces 4.1.1 Class Documentation
obstacleFeature.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 {
23  {
24  public:
25  static const char* TypeName;
26 
27  typedef boost::shared_ptr<DtObstacleFeature> Ptr;
28  typedef boost::shared_ptr<const DtObstacleFeature> CPtr;
29 
30  static CPtr GetPtr(const DtObstacleFeature&);
31 
32  DtFeature::CPtr getPtr() const;
33  virtual CPtr getObstaclePtr() const = 0;
34 
35  DtFeatureGeometry geometry() const;
36  virtual DtFeatureGeometry::Area obstacle() const = 0;
37  };
38 
40 
42  {
43  public:
44  explicit DtObstacleFeatureSetAdapter(DtFeatureSet* fs, const DtProj& proj);
45 
46  void forEachFeature(ForEachFunction func, DtWaitType) const;
47  DtObstacleFeatureSet* filter(const DtQuery& query, DtLoadType) const;
48  DtObstacleFeatureSet* clone() const;
49  DtQuery schema() const;
50  bool loaded(double) const;
51  unsigned numberOfFeatures() const;
52 
53  private:
54  boost::scoped_ptr<DtFeatureSet> myFeatureSet;
56  };
57 
58  template <>
60  {
61  public:
62  DtFeature::CPtr getPtr() const { return DtFeature::Ptr(clone()); }
64 
65  DtFeatureGeometry geometry() const { return myWrappedFeature->geometry(); }
66  DtFeatureGeometry::Area obstacle() const { return myWrappedFeature->obstacle(); }
67 
69  {
70  myWrappedFeature->forEachAttribute(func);
71  }
72 
73  unsigned numberOfAttributes(const Key::String& str) const
74  {
75  return myWrappedFeature->numberOfAttributes(str);
76  }
77 
78  boost::optional<Attribute> attribute(const Key& key) const
79  {
80  return myWrappedFeature->attribute(key);
81  }
82 
83  protected:
85  : myWrappedFeature(f.getObstaclePtr()) { }
86 
88  : myWrappedFeature(f) { }
89 
90  virtual DtFeatureWrapper* clone() const = 0;
91 
93  };
94 }

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)