18 #include <boost/function.hpp>
22 namespace MAKVRinTerra
55 template <Type T>
class Handle;
64 typedef Handle<PointType>
Point;
65 typedef Handle<PathType>
Path;
66 typedef Handle<AreaType>
Area;
74 class RelationshipMatrix;
77 typedef boost::shared_ptr<Implementation>
ImplPtr;
80 typedef boost::shared_ptr<const Implementation>
ImplCPtr;
87 static std::string ToString(
Type);
91 static Area MakeBox(
Point,
double length,
double width,
double rotation);
92 static Area MakeBox(
const DtProj&,
double xmin,
double ymin,
double xmax,
double ymax);
98 static Area MakeArea(
const DtProj&,
const std::vector<DtPoint>& points);
99 static Area MakeArea(
const DtProj&,
const std::vector<DtVector>& points);
100 static Path MakePath(
const DtProj&,
const std::vector<DtPoint>& points);
101 static Path MakePath(
const DtProj&,
const std::vector<DtVector>& points);
109 template <
typename Container>
115 template <
typename Iterator>
164 std::string description()
const;
167 bool isValid()
const;
170 bool isEmpty()
const;
173 bool isUnknown()
const;
176 bool isPoint()
const;
185 unsigned dimension()
const;
196 template <
typename T>
197 boost::shared_ptr<T> cast();
199 template <
typename T>
200 boost::shared_ptr<const T> cast()
const;
203 const DtProj& projection()
const;
212 void convert(
const DtProj& p);
215 void convertToLocalTopo();
223 unsigned numberOfPoints()
const;
227 std::auto_ptr<PointVector> points()
const;
230 std::auto_ptr<PointVector> pointsWithHeight()
const;
232 boost::optional<DtPoint> singlePointWithHeight()
const;
236 std::auto_ptr<PointVector> pointsWithoutHeight()
const;
239 unsigned numberOfSubGeometries()
const;
242 std::auto_ptr<GeometryVector> subGeometries()
const;
275 double length()
const;
281 Point centroid()
const;
325 virtual void lock() = 0;
326 virtual void unlock() = 0;
352 template <
typename T>
358 template <
typename T>
366 :
public boost::enable_shared_from_this<DtFeatureGeometry::Implementation>
379 virtual Mutex& getMutex()
const;
381 virtual std::string description()
const;
383 virtual bool isValid()
const;
385 virtual bool isEmpty()
const;
387 virtual unsigned dimension()
const;
389 virtual Hash hash()
const;
396 virtual bool unique()
const;
399 virtual const DtProj & projection()
const = 0;
406 virtual void convert(
const DtProj &) = 0;
409 virtual void prepare();
414 virtual Type type()
const = 0;
417 virtual unsigned numberOfPoints()
const = 0;
420 virtual std::auto_ptr<PointVector> points()
const = 0;
423 virtual boost::optional<DtPoint> singlePoint()
const;
426 virtual unsigned numberOfSubGeometries()
const = 0;
429 virtual std::auto_ptr<GeometryVector> subGeometries()
const = 0;
456 virtual double length()
const = 0;
458 virtual double area()
const = 0;
461 virtual Point centroid()
const = 0;
502 typedef boost::shared_ptr<EmptyImplementation>
Ptr;
515 std::auto_ptr<PointVector>
points()
const;
551 virtual ~RelationshipMatrix();
553 virtual bool equals()
const;
555 virtual bool disjoint()
const;
556 virtual bool covers()
const;
557 virtual bool coveredBy()
const;
558 virtual bool within()
const;
559 virtual bool touches()
const;
560 virtual bool overlaps()
const;
561 virtual bool crosses()
const;
562 virtual bool contains()
const;
577 Handle(
const Implementation::Ptr&);
583 DtPoint pointWithHeight()
const;
584 DtPoint pointWithoutHeight()
const;
594 typedef std::vector<DtFeatureGeometry::Path>
Vector;
606 template <
typename Container>
609 return Make(
PointVector(cont.begin(), cont.end()), proj);
612 template <
typename Iterator>
620 Handle(
const Implementation::Ptr&);
622 Path reversed()
const;
626 class DT_DLL_features DtFeatureGeometry::Handle<DtFeatureGeometry::AreaType>
627 :
public DtFeatureGeometry
630 friend class DtFeatureGeometry;
632 typedef std::vector<DtFeatureGeometry::Area>
Vector;
636 Handle(
const Implementation::Ptr&);
638 Path outerBoundary()
const;
640 unsigned numberOfHoles()
const;
641 std::auto_ptr<GeometryVector> holes()
const;
643 Path findShortestPerimeter(
Path)
const;
649 template <DtFeatureGeometry::Type T>
650 std::ostream& operator<< (std::ostream& str, const DtFeatureGeometry::Handle<T>& g)