00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef GEOS_GEOS_POINT_H
00018 #define GEOS_GEOS_POINT_H
00019
00020 #include <geos/platform.h>
00021 #include <geos/geom/Geometry.h>
00022 #include <geos/geom/CoordinateSequence.h>
00023 #include <geos/geom/Envelope.h>
00024 #include <geos/geom/Dimension.h>
00025
00026 #include <geos/inline.h>
00027
00028 #include <string>
00029 #include <vector>
00030 #include <memory>
00031
00032
00033 namespace geos {
00034 namespace geom {
00035 class Coordinate;
00036 class CoordinateArraySequence;
00037 class CoordinateFilter;
00038 class GeometryComponentFilter;
00039 class GeometryFilter;
00040 }
00041 }
00042
00043 namespace geos {
00044 namespace geom {
00045
00050 class Point : public Geometry {
00051
00052 public:
00053
00054 friend class GeometryFactory;
00055
00057 typedef std::vector<const Point *> ConstVect;
00058
00059 virtual ~Point();
00060
00061 Geometry *clone() const { return new Point(*this); }
00062
00063 CoordinateSequence* getCoordinates(void) const;
00064
00065 const CoordinateSequence* getCoordinatesRO() const;
00066
00067 size_t getNumPoints() const;
00068 bool isEmpty() const;
00069 bool isSimple() const;
00070
00071
00073 Dimension::DimensionType getDimension() const;
00074
00076 int getBoundaryDimension() const;
00077
00079 Geometry* getBoundary() const;
00080
00081 double getX() const;
00082 double getY() const;
00083 const Coordinate* getCoordinate() const;
00084 std::string getGeometryType() const;
00085 virtual GeometryTypeId getGeometryTypeId() const;
00086 void apply_ro(CoordinateFilter *filter) const;
00087 void apply_rw(const CoordinateFilter *filter);
00088 void apply_ro(GeometryFilter *filter) const;
00089 void apply_rw(GeometryFilter *filter);
00090 void apply_rw(GeometryComponentFilter *filter);
00091 void apply_ro(GeometryComponentFilter *filter) const;
00092
00093 bool equalsExact(const Geometry *other, double tolerance=0) const;
00094 void normalize(void) { };
00095
00096 protected:
00097
00110 Point(CoordinateSequence *newCoords, const GeometryFactory *newFactory);
00111
00112 Point(const Point &p);
00113
00114 Envelope::AutoPtr computeEnvelopeInternal() const;
00115
00116 int compareToSameClass(const Geometry *p) const;
00117
00118 private:
00119
00123 std::auto_ptr<CoordinateSequence> coordinates;
00124 };
00125
00126 }
00127 }
00128
00129
00130
00131
00132
00133 #endif // ndef GEOS_GEOS_POINT_H
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159