VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 convexHull() const;
92 
93  DtFeatureGeometry boundary() const;
94 
95  DtFeatureGeometry::Point closestPointTo(
96  DtFeatureGeometry, const DtProj&, double* distanceTo = 0) const;
97  };
98 
99  template <>
101  {
102  typedef OGRGeometryCollection type;
103  };
104 
105  template <>
107  {
108  typedef OGRPoint type;
109  };
110 
111  template <>
113  {
114  typedef OGRLineString type;
115  };
116 
117  template <>
119  {
120  typedef OGRPolygon type;
121  };
122 
123  template <DtFeatureGeometry::Type T>
125  {
126  public:
127  typedef boost::shared_ptr<DtOgrGeometryImpl> Ptr;
128 
129  static DtFeatureGeometry Convert(DtFeatureGeometry::Handle<T>);
130 
131  Type type() const;
132 
133  const typename OgrType<T>::type & ogrGeometry() const = 0;
134 
135  unsigned numberOfPoints() const;
136  std::auto_ptr<PointVector> points() const;
137  unsigned numberOfSubGeometries() const;
138  std::auto_ptr<GeometryVector> subGeometries() const;
139  };
140 
145 }
146 

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)