VR-Forces 4.2 Class Documentation
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 
20  class DT_DLL_features DtOgrGeometry : public DtFeatureGeometry::Implementation
21  {
22  public:
23  typedef boost::shared_ptr<DtOgrGeometry> Ptr;
24  typedef boost::shared_ptr<const DtOgrGeometry> CPtr;
25 
26  typedef DtFeatureGeometry::Implementation Implementation;
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 covers(DtFeatureGeometry) const;
68 
69  bool within(DtFeatureGeometry) const;
70 
71  bool touches(DtFeatureGeometry) const;
72 
73  double length() const;
74 
75  double area() const;
76 
77  double distanceTo(DtFeatureGeometry, const DtProj&) const;
78 
79  DtFeatureGeometry unionWith(DtFeatureGeometry) const;
80 
81  DtFeatureGeometry intersectionWith(DtFeatureGeometry) const;
82 
83  DtFeatureGeometry differenceWith(DtFeatureGeometry) const;
84 
85  DtFeatureGeometry buffer(double width, unsigned segments) const;
86 
87  DtFeatureGeometry convexHull() const;
88 
89  DtFeatureGeometry boundary() const;
90 
91  DtFeatureGeometry::Point closestPointTo(DtFeatureGeometry, double* distanceTo = NULL) const;
92  };
93 
94  template <>
96  {
97  typedef OGRGeometryCollection type;
98  };
99 
100  template <>
102  {
103  typedef OGRPoint type;
104  };
105 
106  template <>
108  {
109  typedef OGRLineString type;
110  };
111 
112  template <>
114  {
115  typedef OGRPolygon type;
116  };
117 
118  template <DtFeatureGeometry::Type T>
120  {
121  public:
122  typedef boost::shared_ptr<DtOgrGeometryImpl> Ptr;
123 
124  static DtFeatureGeometry Convert(DtFeatureGeometry::Handle<T>);
125 
126  Type type() const;
127 
128  const typename OgrType<T>::type & ogrGeometry() const = 0;
129 
130  unsigned numberOfPoints() const;
131  std::auto_ptr<PointVector> points() const;
132  unsigned numberOfSubGeometries() const;
133  std::auto_ptr<GeometryVector> subGeometries() const;
134  };
135 
140 }
141 

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)