00001 /********************************************************************** 00002 * $Id: GeometricShapeFactory.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) 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_UTIL_GEOMETRICSHAPEFACTORY_H 00018 #define GEOS_UTIL_GEOMETRICSHAPEFACTORY_H 00019 00020 #include <cassert> 00021 00022 #include <geos/geom/Coordinate.h> 00023 00024 // Forward declarations 00025 namespace geos { 00026 namespace geom { 00027 class Envelope; 00028 class Polygon; 00029 class GeometryFactory; 00030 class LineString; 00031 } 00032 } 00033 00034 namespace geos { 00035 namespace util { // geos::util 00036 00037 00047 class GeometricShapeFactory { 00048 private: 00049 class Dimensions { 00050 public: 00051 Dimensions(); 00052 geom::Coordinate base; 00053 geom::Coordinate centre; 00054 double width; 00055 double height; 00056 void setBase(const geom::Coordinate& newBase); 00057 void setCentre(const geom::Coordinate& newCentre); 00058 void setSize(double size); 00059 void setWidth(double nWidth); 00060 void setHeight(double nHeight); 00061 geom::Envelope* getEnvelope(); 00062 }; 00063 const geom::GeometryFactory* geomFact; 00064 Dimensions dim; 00065 int nPts; 00066 public: 00077 GeometricShapeFactory(const geom::GeometryFactory *factory); 00078 00079 ~GeometricShapeFactory(); 00080 00086 geom::LineString* createArc(double startAng, double endAng); 00087 00093 geom::Polygon* createCircle(); 00094 00100 geom::Polygon* createRectangle(); 00101 00110 void setBase(const geom::Coordinate& base); 00111 00119 void setCentre(const geom::Coordinate& centre); 00120 00126 void setHeight(double height); 00127 00131 void setNumPoints(int nNPts); 00132 00139 void setSize(double size); 00140 00146 void setWidth(double width); 00147 00148 }; 00149 00150 } // namespace geos::util 00151 } // namespace geos 00152 00153 #endif // GEOS_UTIL_GEOMETRICSHAPEFACTORY_H 00154 00155 /********************************************************************** 00156 * $Log$ 00157 * Revision 1.1 2006/03/09 16:46:49 strk 00158 * geos::geom namespace definition, first pass at headers split 00159 * 00160 **********************************************************************/