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);
94 static Area MakeBox(
Point,
double length,
double width,
double rotation);
95 static Area MakeBox(
const DtProj&,
double xmin,
double ymin,
double xmax,
double ymax);
101 static Area MakeArea(
const DtProj&,
const std::vector<DtPoint>& points);
102 static Area MakeArea(
const DtProj&,
const std::vector<DtVector>& points);
103 static Path MakePath(
const DtProj&,
const std::vector<DtPoint>& points);
104 static Path MakePath(
const DtProj&,
const std::vector<DtVector>& points);
112 template <
typename Container>
118 template <
typename Iterator>
170 std::string description()
const;
173 std::string toWKT()
const;
176 bool isValid()
const;
179 bool isEmpty()
const;
182 bool isUnknown()
const;
185 bool isPoint()
const;
194 unsigned dimension()
const;
205 template <
typename T>
206 boost::shared_ptr<T> cast();
208 template <
typename T>
209 boost::shared_ptr<const T> cast()
const;
212 const DtProj& projection()
const;
221 void convert(
const DtProj& p);
224 void convertToLocalTopo();
232 unsigned numberOfPoints()
const;
236 std::auto_ptr<PointVector> points()
const;
239 std::auto_ptr<PointVector> pointsWithHeight()
const;
241 boost::optional<DtPoint> singlePointWithHeight()
const;
245 std::auto_ptr<PointVector> pointsWithoutHeight()
const;
248 unsigned numberOfSubGeometries()
const;
251 std::auto_ptr<GeometryVector> subGeometries()
const;
284 double length()
const;
290 Point centroid()
const;
338 virtual void lock() = 0;
339 virtual void unlock() = 0;
365 template <
typename T>
371 template <
typename T>
379 :
public boost::enable_shared_from_this<DtFeatureGeometry::Implementation>
392 virtual Mutex& getMutex()
const;
394 virtual std::string description()
const;
396 virtual std::string toWKT()
const;
398 virtual bool isValid()
const;
400 virtual bool isEmpty()
const;
402 virtual unsigned dimension()
const;
404 virtual Hash hash()
const;
411 virtual bool unique()
const;
414 virtual const DtProj & projection()
const = 0;
421 virtual void convert(
const DtProj &) = 0;
424 virtual void prepare();
429 virtual Type type()
const = 0;
432 virtual unsigned numberOfPoints()
const = 0;
435 virtual std::auto_ptr<PointVector> points()
const = 0;
438 virtual boost::optional<DtPoint> singlePoint()
const;
441 virtual unsigned numberOfSubGeometries()
const = 0;
444 virtual std::auto_ptr<GeometryVector> subGeometries()
const = 0;
471 virtual double length()
const = 0;
473 virtual double area()
const = 0;
476 virtual Point centroid()
const = 0;
493 virtual DtFeatureGeometry bufferWithFlatCap(
double width,
unsigned segments)
const = 0;
520 typedef boost::shared_ptr<EmptyImplementation>
Ptr;
533 std::auto_ptr<PointVector>
points()
const;
570 virtual ~RelationshipMatrix();
572 virtual bool equals()
const;
574 virtual bool disjoint()
const;
575 virtual bool covers()
const;
576 virtual bool coveredBy()
const;
577 virtual bool within()
const;
578 virtual bool touches()
const;
579 virtual bool overlaps()
const;
580 virtual bool crosses()
const;
581 virtual bool contains()
const;
596 Handle(
const Implementation::Ptr&);
602 DtPoint pointWithHeight()
const;
603 DtPoint pointWithoutHeight()
const;
613 typedef std::vector<DtFeatureGeometry::Path>
Vector;
625 template <
typename Container>
628 return Make(
PointVector(cont.begin(), cont.end()), proj);
631 template <
typename Iterator>
639 Handle(
const Implementation::Ptr&);
641 Path reversed()
const;
645 class DT_DLL_features DtFeatureGeometry::Handle<DtFeatureGeometry::AreaType>
646 :
public DtFeatureGeometry
649 friend class DtFeatureGeometry;
651 typedef std::vector<DtFeatureGeometry::Area>
Vector;
655 Handle(
const Implementation::Ptr&);
659 Path outerBoundary()
const;
661 unsigned numberOfHoles()
const;
662 std::auto_ptr<GeometryVector> holes()
const;
664 Path findShortestPerimeter(
Path)
const;
670 template <DtFeatureGeometry::Type T>
671 std::ostream& operator<< (std::ostream& str, const DtFeatureGeometry::Handle<T>& g)