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/Puntal.h>
00028 #include <geos/geom/CoordinateSequence.h>
00029 #include <geos/geom/Envelope.h>
00030 #include <geos/geom/Dimension.h>
00031
00032 #include <geos/inline.h>
00033
00034 #include <string>
00035 #include <vector>
00036 #include <memory>
00037
00038 #ifdef _MSC_VER
00039 #pragma warning(push)
00040 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00041 #endif
00042
00043
00044 namespace geos {
00045 namespace geom {
00046 class Coordinate;
00047 class CoordinateArraySequence;
00048 class CoordinateFilter;
00049 class CoordinateSequenceFilter;
00050 class GeometryComponentFilter;
00051 class GeometryFilter;
00052 }
00053 }
00054
00055 namespace geos {
00056 namespace geom {
00057
00067 class GEOS_DLL Point : public virtual Geometry, public Puntal
00068 {
00069
00070 public:
00071
00072 friend class GeometryFactory;
00073
00075 typedef std::vector<const Point *> ConstVect;
00076
00077 virtual ~Point();
00078
00085 Geometry *clone() const { return new Point(*this); }
00086
00087 CoordinateSequence* getCoordinates(void) const;
00088
00089 const CoordinateSequence* getCoordinatesRO() const;
00090
00091 size_t getNumPoints() const;
00092 bool isEmpty() const;
00093 bool isSimple() const;
00094
00096 Dimension::DimensionType getDimension() const;
00097
00099 virtual int getCoordinateDimension() const;
00100
00102 int getBoundaryDimension() const;
00103
00112 Geometry* getBoundary() const;
00113
00114 double getX() const;
00115 double getY() const;
00116 const Coordinate* getCoordinate() const;
00117 std::string getGeometryType() const;
00118 virtual GeometryTypeId getGeometryTypeId() const;
00119 void apply_ro(CoordinateFilter *filter) const;
00120 void apply_rw(const CoordinateFilter *filter);
00121 void apply_ro(GeometryFilter *filter) const;
00122 void apply_rw(GeometryFilter *filter);
00123 void apply_rw(GeometryComponentFilter *filter);
00124 void apply_ro(GeometryComponentFilter *filter) const;
00125 void apply_rw(CoordinateSequenceFilter& filter);
00126 void apply_ro(CoordinateSequenceFilter& filter) const;
00127
00128 bool equalsExact(const Geometry *other, double tolerance=0) const;
00129
00130 void normalize(void)
00131 {
00132
00133 }
00134
00135 Geometry* reverse() const
00136 {
00137 return clone();
00138 }
00139
00140 protected:
00141
00154 Point(CoordinateSequence *newCoords, const GeometryFactory *newFactory);
00155
00156 Point(const Point &p);
00157
00158 Envelope::AutoPtr computeEnvelopeInternal() const;
00159
00160 int compareToSameClass(const Geometry *p) const;
00161
00162 private:
00163
00167 std::auto_ptr<CoordinateSequence> coordinates;
00168 };
00169
00170 }
00171 }
00172
00173
00174
00175
00176
00177 #ifdef _MSC_VER
00178 #pragma warning(pop)
00179 #endif
00180
00181 #endif // ndef GEOS_GEOS_POINT_H
00182