<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>GEOS: geos::util::GeometricShapeFactory Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.1 --> <div class="navigation" id="top"> <div class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"> <ul> <li><a class="el" href="namespacegeos.html">geos</a> </li> <li><b>util</b> </li> <li><a class="el" href="classgeos_1_1util_1_1GeometricShapeFactory.html">geos::util::GeometricShapeFactory</a> </li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="#pro-methods">Protected Member Functions</a> | <a href="#pro-attribs">Protected Attributes</a> </div> <div class="headertitle"> <h1>geos::util::GeometricShapeFactory Class Reference</h1> </div> </div> <div class="contents"> <!-- doxytag: class="geos::util::GeometricShapeFactory" --> <p><code>#include <<a class="el" href="GeometricShapeFactory_8h_source.html">GeometricShapeFactory.h</a>></code></p> <p><a href="classgeos_1_1util_1_1GeometricShapeFactory-members.html">List of all members.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1util_1_1GeometricShapeFactory.html#a9fac9a737c8cd2e09af385bb888ce342">GeometricShapeFactory</a> (const <a class="el" href="classgeos_1_1geom_1_1GeometryFactory.html">geom::GeometryFactory</a> *factory)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Create a shape factory which will create shapes using the given GeometryFactory. <a href="#a9fac9a737c8cd2e09af385bb888ce342"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classgeos_1_1geom_1_1LineString.html">geom::LineString</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1util_1_1GeometricShapeFactory.html#aebb96aee1bf5fbbb611e94efda582d33">createArc</a> (double startAng, double angExtent)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Creates an elliptical arc, as a LineString. <a href="#aebb96aee1bf5fbbb611e94efda582d33"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classgeos_1_1geom_1_1Polygon.html">geom::Polygon</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1util_1_1GeometricShapeFactory.html#a6e3ea890bb880355e5533c73e0665e61">createArcPolygon</a> (double startAng, double angExt)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Creates an elliptical arc polygon. <a href="#a6e3ea890bb880355e5533c73e0665e61"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classgeos_1_1geom_1_1Polygon.html">geom::Polygon</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1util_1_1GeometricShapeFactory.html#a4f7f7fe1a377524331910fceef35ecf6">createCircle</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a circular Polygon. <a href="#a4f7f7fe1a377524331910fceef35ecf6"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classgeos_1_1geom_1_1Polygon.html">geom::Polygon</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1util_1_1GeometricShapeFactory.html#a143aa24fb3c65de96209958c239483ee">createRectangle</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a rectangular Polygon. <a href="#a143aa24fb3c65de96209958c239483ee"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1util_1_1GeometricShapeFactory.html#aad95a032c50aec9b69745fa7c43fa159">setBase</a> (const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &base)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">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). <a href="#aad95a032c50aec9b69745fa7c43fa159"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1util_1_1GeometricShapeFactory.html#ad929f4e8e67abb2eec93e74b75e28b4f">setCentre</a> (const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &centre)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the location of the shape by specifying the centre of the shape's bounding box. <a href="#ad929f4e8e67abb2eec93e74b75e28b4f"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1util_1_1GeometricShapeFactory.html#a6dc74ac42aa17c255f0bc16ab1c2c2bf">setHeight</a> (double height)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the height of the shape. <a href="#a6dc74ac42aa17c255f0bc16ab1c2c2bf"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa4469de5d05ad0e84e7642dadbd38a4d"></a><!-- doxytag: member="geos::util::GeometricShapeFactory::setNumPoints" ref="aa4469de5d05ad0e84e7642dadbd38a4d" args="(int nNPts)" --> void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1util_1_1GeometricShapeFactory.html#aa4469de5d05ad0e84e7642dadbd38a4d">setNumPoints</a> (int nNPts)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the total number of points in the created Geometry. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1util_1_1GeometricShapeFactory.html#afe0bace531c1bc91cc0a1258a3792065">setSize</a> (double size)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the size of the extent of the shape in both x and y directions. <a href="#afe0bace531c1bc91cc0a1258a3792065"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1util_1_1GeometricShapeFactory.html#ac4db7b39da6729f69694d449eb076aac">setWidth</a> (double width)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the width of the shape. <a href="#ac4db7b39da6729f69694d449eb076aac"></a><br/></td></tr> <tr><td colspan="2"><h2><a name="pro-methods"></a> Protected Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abd29e76d39126521144cfaecc5423104"></a><!-- doxytag: member="geos::util::GeometricShapeFactory::createCoord" ref="abd29e76d39126521144cfaecc5423104" args="(double x, double y) const " --> <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> </td><td class="memItemRight" valign="bottom"><b>createCoord</b> (double x, double y) const </td></tr> <tr><td colspan="2"><h2><a name="pro-attribs"></a> Protected Attributes</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1529aff383507036beee05a77f865571"></a><!-- doxytag: member="geos::util::GeometricShapeFactory::geomFact" ref="a1529aff383507036beee05a77f865571" args="" --> const <a class="el" href="classgeos_1_1geom_1_1GeometryFactory.html">geom::GeometryFactory</a> * </td><td class="memItemRight" valign="bottom"><b>geomFact</b></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a139cd7f3f5bb64026f5ecc82da8eef22"></a><!-- doxytag: member="geos::util::GeometricShapeFactory::precModel" ref="a139cd7f3f5bb64026f5ecc82da8eef22" args="" --> const <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html">geom::PrecisionModel</a> * </td><td class="memItemRight" valign="bottom"><b>precModel</b></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a96c913c99343c6a9c3ae33ecc8471d1c"></a><!-- doxytag: member="geos::util::GeometricShapeFactory::dim" ref="a96c913c99343c6a9c3ae33ecc8471d1c" args="" --> Dimensions </td><td class="memItemRight" valign="bottom"><b>dim</b></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4f389f7afb06650e36153f2942e60cd7"></a><!-- doxytag: member="geos::util::GeometricShapeFactory::nPts" ref="a4f389f7afb06650e36153f2942e60cd7" args="" --> int </td><td class="memItemRight" valign="bottom"><b>nPts</b></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>Computes various kinds of common geometric shapes.</p> <p>Allows various ways of specifying the location and extent of the shapes, as well as number of line segments used to form them.</p> <p>Example: </p> <pre> <a class="el" href="classgeos_1_1util_1_1GeometricShapeFactory.html">GeometricShapeFactory</a> gsf(factory); gsf.setSize(100); gsf.setNumPoints(100); gsf.setBase(Coordinate(0, 0)); std::auto_ptr<Polygon> rect ( gsf.createRectangle() ); </pre> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a9fac9a737c8cd2e09af385bb888ce342"></a><!-- doxytag: member="geos::util::GeometricShapeFactory::GeometricShapeFactory" ref="a9fac9a737c8cd2e09af385bb888ce342" args="(const geom::GeometryFactory *factory)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">geos::util::GeometricShapeFactory::GeometricShapeFactory </td> <td>(</td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1GeometryFactory.html">geom::GeometryFactory</a> * </td> <td class="paramname"> <em>factory</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Create a shape factory which will create shapes using the given GeometryFactory. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>factory</em> </td><td>the factory to use. You need to keep the factory alive for the whole <a class="el" href="classgeos_1_1util_1_1GeometricShapeFactory.html">GeometricShapeFactory</a> life time. </td></tr> </table> </dd> </dl> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="aebb96aee1bf5fbbb611e94efda582d33"></a><!-- doxytag: member="geos::util::GeometricShapeFactory::createArc" ref="aebb96aee1bf5fbbb611e94efda582d33" args="(double startAng, double angExtent)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classgeos_1_1geom_1_1LineString.html">geom::LineString</a>* geos::util::GeometricShapeFactory::createArc </td> <td>(</td> <td class="paramtype">double </td> <td class="paramname"> <em>startAng</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"> <em>angExtent</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Creates an elliptical arc, as a LineString. </p> <p>The arc is always created in a counter-clockwise direction.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>startAng</em> </td><td>start angle in radians </td></tr> <tr><td valign="top"></td><td valign="top"><em>angExtent</em> </td><td>size of angle in radians </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>an elliptical arc </dd></dl> </div> </div> <a class="anchor" id="a6e3ea890bb880355e5533c73e0665e61"></a><!-- doxytag: member="geos::util::GeometricShapeFactory::createArcPolygon" ref="a6e3ea890bb880355e5533c73e0665e61" args="(double startAng, double angExt)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classgeos_1_1geom_1_1Polygon.html">geom::Polygon</a>* geos::util::GeometricShapeFactory::createArcPolygon </td> <td>(</td> <td class="paramtype">double </td> <td class="paramname"> <em>startAng</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"> <em>angExt</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Creates an elliptical arc polygon. </p> <p>The polygon is formed from the specified arc of an ellipse and the two radii connecting the endpoints to the centre of the ellipse.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>startAng</em> </td><td>start angle in radians </td></tr> <tr><td valign="top"></td><td valign="top"><em>angExtent</em> </td><td>size of angle in radians </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>an elliptical arc polygon </dd></dl> </div> </div> <a class="anchor" id="a4f7f7fe1a377524331910fceef35ecf6"></a><!-- doxytag: member="geos::util::GeometricShapeFactory::createCircle" ref="a4f7f7fe1a377524331910fceef35ecf6" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classgeos_1_1geom_1_1Polygon.html">geom::Polygon</a>* geos::util::GeometricShapeFactory::createCircle </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Creates a circular Polygon. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>a circle </dd></dl> </div> </div> <a class="anchor" id="a143aa24fb3c65de96209958c239483ee"></a><!-- doxytag: member="geos::util::GeometricShapeFactory::createRectangle" ref="a143aa24fb3c65de96209958c239483ee" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classgeos_1_1geom_1_1Polygon.html">geom::Polygon</a>* geos::util::GeometricShapeFactory::createRectangle </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Creates a rectangular Polygon. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>a rectangular Polygon </dd></dl> </div> </div> <a class="anchor" id="aad95a032c50aec9b69745fa7c43fa159"></a><!-- doxytag: member="geos::util::GeometricShapeFactory::setBase" ref="aad95a032c50aec9b69745fa7c43fa159" args="(const geom::Coordinate &base)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void geos::util::GeometricShapeFactory::setBase </td> <td>(</td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> & </td> <td class="paramname"> <em>base</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>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). </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>base</em> </td><td>the base coordinate of the shape </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="ad929f4e8e67abb2eec93e74b75e28b4f"></a><!-- doxytag: member="geos::util::GeometricShapeFactory::setCentre" ref="ad929f4e8e67abb2eec93e74b75e28b4f" args="(const geom::Coordinate &centre)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void geos::util::GeometricShapeFactory::setCentre </td> <td>(</td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> & </td> <td class="paramname"> <em>centre</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Sets the location of the shape by specifying the centre of the shape's bounding box. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>centre</em> </td><td>the centre coordinate of the shape </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a6dc74ac42aa17c255f0bc16ab1c2c2bf"></a><!-- doxytag: member="geos::util::GeometricShapeFactory::setHeight" ref="a6dc74ac42aa17c255f0bc16ab1c2c2bf" args="(double height)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void geos::util::GeometricShapeFactory::setHeight </td> <td>(</td> <td class="paramtype">double </td> <td class="paramname"> <em>height</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Sets the height of the shape. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>height</em> </td><td>the height of the shape </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="afe0bace531c1bc91cc0a1258a3792065"></a><!-- doxytag: member="geos::util::GeometricShapeFactory::setSize" ref="afe0bace531c1bc91cc0a1258a3792065" args="(double size)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void geos::util::GeometricShapeFactory::setSize </td> <td>(</td> <td class="paramtype">double </td> <td class="paramname"> <em>size</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Sets the size of the extent of the shape in both x and y directions. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>size</em> </td><td>the size of the shape's extent </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="ac4db7b39da6729f69694d449eb076aac"></a><!-- doxytag: member="geos::util::GeometricShapeFactory::setWidth" ref="ac4db7b39da6729f69694d449eb076aac" args="(double width)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void geos::util::GeometricShapeFactory::setWidth </td> <td>(</td> <td class="paramtype">double </td> <td class="paramname"> <em>width</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Sets the width of the shape. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>width</em> </td><td>the width of the shape </td></tr> </table> </dd> </dl> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="GeometricShapeFactory_8h_source.html">GeometricShapeFactory.h</a></li> </ul> </div> <hr class="footer"/><address class="footer"><small>Generated on Thu Jul 22 2010 for GEOS by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address> </body> </html>