GEOS
3.6.2
|
00001 /********************************************************************** 00002 * 00003 * GEOS - Geometry Engine Open Source 00004 * http://geos.osgeo.org 00005 * 00006 * Copyright (C) 2001-2002 Vivid Solutions Inc. 00007 * Copyright (C) 2005 2006 Refractions Research Inc. 00008 * 00009 * This is free software; you can redistribute and/or modify it under 00010 * the terms of the GNU Lesser General Public Licence as published 00011 * by the Free Software Foundation. 00012 * See the COPYING file for more information. 00013 * 00014 ********************************************************************** 00015 * 00016 * Last port: geom/GeometryCollection.java rev. 1.41 00017 * 00018 **********************************************************************/ 00019 00020 #ifndef GEOS_GEOS_GEOMETRYCOLLECTION_H 00021 #define GEOS_GEOS_GEOMETRYCOLLECTION_H 00022 00023 #include <geos/export.h> 00024 #include <geos/geom/Geometry.h> // for inheritance 00025 //#include <geos/platform.h> 00026 #include <geos/geom/Envelope.h> // for proper use of auto_ptr<> 00027 #include <geos/geom/Dimension.h> // for Dimension::DimensionType 00028 00029 #include <geos/inline.h> 00030 00031 #include <string> 00032 #include <vector> 00033 #include <memory> // for auto_ptr 00034 00035 // Forward declarations 00036 namespace geos { 00037 namespace geom { // geos::geom 00038 class Coordinate; 00039 class CoordinateArraySequence; 00040 class CoordinateSequenceFilter; 00041 } 00042 } 00043 00044 namespace geos { 00045 namespace geom { // geos::geom 00046 00056 class GEOS_DLL GeometryCollection : public virtual Geometry { 00057 00058 public: 00059 friend class GeometryFactory; 00060 00061 typedef std::vector<Geometry *>::const_iterator const_iterator; 00062 00063 typedef std::vector<Geometry *>::iterator iterator; 00064 00065 const_iterator begin() const; 00066 00067 const_iterator end() const; 00068 00075 virtual Geometry *clone() const { 00076 return new GeometryCollection(*this); 00077 } 00078 00079 virtual ~GeometryCollection(); 00080 00094 virtual CoordinateSequence* getCoordinates() const; 00095 00096 virtual bool isEmpty() const; 00097 00105 virtual Dimension::DimensionType getDimension() const; 00106 00108 virtual int getCoordinateDimension() const; 00109 00110 virtual Geometry* getBoundary() const; 00111 00117 virtual int getBoundaryDimension() const; 00118 00119 virtual std::size_t getNumPoints() const; 00120 00121 virtual std::string getGeometryType() const; 00122 00123 virtual GeometryTypeId getGeometryTypeId() const; 00124 00125 virtual bool equalsExact(const Geometry *other, 00126 double tolerance=0) const; 00127 00128 virtual void apply_ro(CoordinateFilter *filter) const; 00129 00130 virtual void apply_rw(const CoordinateFilter *filter); 00131 00132 virtual void apply_ro(GeometryFilter *filter) const; 00133 00134 virtual void apply_rw(GeometryFilter *filter); 00135 00136 virtual void apply_ro(GeometryComponentFilter *filter) const; 00137 00138 virtual void apply_rw(GeometryComponentFilter *filter); 00139 00140 virtual void apply_rw(CoordinateSequenceFilter& filter); 00141 00142 virtual void apply_ro(CoordinateSequenceFilter& filter) const; 00143 00144 virtual void normalize(); 00145 00146 virtual const Coordinate* getCoordinate() const; 00147 00149 virtual double getArea() const; 00150 00152 virtual double getLength() const; 00153 00155 virtual std::size_t getNumGeometries() const; 00156 00158 virtual const Geometry* getGeometryN(std::size_t n) const; 00159 00160 protected: 00161 00162 GeometryCollection(const GeometryCollection &gc); 00163 00188 GeometryCollection(std::vector<Geometry *> *newGeoms, const GeometryFactory *newFactory); 00189 00190 00191 std::vector<Geometry *>* geometries; 00192 00193 Envelope::AutoPtr computeEnvelopeInternal() const; 00194 00195 int compareToSameClass(const Geometry *gc) const; 00196 00197 }; 00198 00199 } // namespace geos::geom 00200 } // namespace geos 00201 00202 #ifdef GEOS_INLINE 00203 # include "geos/geom/GeometryCollection.inl" 00204 #endif 00205 00206 #endif // ndef GEOS_GEOS_GEOMETRYCOLLECTION_H