22 #ifndef GEOS_GEOM_GEOMETRY_H
23 #define GEOS_GEOM_GEOMETRY_H
25 #include <geos/export.h>
26 #include <geos/platform.h>
27 #include <geos/inline.h>
28 #include <geos/geom/Envelope.h>
29 #include <geos/geom/Dimension.h>
30 #include <geos/geom/GeometryComponentFilter.h>
39 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
40 #pragma warning(disable: 4355) // warning C4355: 'this' : used in base member initializer list
47 class CoordinateFilter;
48 class CoordinateSequence;
49 class CoordinateSequenceFilter;
50 class GeometryComponentFilter;
51 class GeometryFactory;
53 class IntersectionMatrix;
237 virtual int getSRID()
const {
return SRID; }
243 virtual void setSRID(
int newSRID) { SRID=newSRID; }
249 const PrecisionModel* getPrecisionModel()
const;
255 virtual const Coordinate* getCoordinate()
const=0;
262 virtual CoordinateSequence* getCoordinates()
const=0;
265 virtual std::size_t getNumPoints()
const=0;
268 virtual bool isSimple()
const;
271 virtual std::string getGeometryType()
const=0;
293 virtual bool isValid()
const;
296 virtual bool isEmpty()
const=0;
305 virtual int getCoordinateDimension()
const=0;
323 virtual Geometry* getBoundary()
const=0;
326 virtual int getBoundaryDimension()
const=0;
329 virtual Geometry* getEnvelope()
const;
335 virtual const Envelope* getEnvelopeInternal()
const;
353 virtual bool disjoint(
const Geometry *other)
const;
359 virtual bool touches(
const Geometry *other)
const;
362 virtual bool intersects(
const Geometry *g)
const;
386 virtual bool crosses(
const Geometry *g)
const;
392 virtual bool within(
const Geometry *g)
const;
395 virtual bool contains(
const Geometry *g)
const;
402 virtual bool overlaps(
const Geometry *g)
const;
418 virtual bool relate(
const Geometry *g,
419 const std::string& intersectionPattern)
const;
421 bool relate(
const Geometry& g,
const std::string& intersectionPattern)
const
423 return relate(&g, intersectionPattern);
427 virtual IntersectionMatrix* relate(
const Geometry *g)
const;
428 IntersectionMatrix* relate(
const Geometry &g)
const {
437 virtual bool equals(
const Geometry *g)
const;
477 bool covers(
const Geometry* g)
const;
515 virtual std::string toString()
const;
517 virtual std::string toText()
const;
523 virtual Geometry* buffer(
double distance)
const;
532 virtual Geometry* buffer(
double distance,
int quadrantSegments)
const;
570 virtual Geometry* buffer(
double distance,
int quadrantSegments,
571 int endCapStyle)
const;
576 virtual Geometry* convexHull()
const;
618 AutoPtr Union()
const;
648 virtual bool equalsExact(
const Geometry *other,
double tolerance=0)
686 void applyComponentFilter(T& f)
const
688 for(std::size_t i=0, n=getNumGeometries(); i<n; ++i)
689 f.filter(getGeometryN(i));
693 virtual void normalize()=0;
695 virtual int compareTo(
const Geometry *geom)
const;
701 virtual double distance(
const Geometry *g)
const;
704 virtual double getArea()
const;
707 virtual double getLength()
const;
720 virtual bool isWithinDistance(
const Geometry *geom,
721 double cDistance)
const;
732 virtual Point* getCentroid()
const;
738 virtual bool getCentroid(
Coordinate& ret)
const;
750 virtual Point* getInteriorPoint()
const;
757 virtual void geometryChanged();
764 void geometryChangedAction();
772 static bool hasNonEmptyElements(
const std::vector<Geometry *>* geometries);
778 static bool hasNullElements(
const std::vector<Geometry *>* lrs);
789 virtual bool isEquivalentClass(
const Geometry *other)
const;
791 static void checkNotGeometryCollection(
const Geometry *g);
798 virtual Envelope::AutoPtr computeEnvelopeInternal()
const=0;
800 virtual int compareToSameClass(
const Geometry *geom)
const=0;
802 int compare(std::vector<Coordinate> a, std::vector<Coordinate> b)
const;
804 int compare(std::vector<Geometry *> a, std::vector<Geometry *> b)
const;
807 double tolerance)
const;
834 int getClassSortIndex()
const;
845 static GeometryChangedFilter geometryChangedFilter;
851 const GeometryFactory *factory;
853 static const GeometryFactory* INTERNAL_GEOMETRY_FACTORY;
862 GEOS_DLL std::ostream&
operator<< (std::ostream& os,
const Geometry& geom);
864 struct GEOS_DLL GeometryGreaterThen {
865 bool operator()(
const Geometry *first,
const Geometry *second);
883 typedef std::auto_ptr<Geometry> GeomPtr;
895 #endif // ndef GEOS_GEOM_GEOMETRY_H