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
00031 namespace geos {
00032 namespace geom {
00033 class Coordinate;
00034 class Envelope;
00035 class Polygon;
00036 class GeometryFactory;
00037 class PrecisionModel;
00038 class LineString;
00039 }
00040 }
00041
00042 namespace geos {
00043 namespace util {
00044
00045
00062 class GEOS_DLL GeometricShapeFactory {
00063 protected:
00064 class Dimensions {
00065 public:
00066 Dimensions();
00067 geom::Coordinate base;
00068 geom::Coordinate centre;
00069 double width;
00070 double height;
00071 void setBase(const geom::Coordinate& newBase);
00072 void setCentre(const geom::Coordinate& newCentre);
00073 void setSize(double size);
00074 void setWidth(double nWidth);
00075 void setHeight(double nHeight);
00076
00077
00078 geom::Envelope* getEnvelope();
00079 };
00080 const geom::GeometryFactory* geomFact;
00081 const geom::PrecisionModel* precModel;
00082 Dimensions dim;
00083 int nPts;
00084
00085 geom::Coordinate createCoord(double x, double y) const;
00086
00087 public:
00088
00099 GeometricShapeFactory(const geom::GeometryFactory *factory);
00100
00101 ~GeometricShapeFactory();
00102
00112 geom::LineString* createArc(double startAng, double angExtent);
00113
00125 geom::Polygon* createArcPolygon(double startAng, double angExt);
00126
00132 geom::Polygon* createCircle();
00133
00139 geom::Polygon* createRectangle();
00140
00149 void setBase(const geom::Coordinate& base);
00150
00158 void setCentre(const geom::Coordinate& centre);
00159
00165 void setHeight(double height);
00166
00170 void setNumPoints(int nNPts);
00171
00178 void setSize(double size);
00179
00185 void setWidth(double width);
00186
00187 };
00188
00189 }
00190 }
00191
00192 #endif // GEOS_UTIL_GEOMETRICSHAPEFACTORY_H
00193
00194
00195
00196
00197
00198
00199