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