00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GEOS_GEOS_GEOMETRYCOLLECTION_H
00022 #define GEOS_GEOS_GEOMETRYCOLLECTION_H
00023
00024 #include <geos/export.h>
00025 #include <geos/geom/Geometry.h>
00026
00027 #include <geos/geom/Envelope.h>
00028 #include <geos/geom/Dimension.h>
00029
00030 #include <geos/inline.h>
00031
00032 #include <string>
00033 #include <vector>
00034 #include <memory>
00035
00036
00037 namespace geos {
00038 namespace geom {
00039 class Coordinate;
00040 class CoordinateArraySequence;
00041 class CoordinateSequenceFilter;
00042 }
00043 }
00044
00045 namespace geos {
00046 namespace geom {
00047
00057 class GEOS_DLL GeometryCollection : public Geometry {
00058
00059 public:
00060 friend class GeometryFactory;
00061
00062 typedef std::vector<Geometry *>::const_iterator const_iterator;
00063
00064 typedef std::vector<Geometry *>::iterator iterator;
00065
00066 const_iterator begin() const;
00067
00068 const_iterator end() const;
00069
00076 virtual Geometry *clone() const {
00077 return new GeometryCollection(*this);
00078 }
00079
00080 virtual ~GeometryCollection();
00081
00095 virtual CoordinateSequence* getCoordinates() const;
00096
00097 virtual bool isEmpty() const;
00098
00106 virtual Dimension::DimensionType getDimension() const;
00107
00108 virtual Geometry* getBoundary() const;
00109
00115 virtual int getBoundaryDimension() const;
00116
00117 virtual size_t getNumPoints() const;
00118
00119 virtual std::string getGeometryType() const;
00120
00121 virtual GeometryTypeId getGeometryTypeId() const;
00122
00123 virtual bool equalsExact(const Geometry *other,
00124 double tolerance=0) const;
00125
00126 virtual void apply_ro(CoordinateFilter *filter) const;
00127
00128 virtual void apply_rw(const CoordinateFilter *filter);
00129
00130 virtual void apply_ro(GeometryFilter *filter) const;
00131
00132 virtual void apply_rw(GeometryFilter *filter);
00133
00134 virtual void apply_ro(GeometryComponentFilter *filter) const;
00135
00136 virtual void apply_rw(GeometryComponentFilter *filter);
00137
00138 virtual void apply_rw(CoordinateSequenceFilter& filter);
00139
00140 virtual void apply_ro(CoordinateSequenceFilter& filter) const;
00141
00142 virtual void normalize();
00143
00144 virtual const Coordinate* getCoordinate() const;
00145
00147 virtual double getArea() const;
00148
00150 virtual double getLength() const;
00151
00153 virtual size_t getNumGeometries() const;
00154
00156 virtual const Geometry* getGeometryN(size_t n) const;
00157
00158 protected:
00159
00160 GeometryCollection(const GeometryCollection &gc);
00161
00186 GeometryCollection(std::vector<Geometry *> *newGeoms, const GeometryFactory *newFactory);
00187
00188
00189 std::vector<Geometry *>* geometries;
00190
00191 virtual Envelope::AutoPtr computeEnvelopeInternal() const;
00192
00193 virtual int compareToSameClass(const Geometry *gc) const;
00194
00195 };
00196
00197 }
00198 }
00199
00200 #ifdef GEOS_INLINE
00201 # include "geos/geom/GeometryCollection.inl"
00202 #endif
00203
00204 #endif // ndef GEOS_GEOS_GEOMETRYCOLLECTION_H
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236