VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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  virtual bool isClosed() const;
42  };
43 
45 
47  {
48  public:
49  static DtPathFeatureSet* MakeSet(DtFeatureSet*);
50 
51  explicit DtSimplePathFeature(const DtFeature& feature);
52  explicit DtSimplePathFeature(DtFeature*);
54 
55  DtFeatureGeometry geometry() const { return myPathGeometry; }
56  DtFeatureGeometry::Path pathGeometry() const { return myPathGeometry; }
57 
60 
61  boost::optional<Attribute> attribute(const Key & key) const
62  {
63  return myFeature.attribute(key);
64  }
65 
66  void forEachAttribute(ForEachFunction f) const
67  {
68  myFeature.forEachAttribute(f);
69  }
70 
71  unsigned numberOfAttributes(const Key::String & name) const
72  {
73  return myFeature.numberOfAttributes(name);
74  }
75 
76  DtSimplePathFeature* clone() const
77  {
78  return new DtSimplePathFeature(*this);
79  }
80 
81  DetachCallback addDeleteCallback(const DeleteCallback& callback) const
82  {
83  return myFeature.addDeleteCallback(callback);
84  }
85 
86  bool isDeleted() const
87  {
88  return myFeature.isDeleted();
89  }
90 
91  private:
93  : myFeature(from.myFeature)
94  , myPathGeometry(from.myPathGeometry)
95  {
96  }
97 
100  };
101 
102  //Use on a feature set with findeachFeature to get the closest
103  //path feature to the given point. Once the closest feature
104  //has been found, call findClosestPointOnFeature() to get
105  //the closest edge and closest point on that edge.
107  {
108  public:
110 
112  const DtPoint& point,
113  const DtProj& localProj);
114 
115  void operator()(const DtPathFeature & feature);
116 
117  void findClosestPointOnFeature();
118 
119  bool foundClosestFeature() const;
120 
129  };
130 }
131 

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)