/usr/include/geos/util/GeometricShapeFactory.h is in libgeos-dev 3.2.2-3ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | /**********************************************************************
* $Id: GeometricShapeFactory.h 2556 2009-06-06 22:22:28Z strk $
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
*
* Copyright (C) 2001-2002 Vivid Solutions Inc.
* Copyright (C) 2006 Refractions Research Inc.
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************
*
* Last port: util/GeometricShapeFactory.java rev 1.14 (JTS-1.10+)
* (2009-03-19)
*
**********************************************************************/
#ifndef GEOS_UTIL_GEOMETRICSHAPEFACTORY_H
#define GEOS_UTIL_GEOMETRICSHAPEFACTORY_H
#include <geos/export.h>
#include <cassert>
#include <geos/geom/Coordinate.h>
// Forward declarations
namespace geos {
namespace geom {
class Coordinate;
class Envelope;
class Polygon;
class GeometryFactory;
class PrecisionModel;
class LineString;
}
}
namespace geos {
namespace util { // geos::util
/**
* Computes various kinds of common geometric shapes.
*
* Allows various ways of specifying the location and extent of the shapes,
* as well as number of line segments used to form them.
*
* Example:
* <pre>
* GeometricShapeFactory gsf(factory);
* gsf.setSize(100);
* gsf.setNumPoints(100);
* gsf.setBase(Coordinate(0, 0));
* std::auto_ptr<Polygon> rect ( gsf.createRectangle() );
* </pre>
*
*/
class GEOS_DLL GeometricShapeFactory {
protected:
class Dimensions {
public:
Dimensions();
geom::Coordinate base;
geom::Coordinate centre;
double width;
double height;
void setBase(const geom::Coordinate& newBase);
void setCentre(const geom::Coordinate& newCentre);
void setSize(double size);
void setWidth(double nWidth);
void setHeight(double nHeight);
// Return newly-allocated object, ownership transferred
geom::Envelope* getEnvelope();
};
const geom::GeometryFactory* geomFact; // externally owned
const geom::PrecisionModel* precModel; // externally owned
Dimensions dim;
int nPts;
geom::Coordinate createCoord(double x, double y) const;
public:
/**
* \brief
* Create a shape factory which will create shapes using the given
* GeometryFactory.
*
* @param factory the factory to use. You need to keep the
* factory alive for the whole GeometricShapeFactory
* life time.
*
*/
GeometricShapeFactory(const geom::GeometryFactory *factory);
~GeometricShapeFactory();
/**
* \brief Creates an elliptical arc, as a LineString.
*
* The arc is always created in a counter-clockwise direction.
*
* @param startAng start angle in radians
* @param angExtent size of angle in radians
* @return an elliptical arc
*/
geom::LineString* createArc(double startAng, double angExtent);
/**
* \brief 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.
*
* @param startAng start angle in radians
* @param angExtent size of angle in radians
* @return an elliptical arc polygon
*/
geom::Polygon* createArcPolygon(double startAng, double angExt);
/**
* \brief Creates a circular Polygon.
*
* @return a circle
*/
geom::Polygon* createCircle();
/**
* \brief Creates a rectangular Polygon.
*
* @return a rectangular Polygon
*/
geom::Polygon* createRectangle();
/**
* \brief
* 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).
*
* @param base the base coordinate of the shape
*/
void setBase(const geom::Coordinate& base);
/**
* \brief
* Sets the location of the shape by specifying the centre of
* the shape's bounding box
*
* @param centre the centre coordinate of the shape
*/
void setCentre(const geom::Coordinate& centre);
/**
* \brief Sets the height of the shape.
*
* @param height the height of the shape
*/
void setHeight(double height);
/**
* \brief Sets the total number of points in the created Geometry
*/
void setNumPoints(int nNPts);
/**
* \brief
* Sets the size of the extent of the shape in both x and y directions.
*
* @param size the size of the shape's extent
*/
void setSize(double size);
/**
* \brief Sets the width of the shape.
*
* @param width the width of the shape
*/
void setWidth(double width);
};
} // namespace geos::util
} // namespace geos
#endif // GEOS_UTIL_GEOMETRICSHAPEFACTORY_H
/**********************************************************************
* $Log$
* Revision 1.1 2006/03/09 16:46:49 strk
* geos::geom namespace definition, first pass at headers split
*
**********************************************************************/
|