00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GEOS_UTIL_GEOMETRICSHAPEFACTORY_H
00022 #define GEOS_UTIL_GEOMETRICSHAPEFACTORY_H
00023
00024 #include <geos/export.h>
00025 #include <cassert>
00026
00027 #include <geos/geom/Coordinate.h>
00028
00029 #ifdef _MSC_VER
00030 #pragma warning(push)
00031 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00032 #endif
00033
00034
00035 namespace geos {
00036 namespace geom {
00037 class Coordinate;
00038 class Envelope;
00039 class Polygon;
00040 class GeometryFactory;
00041 class PrecisionModel;
00042 class LineString;
00043 }
00044 }
00045
00046 namespace geos {
00047 namespace util {
00048
00049
00066 class GEOS_DLL GeometricShapeFactory {
00067 protected:
00068 class Dimensions {
00069 public:
00070 Dimensions();
00071 geom::Coordinate base;
00072 geom::Coordinate centre;
00073 double width;
00074 double height;
00075 void setBase(const geom::Coordinate& newBase);
00076 void setCentre(const geom::Coordinate& newCentre);
00077 void setSize(double size);
00078 void setWidth(double nWidth);
00079 void setHeight(double nHeight);
00080
00081
00082 geom::Envelope* getEnvelope() const;
00083 };
00084 const geom::GeometryFactory* geomFact;
00085 const geom::PrecisionModel* precModel;
00086 Dimensions dim;
00087 int nPts;
00088
00089 geom::Coordinate coord(double x, double y) const;
00090
00091 public:
00092
00103 GeometricShapeFactory(const geom::GeometryFactory *factory);
00104
00105 virtual ~GeometricShapeFactory() {}
00106
00116 geom::LineString* createArc(double startAng, double angExtent);
00117
00129 geom::Polygon* createArcPolygon(double startAng, double angExt);
00130
00136 geom::Polygon* createCircle();
00137
00143 geom::Polygon* createRectangle();
00144
00153 void setBase(const geom::Coordinate& base);
00154
00162 void setCentre(const geom::Coordinate& centre);
00163
00169 void setHeight(double height);
00170
00174 void setNumPoints(int nNPts);
00175
00182 void setSize(double size);
00183
00189 void setWidth(double width);
00190
00191 };
00192
00193 }
00194 }
00195
00196 #ifdef _MSC_VER
00197 #pragma warning(pop)
00198 #endif
00199
00200 #endif // GEOS_UTIL_GEOMETRICSHAPEFACTORY_H