VR-Forces Developer's Guide
 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 std::shared_ptr<DtPathFeature> Ptr;
21  typedef std::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 override = 0;
33 
34  virtual DtFeatureGeometry::Path pathGeometry() const = 0;
35 
36  virtual Direction direction() const;
37  virtual boost::optional<unsigned> numLanes() const;
39  virtual boost::optional<double> width() const;
40  virtual boost::optional<double> laneWidth() const;
41  virtual boost::optional<double> medianWidth() const;
42  virtual boost::optional<double> flowSpeed() const;
43  virtual boost::optional<std::string> roadName() const;
44  virtual bool isClosed() const;
45  };
46 
48 
50  {
51  public:
52  static DtPathFeatureSet* MakeSet(DtFeatureSet*);
53 
54  explicit DtSimplePathFeature(const DtFeature& feature);
55  explicit DtSimplePathFeature(DtFeature*);
57 
58  virtual DtFeatureGeometry geometry() const override { return myPathGeometry; }
59  virtual DtFeatureGeometry::Path pathGeometry() const override { return myPathGeometry; }
60 
63 
64  virtual boost::optional<Attribute> attribute(const Key& key) const override { return myFeature.attribute(key); }
65 
66  virtual void forEachAttribute(ForEachFunction f) const override { myFeature.forEachAttribute(f); }
67 
68  virtual unsigned numberOfAttributes(const Key::String& name) const override
69  {
70  return myFeature.numberOfAttributes(name);
71  }
72 
73  virtual DtSimplePathFeature* clone() const override { return new DtSimplePathFeature(*this); }
74 
75  virtual DetachCallback addDeleteCallback(const DeleteCallback& callback) const override
76  {
77  return myFeature.addDeleteCallback(callback);
78  }
79 
80  virtual bool isDeleted() const override {
81  return myFeature.isDeleted();
82  }
83 
84  private:
86  : myFeature(from.myFeature)
87  , myPathGeometry(from.myPathGeometry)
88  {
89  }
90 
93  };
94 
95  //Use on a feature set with findeachFeature to get the closest
96  //path feature to the given point. Once the closest feature
97  //has been found, call findClosestPointOnFeature() to get
98  //the closest edge and closest point on that edge.
100  {
101  public:
103 
105  const DtPoint& point,
106  const DtProj& localProj);
107 
108  void operator()(const DtPathFeature & feature);
109 
110  void findClosestPointOnFeature();
111 
112  bool foundClosestFeature() const;
113 
122  };
123 }
124 
Represents a set of DtFeature objects or others which conform to the DtFeature concept.
Definition: featureSet.h:105
#define DT_DLL_features
stop complaining about multiple independent base classes for boost::noncopyable this should probably ...
Definition: featuresDefines.h:41
double myClosestDistance
Definition: pathFeature.h:116
std::vector< DtPoint > PointVector
Definition: featureGeometry.h:76
DtPoint myClosestEdgeB
Definition: pathFeature.h:119
DtProj::CPtr myTopoProj
Definition: pathFeature.h:121
virtual bool isDeleted() const override
Check to see if feature has been deleted. Note: this is not related to C++ delete or destructors...
Definition: pathFeature.h:80
Key used to lookup attributes. The DtFeature interface is a dictionary that maps Key objects to attri...
Definition: feature.h:67
std::shared_ptr< const DtProj > CPtr
Definition: proj.h:56
virtual DtFeatureGeometry geometry() const override
Get the geometry associated with this feature. GIS features each typically each associated with one g...
Definition: pathFeature.h:58
Definition: pathFeature.h:49
DtPoint myClosestPoint
Definition: pathFeature.h:117
DtPathFeature::CPtr myClosestFeature
Definition: pathFeature.h:115
DtFeatureGeometry::Path myPathGeometry
Definition: pathFeature.h:92
DtFeatureGeometry::Point myEntityPoint
Definition: pathFeature.h:114
boost::function< void()> DetachCallback
Callback used to detach the user from a feature so the users callback is not called anymore...
Definition: feature.h:179
virtual boost::optional< Attribute > attribute(const Key &key) const override
have to implement all the DtFeature and functions to call the same function on myFeature, like...
Definition: pathFeature.h:64
DtPoint myClosestEdgeA
Definition: pathFeature.h:118
DtFeatureGeometry::PointVector PointVector
Definition: pathFeature.h:102
Direction
Definition: pathFeature.h:23
boost::function< void(const Key &, const Attribute &)> ForEachFunction
Callback used to iterating through attributes with ForEachAttribute.
Definition: feature.h:150
Handle< PointType > Point
Definition: featureGeometry.h:70
Represents some coordinate system. The terms &quot;coordinate system&quot;, &quot;projection&quot;, &quot;spatial reference&quot;...
Definition: proj.h:52
virtual unsigned numberOfAttributes(const Key::String &name) const override
Definition: pathFeature.h:68
boost::function< void()> DeleteCallback
User supplied callback called when feature is deleted.
Definition: feature.h:182
static const char * TypeName
Definition: pathFeature.h:30
virtual DtFeatureGeometry::Path pathGeometry() const override
Definition: pathFeature.h:59
Definition: pathFeature.h:25
DtSimplePathFeature(const DtSimplePathFeature &from)
Definition: pathFeature.h:85
std::shared_ptr< DtPathFeature > Ptr
Definition: pathFeature.h:20
Handle< PathType > Path
Definition: featureGeometry.h:71
virtual void forEachAttribute(ForEachFunction f) const override
Calls the provided callback on each attribute.
Definition: pathFeature.h:66
std::shared_ptr< const DtPathFeature > CPtr
Definition: pathFeature.h:21
DtFeatureSetTemplate< DtPathFeature > DtPathFeatureSet
Definition: pathFeature.h:47
Definition: pathFeature.h:99
Definition: pathFeature.h:17
DtProj::CPtr myLocalProj
Definition: pathFeature.h:120
virtual DtSimplePathFeature * clone() const override
Return a pointer to an object which represents the current feature. In order to enable paging and eff...
Definition: pathFeature.h:73
DtFeatureWrapper< DtFeature > myFeature
Definition: pathFeature.h:91
Represents a GIS feature. Features consist of a DtFeatureGeometry (2.5D geometric vector data) and a ...
Definition: feature.h:36
virtual DetachCallback addDeleteCallback(const DeleteCallback &callback) const override
Add a user supplied callback to the feature to be called when the feature is deleted. If the feature is already deleted the callback may or may not be called by the implementation of this function. The callback is guaranteed to only be called once.
Definition: pathFeature.h:75
Represents a feature geometry.
Definition: featureGeometry.h:40
Definition: point.h:34

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)