VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ogrGeometry.h
Go to the documentation of this file.
1 
2 
3 
4 
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 
131  static DtFeatureGeometry Convert(DtFeatureGeometry::Handle<T>);
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 

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)