GEOS 3.3.1
|
00001 /********************************************************************** 00002 * $Id: GeometryTransformer.h 3179 2011-02-03 19:59:23Z strk $ 00003 * 00004 * GEOS - Geometry Engine Open Source 00005 * http://geos.refractions.net 00006 * 00007 * Copyright (C) 2011 Sandro Santilli <strk@keybit.net> 00008 * Copyright (C) 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/util/GeometryTransformer.java r320 (JTS-1.12) 00018 * 00019 **********************************************************************/ 00020 00021 #ifndef GEOS_GEOM_UTIL_GEOMETRYTRANSFORMER_H 00022 #define GEOS_GEOM_UTIL_GEOMETRYTRANSFORMER_H 00023 00024 00025 #include <geos/export.h> 00026 #include <geos/geom/Coordinate.h> // destructor visibility for vector 00027 #include <geos/geom/Geometry.h> // destructor visibility for auto_ptr 00028 #include <geos/geom/CoordinateSequence.h> // destructor visibility for auto_ptr 00029 00030 #include <memory> // for auto_ptr 00031 #include <vector> 00032 00033 // Forward declarations 00034 namespace geos { 00035 namespace geom { 00036 class Geometry; 00037 class GeometryFactory; 00038 class Point; 00039 class LinearRing; 00040 class LineString; 00041 class Polygon; 00042 class MultiPoint; 00043 class MultiPolygon; 00044 class MultiLineString; 00045 class GeometryCollection; 00046 namespace util { 00047 //class GeometryEditorOperation; 00048 } 00049 } 00050 } 00051 00052 00053 namespace geos { 00054 namespace geom { // geos.geom 00055 namespace util { // geos.geom.util 00056 00093 class GEOS_DLL GeometryTransformer { 00094 00095 public: 00096 00097 GeometryTransformer(); 00098 00099 virtual ~GeometryTransformer(); 00100 00101 std::auto_ptr<Geometry> transform(const Geometry* nInputGeom); 00102 00103 protected: 00104 00105 const GeometryFactory* factory; 00106 00116 CoordinateSequence::AutoPtr createCoordinateSequence( 00117 std::auto_ptr< std::vector<Coordinate> > coords); 00118 00119 virtual CoordinateSequence::AutoPtr transformCoordinates( 00120 const CoordinateSequence* coords, 00121 const Geometry* parent); 00122 00123 virtual Geometry::AutoPtr transformPoint( 00124 const Point* geom, 00125 const Geometry* parent); 00126 00127 virtual Geometry::AutoPtr transformMultiPoint( 00128 const MultiPoint* geom, 00129 const Geometry* parent); 00130 00131 virtual Geometry::AutoPtr transformLinearRing( 00132 const LinearRing* geom, 00133 const Geometry* parent); 00134 00135 virtual Geometry::AutoPtr transformLineString( 00136 const LineString* geom, 00137 const Geometry* parent); 00138 00139 virtual Geometry::AutoPtr transformMultiLineString( 00140 const MultiLineString* geom, 00141 const Geometry* parent); 00142 00143 virtual Geometry::AutoPtr transformPolygon( 00144 const Polygon* geom, 00145 const Geometry* parent); 00146 00147 virtual Geometry::AutoPtr transformMultiPolygon( 00148 const MultiPolygon* geom, 00149 const Geometry* parent); 00150 00151 virtual Geometry::AutoPtr transformGeometryCollection( 00152 const GeometryCollection* geom, 00153 const Geometry* parent); 00154 00155 private: 00156 00157 const Geometry* inputGeom; 00158 00159 // these could eventually be exposed to clients 00163 bool pruneEmptyGeometry; 00164 00170 bool preserveGeometryCollectionType; 00171 00175 bool preserveCollections; 00176 00180 bool preserveType; 00181 00182 // Declare type as noncopyable 00183 GeometryTransformer(const GeometryTransformer& other); 00184 GeometryTransformer& operator=(const GeometryTransformer& rhs); 00185 }; 00186 00187 00188 } // namespace geos.geom.util 00189 } // namespace geos.geom 00190 } // namespace geos 00191 00192 //#ifdef GEOS_INLINE 00193 //# include "geos/geom/util/GeometryTransformer.inl" 00194 //#endif 00195 00196 #endif // GEOS_GEOM_UTIL_GEOMETRYTRANSFORMER_H 00197 00198 /********************************************************************** 00199 * $Log$ 00200 * Revision 1.4 2006/06/19 21:20:22 strk 00201 * updated port info 00202 * 00203 * Revision 1.3 2006/04/13 14:25:17 strk 00204 * TopologyPreservingSimplifier initial port 00205 * 00206 * Revision 1.2 2006/04/11 12:56:06 strk 00207 * used typedef for auto_ptr<CoordinateSequence> 00208 * 00209 * Revision 1.1 2006/04/11 12:21:49 strk 00210 * GeometryTransformer class ported 00211 * 00212 **********************************************************************/