#include <GeometricShapeFactory.h>
Public Member Functions | |
GeometricShapeFactory (const geom::GeometryFactory *factory) | |
Create a shape factory which will create shapes using the given GeometryFactory. | |
geom::LineString * | createArc (double startAng, double angExtent) |
Creates an elliptical arc, as a LineString. | |
geom::Polygon * | createArcPolygon (double startAng, double angExt) |
Creates an elliptical arc polygon. | |
geom::Polygon * | createCircle () |
Creates a circular Polygon. | |
geom::Polygon * | createRectangle () |
Creates a rectangular Polygon. | |
void | setBase (const geom::Coordinate &base) |
Sets the location of the shape by specifying the base coordinate (which in most cases is the * lower left point of the envelope containing the shape). | |
void | setCentre (const geom::Coordinate ¢re) |
Sets the location of the shape by specifying the centre of the shape's bounding box. | |
void | setHeight (double height) |
Sets the height of the shape. | |
void | setNumPoints (int nNPts) |
Sets the total number of points in the created Geometry. | |
void | setSize (double size) |
Sets the size of the extent of the shape in both x and y directions. | |
void | setWidth (double width) |
Sets the width of the shape. | |
Protected Member Functions | |
geom::Coordinate | createCoord (double x, double y) const |
Protected Attributes | |
const geom::GeometryFactory * | geomFact |
const geom::PrecisionModel * | precModel |
Dimensions | dim |
int | nPts |
Allows various ways of specifying the location and extent of the shapes, as well as number of line segments used to form them.
Example:
GeometricShapeFactory gsf(factory); gsf.setSize(100); gsf.setNumPoints(100); gsf.setBase(Coordinate(0, 0)); std::auto_ptr<Polygon> rect ( gsf.createRectangle() );
|
Create a shape factory which will create shapes using the given GeometryFactory.
|
|
Creates an elliptical arc, as a LineString. The arc is always created in a counter-clockwise direction.
|
|
Creates an elliptical arc polygon. The polygon is formed from the specified arc of an ellipse and the two radii connecting the endpoints to the centre of the ellipse.
|
|
Creates a circular Polygon.
|
|
Creates a rectangular Polygon.
|
|
Sets the location of the shape by specifying the base coordinate (which in most cases is the * lower left point of the envelope containing the shape).
|
|
Sets the location of the shape by specifying the centre of the shape's bounding box.
|
|
Sets the height of the shape.
|
|
Sets the size of the extent of the shape in both x and y directions.
|
|
Sets the width of the shape.
|