00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef GEOS_GEOS_GEOMETRYCOLLECTION_H
00018 #define GEOS_GEOS_GEOMETRYCOLLECTION_H
00019
00020 #include <geos/geom/Geometry.h>
00021
00022 #include <geos/geom/Envelope.h>
00023 #include <geos/geom/Dimension.h>
00024
00025 #include <geos/inline.h>
00026
00027 #include <string>
00028 #include <vector>
00029 #include <memory>
00030
00031
00032 namespace geos {
00033 namespace geom {
00034 class Coordinate;
00035 class CoordinateArraySequence;
00036 }
00037 }
00038
00039 namespace geos {
00040 namespace geom {
00041
00051 class GeometryCollection : public Geometry {
00052
00053 public:
00054 friend class GeometryFactory;
00055
00056 typedef std::vector<Geometry *>::const_iterator const_iterator;
00057
00058 typedef std::vector<Geometry *>::iterator iterator;
00059
00060 const_iterator begin() const;
00061
00062 const_iterator end() const;
00063
00064 virtual Geometry *clone() const {
00065 return new GeometryCollection(*this);
00066 }
00067
00068 virtual ~GeometryCollection();
00069
00083 virtual CoordinateSequence* getCoordinates() const;
00084
00085 virtual bool isEmpty() const;
00086
00094 virtual Dimension::DimensionType getDimension() const;
00095
00096 virtual Geometry* getBoundary() const;
00097
00103 virtual int getBoundaryDimension() const;
00104
00105 virtual size_t getNumPoints() const;
00106
00107 virtual std::string getGeometryType() const;
00108
00109 virtual GeometryTypeId getGeometryTypeId() const;
00110
00111 virtual bool isSimple() const;
00112
00113 virtual bool equalsExact(const Geometry *other,
00114 double tolerance=0) const;
00115
00116 virtual void apply_ro(CoordinateFilter *filter) const;
00117
00118 virtual void apply_rw(const CoordinateFilter *filter);
00119
00120 virtual void apply_ro(GeometryFilter *filter) const;
00121
00122 virtual void apply_rw(GeometryFilter *filter);
00123
00124 virtual void apply_ro(GeometryComponentFilter *filter) const;
00125
00126 virtual void apply_rw(GeometryComponentFilter *filter);
00127
00128 virtual void normalize();
00129
00130 virtual const Coordinate* getCoordinate() const;
00131
00133 virtual double getArea() const;
00134
00136 virtual double getLength() const;
00137
00139 virtual size_t getNumGeometries() const;
00140
00142 virtual const Geometry* getGeometryN(size_t n) const;
00143
00144 protected:
00145
00146 GeometryCollection(const GeometryCollection &gc);
00147
00172 GeometryCollection(std::vector<Geometry *> *newGeoms, const GeometryFactory *newFactory);
00173
00174
00175 std::vector<Geometry *>* geometries;
00176
00177 virtual Envelope::AutoPtr computeEnvelopeInternal() const;
00178
00179 virtual int compareToSameClass(const Geometry *gc) const;
00180
00181 };
00182
00183 }
00184 }
00185
00186 #ifdef GEOS_INLINE
00187 # include "geos/geom/GeometryCollection.inl"
00188 #endif
00189
00190 #endif // ndef GEOS_GEOS_GEOMETRYCOLLECTION_H
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222