GEOS 3.2.2
|
00001 /********************************************************************** 00002 * $Id: GeometryCollection.h 2556 2009-06-06 22:22:28Z 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 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 } // namespace geos::geom 00198 } // namespace geos 00199 00200 #ifdef GEOS_INLINE 00201 # include "geos/geom/GeometryCollection.inl" 00202 #endif 00203 00204 #endif // ndef GEOS_GEOS_GEOMETRYCOLLECTION_H 00205 00206 /********************************************************************** 00207 * $Log$ 00208 * Revision 1.8 2006/06/12 10:10:39 strk 00209 * Fixed getGeometryN() to take size_t rather then int, changed unsigned int parameters to size_t. 00210 * 00211 * Revision 1.7 2006/05/04 15:49:39 strk 00212 * updated all Geometry::getDimension() methods to return Dimension::DimensionType (closes bug#93) 00213 * 00214 * Revision 1.6 2006/04/28 10:55:39 strk 00215 * Geometry constructors made protected, to ensure all constructions use GeometryFactory, 00216 * which has been made friend of all Geometry derivates. getNumPoints() changed to return 00217 * size_t. 00218 * 00219 * Revision 1.5 2006/04/10 18:15:09 strk 00220 * Changed Geometry::envelope member to be of type auto_ptr<Envelope>. 00221 * Changed computeEnvelopeInternal() signater to return auto_ptr<Envelope> 00222 * 00223 * Revision 1.4 2006/04/07 09:54:30 strk 00224 * Geometry::getNumGeometries() changed to return 'unsigned int' 00225 * rather then 'int' 00226 * 00227 * Revision 1.3 2006/03/24 09:52:41 strk 00228 * USE_INLINE => GEOS_INLINE 00229 * 00230 * Revision 1.2 2006/03/23 12:12:01 strk 00231 * Fixes to allow build with -DGEOS_INLINE 00232 * 00233 * Revision 1.1 2006/03/09 16:46:49 strk 00234 * geos::geom namespace definition, first pass at headers split 00235 * 00236 **********************************************************************/