VR-Forces Development_Version 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  };
40 
42 
44  {
45  public:
46  static DtPathFeatureSet* MakeSet(DtFeatureSet*);
47 
48  explicit DtSimplePathFeature(const DtFeature& feature);
49  explicit DtSimplePathFeature(DtFeature*);
51 
52  DtFeatureGeometry geometry() const { return myPathGeometry; }
53  DtFeatureGeometry::Path pathGeometry() const { return myPathGeometry; }
54 
57 
58  boost::optional<Attribute> attribute(const Key & key) const
59  {
60  return myFeature.attribute(key);
61  }
62 
63  void forEachAttribute(ForEachFunction f) const
64  {
65  myFeature.forEachAttribute(f);
66  }
67 
68  unsigned numberOfAttributes(const Key::String & name) const
69  {
70  return myFeature.numberOfAttributes(name);
71  }
72 
73  DtSimplePathFeature* clone() const
74  {
75  return new DtSimplePathFeature(*this);
76  }
77 
78  DetachCallback addDeleteCallback(const DeleteCallback& callback) const
79  {
80  return myFeature.addDeleteCallback(callback);
81  }
82 
83  bool isDeleted() const
84  {
85  return myFeature.isDeleted();
86  }
87 
88  private:
90  : myFeature(from.myFeature)
91  , myPathGeometry(from.myPathGeometry)
92  {
93  }
94 
97  };
98 
99  //Use on a feature set with findeachFeature to get the closest
100  //path feature to the given point. Once the closest feature
101  //has been found, call findClosestPointOnFeature() to get
102  //the closest edge and closest point on that edge.
104  {
105  public:
107 
109  const DtPoint& point,
110  const DtProj& localProj);
111 
112  void operator()(const DtPathFeature & feature);
113 
114  void findClosestPointOnFeature();
115 
116  bool foundClosestFeature() const;
117 
126  };
127 }
128 

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)