GEOS
3.3.6
|
00001 /********************************************************************** 00002 * $Id: GeometryCollection.h 3185 2011-02-07 15:39:27Z strk $ 00003 * 00004 * GEOS - Geometry Engine Open Source 00005 * http://geos.refractions.net 00006 * 00007 * Copyright (C) 2001-2002 Vivid Solutions Inc. 00008 * Copyright (C) 2005 2006 Refractions Research Inc. 00009 * 00010 * This is free software; you can redistribute and/or modify it under 00011 * the terms of the GNU Lesser General Public Licence as published 00012 * by the Free Software Foundation. 00013 * See the COPYING file for more information. 00014 * 00015 ********************************************************************** 00016 * 00017 * Last port: geom/GeometryCollection.java rev. 1.41 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> // for inheritance 00026 //#include <geos/platform.h> 00027 #include <geos/geom/Envelope.h> // for proper use of auto_ptr<> 00028 #include <geos/geom/Dimension.h> // for Dimension::DimensionType 00029 00030 #include <geos/inline.h> 00031 00032 #include <string> 00033 #include <vector> 00034 #include <memory> // for auto_ptr 00035 00036 // Forward declarations 00037 namespace geos { 00038 namespace geom { // geos::geom 00039 class Coordinate; 00040 class CoordinateArraySequence; 00041 class CoordinateSequenceFilter; 00042 } 00043 } 00044 00045 namespace geos { 00046 namespace geom { // geos::geom 00047 00057 class GEOS_DLL GeometryCollection : public virtual 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 00109 virtual int getCoordinateDimension() const; 00110 00111 virtual Geometry* getBoundary() const; 00112 00118 virtual int getBoundaryDimension() const; 00119 00120 virtual std::size_t getNumPoints() const; 00121 00122 virtual std::string getGeometryType() const; 00123 00124 virtual GeometryTypeId getGeometryTypeId() const; 00125 00126 virtual bool equalsExact(const Geometry *other, 00127 double tolerance=0) const; 00128 00129 virtual void apply_ro(CoordinateFilter *filter) const; 00130 00131 virtual void apply_rw(const CoordinateFilter *filter); 00132 00133 virtual void apply_ro(GeometryFilter *filter) const; 00134 00135 virtual void apply_rw(GeometryFilter *filter); 00136 00137 virtual void apply_ro(GeometryComponentFilter *filter) const; 00138 00139 virtual void apply_rw(GeometryComponentFilter *filter); 00140 00141 virtual void apply_rw(CoordinateSequenceFilter& filter); 00142 00143 virtual void apply_ro(CoordinateSequenceFilter& filter) const; 00144 00145 virtual void normalize(); 00146 00147 virtual const Coordinate* getCoordinate() const; 00148 00150 virtual double getArea() const; 00151 00153 virtual double getLength() const; 00154 00156 virtual std::size_t getNumGeometries() const; 00157 00159 virtual const Geometry* getGeometryN(std::size_t n) const; 00160 00161 protected: 00162 00163 GeometryCollection(const GeometryCollection &gc); 00164 00189 GeometryCollection(std::vector<Geometry *> *newGeoms, const GeometryFactory *newFactory); 00190 00191 00192 std::vector<Geometry *>* geometries; 00193 00194 virtual Envelope::AutoPtr computeEnvelopeInternal() const; 00195 00196 virtual int compareToSameClass(const Geometry *gc) const; 00197 00198 }; 00199 00200 } // namespace geos::geom 00201 } // namespace geos 00202 00203 #ifdef GEOS_INLINE 00204 # include "geos/geom/GeometryCollection.inl" 00205 #endif 00206 00207 #endif // ndef GEOS_GEOS_GEOMETRYCOLLECTION_H 00208 00209 /********************************************************************** 00210 * $Log$ 00211 * Revision 1.8 2006/06/12 10:10:39 strk 00212 * Fixed getGeometryN() to take size_t rather then int, changed unsigned int parameters to size_t. 00213 * 00214 * Revision 1.7 2006/05/04 15:49:39 strk 00215 * updated all Geometry::getDimension() methods to return Dimension::DimensionType (closes bug#93) 00216 * 00217 * Revision 1.6 2006/04/28 10:55:39 strk 00218 * Geometry constructors made protected, to ensure all constructions use GeometryFactory, 00219 * which has been made friend of all Geometry derivates. getNumPoints() changed to return 00220 * size_t. 00221 * 00222 * Revision 1.5 2006/04/10 18:15:09 strk 00223 * Changed Geometry::envelope member to be of type auto_ptr<Envelope>. 00224 * Changed computeEnvelopeInternal() signater to return auto_ptr<Envelope> 00225 * 00226 * Revision 1.4 2006/04/07 09:54:30 strk 00227 * Geometry::getNumGeometries() changed to return 'unsigned int' 00228 * rather then 'int' 00229 * 00230 * Revision 1.3 2006/03/24 09:52:41 strk 00231 * USE_INLINE => GEOS_INLINE 00232 * 00233 * Revision 1.2 2006/03/23 12:12:01 strk 00234 * Fixes to allow build with -DGEOS_INLINE 00235 * 00236 * Revision 1.1 2006/03/09 16:46:49 strk 00237 * geos::geom namespace definition, first pass at headers split 00238 * 00239 **********************************************************************/