VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pathFeature.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2012 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 {
18  {
19  public:
20  typedef boost::shared_ptr<DtPathFeature> Ptr;
21  typedef boost::shared_ptr<const DtPathFeature> CPtr;
22 
23  enum Direction
24  {
27  ONE_WAY_BACKWARD
28  };
29 
30  static const char* TypeName;
31 
32  virtual DtPathFeature* clone() const = 0;
33 
34  virtual DtFeatureGeometry::Path pathGeometry() const = 0;
35 
36  virtual Direction direction() const;
37  virtual boost::optional<unsigned> numLanes() const;
38  virtual boost::optional<double> width() const;
39  virtual boost::optional<double> medianWidth() const;
40  virtual boost::optional<std::string> roadName() const;
41  };
42 
44 
46  {
47  public:
48  static DtPathFeatureSet* MakeSet(DtFeatureSet*);
49 
50  explicit DtSimplePathFeature(const DtFeature& feature);
51  explicit DtSimplePathFeature(DtFeature*);
53 
54  DtFeatureGeometry geometry() const { return myPathGeometry; }
55  DtFeatureGeometry::Path pathGeometry() const { return myPathGeometry; }
56 
59 
60  boost::optional<Attribute> attribute(const Key & key) const
61  {
62  return myFeature.attribute(key);
63  }
64 
65  void forEachAttribute(ForEachFunction f) const
66  {
67  myFeature.forEachAttribute(f);
68  }
69 
70  unsigned numberOfAttributes(const Key::String & name) const
71  {
72  return myFeature.numberOfAttributes(name);
73  }
74 
75  DtSimplePathFeature* clone() const
76  {
77  return new DtSimplePathFeature(*this);
78  }
79 
80  DetachCallback addDeleteCallback(const DeleteCallback& callback) const
81  {
82  return myFeature.addDeleteCallback(callback);
83  }
84 
85  bool isDeleted() const
86  {
87  return myFeature.isDeleted();
88  }
89 
90  private:
92  : myFeature(from.myFeature)
93  , myPathGeometry(from.myPathGeometry)
94  {
95  }
96 
99  };
100 
101  //Use on a feature set with findeachFeature to get the closest
102  //path feature to the given point. Once the closest feature
103  //has been found, call findClosestPointOnFeature() to get
104  //the closest edge and closest point on that edge.
106  {
107  public:
109 
111  const DtPoint& point,
112  const DtProj& localProj);
113 
114  void operator()(const DtPathFeature & feature);
115 
116  void findClosestPointOnFeature();
117 
118  bool foundClosestFeature() const;
119 
128  };
129 }
130 

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)