<!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::algorithm::CentroidArea 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><a class="el" href="namespacegeos_1_1algorithm.html">algorithm</a> </li> <li><a class="el" href="classgeos_1_1algorithm_1_1CentroidArea.html">geos::algorithm::CentroidArea</a> </li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> </div> <div class="headertitle"> <h1>geos::algorithm::CentroidArea Class Reference</h1> </div> </div> <div class="contents"> <!-- doxytag: class="geos::algorithm::CentroidArea" --> <p>Computes the centroid of an area geometry. <a href="#_details">More...</a></p> <p><code>#include <<a class="el" href="geosAlgorithm_8h_source.html">geos/geosAlgorithm.h</a>></code></p> <p><a href="classgeos_1_1algorithm_1_1CentroidArea-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">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1CentroidArea.html#a3453f5cd603fdbf9680b90bbe918f216">add</a> (const <a class="el" href="classgeos_1_1geom_1_1Geometry.html">geom::Geometry</a> *geom)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1CentroidArea.html#a57305fbb2a2bb84e2e5bd790c028a98a">add</a> (const <a class="el" href="classgeos_1_1geom_1_1CoordinateSequence.html">geom::CoordinateSequence</a> *ring)</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5bf54b5d65fe560663bee230c42222b6"></a><!-- doxytag: member="geos::algorithm::CentroidArea::getCentroid" ref="a5bf54b5d65fe560663bee230c42222b6" args="() const " --> <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> * </td><td class="memItemRight" valign="bottom"><b>getCentroid</b> () const </td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a04d4c6d5fd06fec2fe9cb95749ad0aa7"></a><!-- doxytag: member="geos::algorithm::CentroidArea::getCentroid" ref="a04d4c6d5fd06fec2fe9cb95749ad0aa7" args="(geom::Coordinate &ret) const " --> bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1CentroidArea.html#a04d4c6d5fd06fec2fe9cb95749ad0aa7">getCentroid</a> (<a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &ret) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return false if a centroid couldn't be computed. <br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>Computes the centroid of an area geometry. </p> <p>Algorithm:</p> <p>Based on the usual algorithm for calculating the centroid as a weighted sum of the centroids of a decomposition of the area into (possibly overlapping) triangles. The algorithm has been extended to handle holes and multi-polygons. See <code><a href="http://www.faqs.org/faqs/graphics/algorithms-faq/">http://www.faqs.org/faqs/graphics/algorithms-faq/</a></code> for further details of the basic approach. </p> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a3453f5cd603fdbf9680b90bbe918f216"></a><!-- doxytag: member="geos::algorithm::CentroidArea::add" ref="a3453f5cd603fdbf9680b90bbe918f216" args="(const geom::Geometry *geom)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void geos::algorithm::CentroidArea::add </td> <td>(</td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Geometry.html">geom::Geometry</a> * </td> <td class="paramname"> <em>geom</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Adds the area defined by a Geometry to the centroid total. If the geometry has no area it does not contribute to the centroid.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>geom</em> </td><td>the geometry to add </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a57305fbb2a2bb84e2e5bd790c028a98a"></a><!-- doxytag: member="geos::algorithm::CentroidArea::add" ref="a57305fbb2a2bb84e2e5bd790c028a98a" args="(const geom::CoordinateSequence *ring)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void geos::algorithm::CentroidArea::add </td> <td>(</td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1CoordinateSequence.html">geom::CoordinateSequence</a> * </td> <td class="paramname"> <em>ring</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Adds the area defined by an array of coordinates. The array must be a ring; i.e. end with the same coordinate as it starts with. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>ring</em> </td><td>an array of <a class="el" href="">Coordinate</a>s </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="CentroidArea_8h_source.html">CentroidArea.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>