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 std::shared_ptr<DtOgrGeometry> Ptr;
24  typedef std::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 std::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  virtual DtFeatureGeometry::Point centroid() const override;
60 
61  virtual bool equals(DtFeatureGeometry) const override;
62 
63  virtual bool intersects(DtFeatureGeometry) const override;
64 
65  virtual bool overlaps(DtFeatureGeometry) const override;
66 
67  virtual bool crosses(DtFeatureGeometry) const override;
68 
69  virtual bool covers(DtFeatureGeometry) const override;
70 
71  virtual bool within(DtFeatureGeometry) const override;
72 
73  virtual bool touches(DtFeatureGeometry) const override;
74 
75  virtual bool contains(DtFeatureGeometry) const override;
76 
77  virtual double length() const override;
78 
79  virtual double area() const override;
80 
81  virtual double distanceTo(DtFeatureGeometry, const DtProj&) const override;
82 
83  virtual DtFeatureGeometry unionWith(DtFeatureGeometry) const override;
84 
85  virtual DtFeatureGeometry intersectionWith(DtFeatureGeometry) const override;
86 
87  virtual DtFeatureGeometry differenceWith(DtFeatureGeometry) const override;
88 
89  virtual DtFeatureGeometry buffer(double width, unsigned segments) const override;
90 
91  virtual DtFeatureGeometry bufferWithFlatCap(double width, unsigned segments) const override;
92 
93  virtual DtFeatureGeometry convexHull() const override;
94 
95  virtual DtFeatureGeometry boundary() const override;
96 
97  virtual DtFeatureGeometry::Point closestPointTo(
98  DtFeatureGeometry, const DtProj&, double* distanceTo = 0) const override;
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 std::shared_ptr<DtOgrGeometryImpl> Ptr;
130 
132 
133  virtual Type type() const override;
134 
135  virtual const typename OgrType<T>::type& ogrGeometry() const override = 0;
136 
137  virtual unsigned numberOfPoints() const override;
138  virtual std::unique_ptr<PointVector> points() const override;
139  virtual unsigned numberOfSubGeometries() const override;
140  virtual std::unique_ptr<GeometryVector> subGeometries() const override;
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
Definition: ogrGeometry.h:30
Definition: featureGeometry.h:61
OGRGeometryCollection type
Definition: ogrGeometry.h:104
OGRGeometry type
Definition: ogrGeometry.h:32
DtFeatureGeometry::Implementation Implementation
Definition: ogrGeometry.h:26
Definition: ogrGeometry.h:20
std::shared_ptr< const DtOgrGeometry > CPtr
Definition: ogrGeometry.h:24
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
DtOgrGeometryImpl< DtFeatureGeometry::PointType > DtOgrPoint
Definition: ogrGeometry.h:144
DtOgrGeometryImpl< DtFeatureGeometry::PathType > DtOgrPath
Definition: ogrGeometry.h:145
DtFeatureGeometry::Type Type
Definition: ogrGeometry.h:27
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.
std::shared_ptr< DtOgrGeometryImpl > Ptr
Definition: ogrGeometry.h:129
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:40
std::shared_ptr< DtOgrGeometry > Ptr
Definition: ogrGeometry.h:23

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)