GeometryCollection.h

00001 /**********************************************************************
00002  * $Id: GeometryCollection.h 1820 2006-09-06 16:54:23Z mloskot $
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 #ifndef GEOS_GEOS_GEOMETRYCOLLECTION_H
00018 #define GEOS_GEOS_GEOMETRYCOLLECTION_H
00019 
00020 #include <geos/geom/Geometry.h> // for inheritance
00021 //#include <geos/platform.h>
00022 #include <geos/geom/Envelope.h> // for proper use of auto_ptr<>
00023 #include <geos/geom/Dimension.h> // for Dimension::DimensionType
00024 
00025 #include <geos/inline.h>
00026 
00027 #include <string>
00028 #include <vector>
00029 #include <memory> // for auto_ptr
00030 
00031 // Forward declarations
00032 namespace geos {
00033         namespace geom { // geos::geom
00034                 class Coordinate;
00035                 class CoordinateArraySequence;
00036         }
00037 }
00038 
00039 namespace geos {
00040 namespace geom { // geos::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 } // namespace geos::geom
00184 } // namespace geos
00185 
00186 #ifdef GEOS_INLINE
00187 # include "geos/geom/GeometryCollection.inl"
00188 #endif
00189 
00190 #endif // ndef GEOS_GEOS_GEOMETRYCOLLECTION_H
00191 
00192 /**********************************************************************
00193  * $Log$
00194  * Revision 1.8  2006/06/12 10:10:39  strk
00195  * Fixed getGeometryN() to take size_t rather then int, changed unsigned int parameters to size_t.
00196  *
00197  * Revision 1.7  2006/05/04 15:49:39  strk
00198  * updated all Geometry::getDimension() methods to return Dimension::DimensionType (closes bug#93)
00199  *
00200  * Revision 1.6  2006/04/28 10:55:39  strk
00201  * Geometry constructors made protected, to ensure all constructions use GeometryFactory,
00202  * which has been made friend of all Geometry derivates. getNumPoints() changed to return
00203  * size_t.
00204  *
00205  * Revision 1.5  2006/04/10 18:15:09  strk
00206  * Changed Geometry::envelope member to be of type auto_ptr<Envelope>.
00207  * Changed computeEnvelopeInternal() signater to return auto_ptr<Envelope>
00208  *
00209  * Revision 1.4  2006/04/07 09:54:30  strk
00210  * Geometry::getNumGeometries() changed to return 'unsigned int'
00211  * rather then 'int'
00212  *
00213  * Revision 1.3  2006/03/24 09:52:41  strk
00214  * USE_INLINE => GEOS_INLINE
00215  *
00216  * Revision 1.2  2006/03/23 12:12:01  strk
00217  * Fixes to allow build with -DGEOS_INLINE
00218  *
00219  * Revision 1.1  2006/03/09 16:46:49  strk
00220  * geos::geom namespace definition, first pass at headers split
00221  *
00222  **********************************************************************/

Generated on Fri Mar 27 04:52:44 2009 for GEOS by  doxygen 1.5.4