00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef GEOS_GEOS_POINT_H
00023 #define GEOS_GEOS_POINT_H
00024
00025 #include <geos/export.h>
00026 #include <geos/platform.h>
00027 #include <geos/geom/Geometry.h>
00028 #include <geos/geom/Puntal.h>
00029 #include <geos/geom/CoordinateSequence.h>
00030 #include <geos/geom/Envelope.h>
00031 #include <geos/geom/Dimension.h>
00032
00033 #include <geos/inline.h>
00034
00035 #include <string>
00036 #include <vector>
00037 #include <memory>
00038
00039 #ifdef _MSC_VER
00040 #pragma warning(push)
00041 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00042 #endif
00043
00044
00045 namespace geos {
00046 namespace geom {
00047 class Coordinate;
00048 class CoordinateArraySequence;
00049 class CoordinateFilter;
00050 class CoordinateSequenceFilter;
00051 class GeometryComponentFilter;
00052 class GeometryFilter;
00053 }
00054 }
00055
00056 namespace geos {
00057 namespace geom {
00058
00068 class GEOS_DLL Point : public virtual Geometry, public Puntal
00069 {
00070
00071 public:
00072
00073 friend class GeometryFactory;
00074
00076 typedef std::vector<const Point *> ConstVect;
00077
00078 virtual ~Point();
00079
00086 Geometry *clone() const { return new Point(*this); }
00087
00088 CoordinateSequence* getCoordinates(void) const;
00089
00090 const CoordinateSequence* getCoordinatesRO() const;
00091
00092 size_t getNumPoints() const;
00093 bool isEmpty() const;
00094 bool isSimple() const;
00095
00097 Dimension::DimensionType getDimension() const;
00098
00100 virtual int getCoordinateDimension() const;
00101
00103 int getBoundaryDimension() const;
00104
00113 Geometry* getBoundary() const;
00114
00115 double getX() const;
00116 double getY() const;
00117 const Coordinate* getCoordinate() const;
00118 std::string getGeometryType() const;
00119 virtual GeometryTypeId getGeometryTypeId() const;
00120 void apply_ro(CoordinateFilter *filter) const;
00121 void apply_rw(const CoordinateFilter *filter);
00122 void apply_ro(GeometryFilter *filter) const;
00123 void apply_rw(GeometryFilter *filter);
00124 void apply_rw(GeometryComponentFilter *filter);
00125 void apply_ro(GeometryComponentFilter *filter) const;
00126 void apply_rw(CoordinateSequenceFilter& filter);
00127 void apply_ro(CoordinateSequenceFilter& filter) const;
00128
00129 bool equalsExact(const Geometry *other, double tolerance=0) const;
00130
00131 void normalize(void)
00132 {
00133
00134 }
00135
00136 Geometry* reverse() const
00137 {
00138 return clone();
00139 }
00140
00141 protected:
00142
00155 Point(CoordinateSequence *newCoords, const GeometryFactory *newFactory);
00156
00157 Point(const Point &p);
00158
00159 Envelope::AutoPtr computeEnvelopeInternal() const;
00160
00161 int compareToSameClass(const Geometry *p) const;
00162
00163 private:
00164
00168 std::auto_ptr<CoordinateSequence> coordinates;
00169 };
00170
00171 }
00172 }
00173
00174
00175
00176
00177
00178 #ifdef _MSC_VER
00179 #pragma warning(pop)
00180 #endif
00181
00182 #endif // ndef GEOS_GEOS_POINT_H
00183