00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GEOS_GEOS_POINT_H
00022 #define GEOS_GEOS_POINT_H
00023
00024 #include <geos/export.h>
00025 #include <geos/platform.h>
00026 #include <geos/geom/Geometry.h>
00027 #include <geos/geom/CoordinateSequence.h>
00028 #include <geos/geom/Envelope.h>
00029 #include <geos/geom/Dimension.h>
00030
00031 #include <geos/inline.h>
00032
00033 #include <string>
00034 #include <vector>
00035 #include <memory>
00036
00037
00038 namespace geos {
00039 namespace geom {
00040 class Coordinate;
00041 class CoordinateArraySequence;
00042 class CoordinateFilter;
00043 class CoordinateSequenceFilter;
00044 class GeometryComponentFilter;
00045 class GeometryFilter;
00046 }
00047 }
00048
00049 namespace geos {
00050 namespace geom {
00051
00056 class GEOS_DLL Point : public Geometry
00057
00058
00059 {
00060
00061 public:
00062
00063 friend class GeometryFactory;
00064
00066 typedef std::vector<const Point *> ConstVect;
00067
00068 virtual ~Point();
00069
00076 Geometry *clone() const { return new Point(*this); }
00077
00078 CoordinateSequence* getCoordinates(void) const;
00079
00080 const CoordinateSequence* getCoordinatesRO() const;
00081
00082 size_t getNumPoints() const;
00083 bool isEmpty() const;
00084 bool isSimple() const;
00085
00086
00088 Dimension::DimensionType getDimension() const;
00089
00091 int getBoundaryDimension() const;
00092
00101 Geometry* getBoundary() const;
00102
00103 double getX() const;
00104 double getY() const;
00105 const Coordinate* getCoordinate() const;
00106 std::string getGeometryType() const;
00107 virtual GeometryTypeId getGeometryTypeId() const;
00108 void apply_ro(CoordinateFilter *filter) const;
00109 void apply_rw(const CoordinateFilter *filter);
00110 void apply_ro(GeometryFilter *filter) const;
00111 void apply_rw(GeometryFilter *filter);
00112 void apply_rw(GeometryComponentFilter *filter);
00113 void apply_ro(GeometryComponentFilter *filter) const;
00114 void apply_rw(CoordinateSequenceFilter& filter);
00115 void apply_ro(CoordinateSequenceFilter& filter) const;
00116
00117 bool equalsExact(const Geometry *other, double tolerance=0) const;
00118
00119 void normalize(void)
00120 {
00121
00122 }
00123
00124 Geometry* reverse() const
00125 {
00126 return clone();
00127 }
00128
00129 protected:
00130
00143 Point(CoordinateSequence *newCoords, const GeometryFactory *newFactory);
00144
00145 Point(const Point &p);
00146
00147 Envelope::AutoPtr computeEnvelopeInternal() const;
00148
00149 int compareToSameClass(const Geometry *p) const;
00150
00151 private:
00152
00156 std::auto_ptr<CoordinateSequence> coordinates;
00157 };
00158
00159 }
00160 }
00161
00162
00163
00164
00165
00166 #endif // ndef GEOS_GEOS_POINT_H
00167