VR-Forces 4.1.1 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 
14 namespace MAKVRinTerra
15 {
16 
17  class DtProj;
18 
19  class DT_DLL_features DtOgrGeometry : public DtFeatureGeometry::Implementation
20  {
21  public:
22  typedef boost::shared_ptr<DtOgrGeometry> Ptr;
23  typedef boost::shared_ptr<const DtOgrGeometry> CPtr;
24 
25  typedef DtFeatureGeometry::Implementation Implementation;
27 
28  template <Type T>
29  struct OgrType
30  {
31  typedef OGRGeometry type;
32  };
33 
35  static DtFeatureGeometry Convert(DtFeatureGeometry);
36 
37  static DtFeatureGeometry Make(boost::shared_ptr<OGRGeometry>);
38  static DtFeatureGeometry Make(boost::shared_ptr<OGRGeometry>, const DtProj&);
39  static DtFeatureGeometry Make(OGRGeometry*);
40  static DtFeatureGeometry Make(OGRGeometry*, const DtProj&);
41 
51  static DtFeatureGeometry MakeShared(
52  boost::shared_ptr<const OGRGeometry> owner,
53  const OGRGeometry& geometry,
54  const DtProj& projection);
55 
56  virtual const OGRGeometry& ogrGeometry() const = 0;
57 
58  DtPoint centroid() const;
59 
60  bool intersects(DtFeatureGeometry) const;
61 
62  bool overlaps(DtFeatureGeometry) const;
63 
64  bool covers(DtFeatureGeometry) const;
65 
66  bool within(DtFeatureGeometry) const;
67 
68  double distanceTo(DtFeatureGeometry, const DtProj&) const;
69 
70  DtFeatureGeometry unionWith(DtFeatureGeometry) const;
71 
72  DtFeatureGeometry intersectionWith(DtFeatureGeometry) const;
73 
74  DtFeatureGeometry::Point closestPointTo(DtFeatureGeometry, double* distanceTo = NULL) const;
75  };
76 
77  template <>
79  {
80  typedef OGRPoint type;
81  };
82 
83  template <>
85  {
86  typedef OGRLineString type;
87  };
88 
89  template <>
91  {
92  typedef OGRPolygon type;
93  };
94 
95  template <DtFeatureGeometry::Type T>
97  {
98  public:
99  typedef boost::shared_ptr<DtOgrGeometryImpl> Ptr;
100 
101  static DtFeatureGeometry Convert(DtFeatureGeometry::Handle<T>);
102 
103  Type type() const;
104 
105  const typename OgrType<T>::type & ogrGeometry() const = 0;
106 
107  virtual boost::shared_ptr<const typename OgrType<T>::type> ogrPtr() const = 0;
108 
109  unsigned numberOfPoints() const;
110  std::auto_ptr<PointVector> points() const;
111  unsigned numberOfSubGeometries() const;
112  std::auto_ptr<GeometryVector> subGeometries() const;
113  };
114 
119 }
120 

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)