VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ogrGeometry.h
Go to the documentation of this file.
1 
5 #pragma once
6 
8 
9 class OGRGeometry;
10 class OGRPoint;
11 class OGRLineString;
12 class OGRPolygon;
13 class OGRGeometryCollection;
14 
15 namespace MAKVRinTerra
16 {
17 
18  class DtProj;
19 
21  {
22  public:
23  typedef boost::shared_ptr<DtOgrGeometry> Ptr;
24  typedef boost::shared_ptr<const DtOgrGeometry> CPtr;
25 
28 
29  template <Type T>
30  struct OgrType
31  {
32  typedef OGRGeometry type;
33  };
34 
36  static DtFeatureGeometry Convert(DtFeatureGeometry);
37 
38  static DtFeatureGeometry Make(OGRGeometry*);
39  static DtFeatureGeometry Make(OGRGeometry*, const DtProj&);
40 
50  static DtFeatureGeometry MakeShared(
51  const boost::shared_ptr<const DtOgrGeometry>& owner,
52  const OGRGeometry& geometry);
53 
54  Ptr shared_from_this();
55  CPtr shared_from_this() const;
56 
57  virtual const OGRGeometry& ogrGeometry() const = 0;
58 
59  DtFeatureGeometry::Point centroid() const;
60 
61  bool equals(DtFeatureGeometry) const;
62 
63  bool intersects(DtFeatureGeometry) const;
64 
65  bool overlaps(DtFeatureGeometry) const;
66 
67  bool crosses(DtFeatureGeometry) const;
68 
69  bool covers(DtFeatureGeometry) const;
70 
71  bool within(DtFeatureGeometry) const;
72 
73  bool touches(DtFeatureGeometry) const;
74 
75  bool contains(DtFeatureGeometry) const;
76 
77  double length() const;
78 
79  double area() const;
80 
81  double distanceTo(DtFeatureGeometry, const DtProj&) const;
82 
83  DtFeatureGeometry unionWith(DtFeatureGeometry) const;
84 
85  DtFeatureGeometry intersectionWith(DtFeatureGeometry) const;
86 
87  DtFeatureGeometry differenceWith(DtFeatureGeometry) const;
88 
89  DtFeatureGeometry buffer(double width, unsigned segments) const;
90 
91  DtFeatureGeometry bufferWithFlatCap(double width, unsigned segments) const;
92 
93  DtFeatureGeometry convexHull() const;
94 
95  DtFeatureGeometry boundary() const;
96 
97  DtFeatureGeometry::Point closestPointTo(
98  DtFeatureGeometry, const DtProj&, double* distanceTo = 0) const;
99  };
100 
101  template <>
103  {
104  typedef OGRGeometryCollection type;
105  };
106 
107  template <>
109  {
110  typedef OGRPoint type;
111  };
112 
113  template <>
115  {
116  typedef OGRLineString type;
117  };
118 
119  template <>
121  {
122  typedef OGRPolygon type;
123  };
124 
125  template <DtFeatureGeometry::Type T>
127  {
128  public:
129  typedef boost::shared_ptr<DtOgrGeometryImpl> Ptr;
130 
132 
133  Type type() const;
134 
135  const typename OgrType<T>::type & ogrGeometry() const = 0;
136 
137  unsigned numberOfPoints() const;
138  std::auto_ptr<PointVector> points() const;
139  unsigned numberOfSubGeometries() const;
140  std::auto_ptr<GeometryVector> subGeometries() const;
141  };
142 
147 }
148 
#define DT_DLL_features
stop complaining about multiple independent base classes for boost::noncopyable this should probably ...
Definition: featuresDefines.h:41
boost::shared_ptr< DtOgrGeometryImpl > Ptr
Definition: ogrGeometry.h:129
Definition: ogrGeometry.h:30
boost::shared_ptr< DtOgrGeometry > Ptr
Definition: ogrGeometry.h:23
Definition: featureGeometry.h:60
OGRGeometryCollection type
Definition: ogrGeometry.h:104
OGRGeometry type
Definition: ogrGeometry.h:32
DtFeatureGeometry::Implementation Implementation
Definition: ogrGeometry.h:26
Definition: ogrGeometry.h:20
Handle< PointType > Point
Definition: featureGeometry.h:69
Represents some coordinate system. The terms &quot;coordinate system&quot;, &quot;projection&quot;, &quot;spatial reference&quot;...
Definition: proj.h:44
DtOgrGeometryImpl< DtFeatureGeometry::PointType > DtOgrPoint
Definition: ogrGeometry.h:144
DtOgrGeometryImpl< DtFeatureGeometry::PathType > DtOgrPath
Definition: ogrGeometry.h:145
DtFeatureGeometry::Type Type
Definition: ogrGeometry.h:27
boost::shared_ptr< const DtOgrGeometry > CPtr
Definition: ogrGeometry.h:24
DT_DLL_VRVCORE double length(const makVrv::DtCoordinateSystem &, const std::vector< DtVector > &vertices)
Returns the total distance of a segmented line defined by the provided vector of vertices. Coordinates are in local database coordinates. The coordinate system is used to convert between the local database coordinates and geocentric. All distance is in 2D – the Z value is ignored.
DtOgrGeometryImpl< DtFeatureGeometry::AreaType > DtOgrArea
Definition: ogrGeometry.h:146
DT_DLL_vrfutil bool intersects(const DtVector &localPoint1, const DtVector &localPoint2, const DtLocalVertexList &localVertexList, const Coordinate_System &coordinateSystem)
Returns true if the line segment localPoint1-localPoint2 intersects any line segment in localVert...
DtOgrGeometryImpl< DtFeatureGeometry::UnknownType > DtOgrUnknown
Definition: ogrGeometry.h:143
Definition: ogrGeometry.h:126
Represents a feature geometry.
Definition: featureGeometry.h:39

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)