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>
167 std::string description()
const;
170 std::string toWKT()
const;
173 bool isValid()
const;
176 bool isEmpty()
const;
179 bool isUnknown()
const;
182 bool isPoint()
const;
191 unsigned dimension()
const;
202 template <
typename T>
203 boost::shared_ptr<T> cast();
205 template <
typename T>
206 boost::shared_ptr<const T> cast()
const;
209 const DtProj& projection()
const;
218 void convert(
const DtProj& p);
221 void convertToLocalTopo();
229 unsigned numberOfPoints()
const;
233 std::auto_ptr<PointVector> points()
const;
236 std::auto_ptr<PointVector> pointsWithHeight()
const;
238 boost::optional<DtPoint> singlePointWithHeight()
const;
242 std::auto_ptr<PointVector> pointsWithoutHeight()
const;
245 unsigned numberOfSubGeometries()
const;
248 std::auto_ptr<GeometryVector> subGeometries()
const;
281 double length()
const;
287 Point centroid()
const;
335 virtual void lock() = 0;
336 virtual void unlock() = 0;
362 template <
typename T>
368 template <
typename T>
376 :
public boost::enable_shared_from_this<DtFeatureGeometry::Implementation>
389 virtual Mutex& getMutex()
const;
391 virtual std::string description()
const;
393 virtual std::string toWKT()
const;
395 virtual bool isValid()
const;
397 virtual bool isEmpty()
const;
399 virtual unsigned dimension()
const;
401 virtual Hash hash()
const;
408 virtual bool unique()
const;
411 virtual const DtProj & projection()
const = 0;
418 virtual void convert(
const DtProj &) = 0;
421 virtual void prepare();
426 virtual Type type()
const = 0;
429 virtual unsigned numberOfPoints()
const = 0;
432 virtual std::auto_ptr<PointVector> points()
const = 0;
435 virtual boost::optional<DtPoint> singlePoint()
const;
438 virtual unsigned numberOfSubGeometries()
const = 0;
441 virtual std::auto_ptr<GeometryVector> subGeometries()
const = 0;
468 virtual double length()
const = 0;
470 virtual double area()
const = 0;
473 virtual Point centroid()
const = 0;
490 virtual DtFeatureGeometry bufferWithFlatCap(
double width,
unsigned segments)
const = 0;
517 typedef boost::shared_ptr<EmptyImplementation>
Ptr;
530 std::auto_ptr<PointVector>
points()
const;
567 virtual ~RelationshipMatrix();
569 virtual bool equals()
const;
571 virtual bool disjoint()
const;
572 virtual bool covers()
const;
573 virtual bool coveredBy()
const;
574 virtual bool within()
const;
575 virtual bool touches()
const;
576 virtual bool overlaps()
const;
577 virtual bool crosses()
const;
578 virtual bool contains()
const;
593 Handle(
const Implementation::Ptr&);
599 DtPoint pointWithHeight()
const;
600 DtPoint pointWithoutHeight()
const;
610 typedef std::vector<DtFeatureGeometry::Path>
Vector;
622 template <
typename Container>
625 return Make(
PointVector(cont.begin(), cont.end()), proj);
628 template <
typename Iterator>
636 Handle(
const Implementation::Ptr&);
638 Path reversed()
const;
642 class DT_DLL_features DtFeatureGeometry::Handle<DtFeatureGeometry::AreaType>
643 :
public DtFeatureGeometry
646 friend class DtFeatureGeometry;
648 typedef std::vector<DtFeatureGeometry::Area>
Vector;
652 Handle(
const Implementation::Ptr&);
654 Path outerBoundary()
const;
656 unsigned numberOfHoles()
const;
657 std::auto_ptr<GeometryVector> holes()
const;
659 Path findShortestPerimeter(
Path)
const;
665 template <DtFeatureGeometry::Type T>
666 std::ostream& operator<< (std::ostream& str, const DtFeatureGeometry::Handle<T>& g)