Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 5035839f674c88dea1f7928a86fbdc64 > files > 892

geos-devel-3.2.1-3.fc14.x86_64.rpm

<!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::index::chain::MonotoneChain 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&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;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&nbsp;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;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_1index.html">index</a>      </li>
      <li><a class="el" href="namespacegeos_1_1index_1_1chain.html">chain</a>      </li>
      <li><a class="el" href="classgeos_1_1index_1_1chain_1_1MonotoneChain.html">geos::index::chain::MonotoneChain</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::index::chain::MonotoneChain Class Reference</h1>  </div>
</div>
<div class="contents">
<!-- doxytag: class="geos::index::chain::MonotoneChain" -->
<p>Monotone Chains are a way of partitioning the segments of a linestring to allow for fast searching of intersections.  
<a href="#_details">More...</a></p>

<p><code>#include &lt;<a class="el" href="index_2chain_2MonotoneChain_8h_source.html">MonotoneChain.h</a>&gt;</code></p>

<p><a href="classgeos_1_1index_1_1chain_1_1MonotoneChain-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">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1index_1_1chain_1_1MonotoneChain.html#aa3d43c9c78b3acdc3fd93b19b290edaf">MonotoneChain</a> (const <a class="el" href="classgeos_1_1geom_1_1CoordinateSequence.html">geom::CoordinateSequence</a> &amp;pts, size_t start, size_t end, void *context)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a70f06550014e08d74faf224c39295553"></a><!-- doxytag: member="geos::index::chain::MonotoneChain::getEnvelope" ref="a70f06550014e08d74faf224c39295553" args="() const " -->
const <a class="el" href="classgeos_1_1geom_1_1Envelope.html">geom::Envelope</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1index_1_1chain_1_1MonotoneChain.html#a70f06550014e08d74faf224c39295553">getEnvelope</a> () const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returned envelope is owned by this class. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8f9b66d5416b9c17274a1212262ae8b9"></a><!-- doxytag: member="geos::index::chain::MonotoneChain::getStartIndex" ref="a8f9b66d5416b9c17274a1212262ae8b9" args="() const " -->
size_t&nbsp;</td><td class="memItemRight" valign="bottom"><b>getStartIndex</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad2f9c7ca87dfda7c55341ec920d0eecf"></a><!-- doxytag: member="geos::index::chain::MonotoneChain::getEndIndex" ref="ad2f9c7ca87dfda7c55341ec920d0eecf" args="() const " -->
size_t&nbsp;</td><td class="memItemRight" valign="bottom"><b>getEndIndex</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abaf4457d5efd754633057345bb00c727"></a><!-- doxytag: member="geos::index::chain::MonotoneChain::getLineSegment" ref="abaf4457d5efd754633057345bb00c727" args="(size_t index, geom::LineSegment &amp;ls) const " -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1index_1_1chain_1_1MonotoneChain.html#abaf4457d5efd754633057345bb00c727">getLineSegment</a> (size_t index, <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">geom::LineSegment</a> &amp;ls) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set given LineSegment with points of the segment starting at the given index. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::auto_ptr<br class="typebreak"/>
&lt; <a class="el" href="classgeos_1_1geom_1_1CoordinateSequence.html">geom::CoordinateSequence</a> &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1index_1_1chain_1_1MonotoneChain.html#a3c4e9a07da7d3248930c1aa5d52ad504">getCoordinates</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1index_1_1chain_1_1MonotoneChain.html#ad8826d97738a452d4aa5f4891b15e824">select</a> (const <a class="el" href="classgeos_1_1geom_1_1Envelope.html">geom::Envelope</a> &amp;searchEnv, <a class="el" href="classgeos_1_1index_1_1chain_1_1MonotoneChainSelectAction.html">MonotoneChainSelectAction</a> &amp;mcs)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad59d76855224a0ef343da7a8e2102eab"></a><!-- doxytag: member="geos::index::chain::MonotoneChain::computeOverlaps" ref="ad59d76855224a0ef343da7a8e2102eab" args="(MonotoneChain *mc, MonotoneChainOverlapAction *mco)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>computeOverlaps</b> (<a class="el" href="classgeos_1_1index_1_1chain_1_1MonotoneChain.html">MonotoneChain</a> *mc, <a class="el" href="classgeos_1_1index_1_1chain_1_1MonotoneChainOverlapAction.html">MonotoneChainOverlapAction</a> *mco)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a88677ce5251bd5922b8a4b46b1ee1136"></a><!-- doxytag: member="geos::index::chain::MonotoneChain::setId" ref="a88677ce5251bd5922b8a4b46b1ee1136" args="(int nId)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>setId</b> (int nId)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4d302f81cdf85882273f924e648da59c"></a><!-- doxytag: member="geos::index::chain::MonotoneChain::getId" ref="a4d302f81cdf85882273f924e648da59c" args="() const " -->
int&nbsp;</td><td class="memItemRight" valign="bottom"><b>getId</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af6b31fc51b9b3516235732e011f99652"></a><!-- doxytag: member="geos::index::chain::MonotoneChain::getContext" ref="af6b31fc51b9b3516235732e011f99652" args="()" -->
void *&nbsp;</td><td class="memItemRight" valign="bottom"><b>getContext</b> ()</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Monotone Chains are a way of partitioning the segments of a linestring to allow for fast searching of intersections. </p>
<p>They have the following properties:</p>
<ul>
<li>the segments within a monotone chain never intersect each other</li>
<li>the envelope of any contiguous subset of the segments in a monotone chain is equal to the envelope of the endpoints of the subset.</li>
</ul>
<p>Property 1 means that there is no need to test pairs of segments from within the same monotone chain for intersection. Property 2 allows an efficient binary search to be used to find the intersection points of two monotone chains.</p>
<p>For many types of real-world data, these properties eliminate a large number of segment comparisons, producing substantial speed gains.</p>
<p>One of the goals of this implementation of MonotoneChains is to be as space and time efficient as possible. One design choice that aids this is that a <a class="el" href="classgeos_1_1index_1_1chain_1_1MonotoneChain.html" title="Monotone Chains are a way of partitioning the segments of a linestring to allow for fast searching of...">MonotoneChain</a> is based on a subarray of a list of points. This means that new arrays of points (potentially very large) do not have to be allocated.</p>
<p>MonotoneChains support the following kinds of queries:</p>
<ul>
<li>Envelope select: determine all the segments in the chain which intersect a given envelope</li>
<li>Overlap: determine all the pairs of segments in two chains whose envelopes overlap</li>
</ul>
<p>This implementation of MonotoneChains uses the concept of internal iterators to return the resultsets for the above queries. This has time and space advantages, since it is not necessary to build lists of instantiated objects to represent the segments returned by the query. However, it does mean that the queries are not thread-safe. </p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aa3d43c9c78b3acdc3fd93b19b290edaf"></a><!-- doxytag: member="geos::index::chain::MonotoneChain::MonotoneChain" ref="aa3d43c9c78b3acdc3fd93b19b290edaf" args="(const geom::CoordinateSequence &amp;pts, size_t start, size_t end, void *context)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">geos::index::chain::MonotoneChain::MonotoneChain </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1CoordinateSequence.html">geom::CoordinateSequence</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>pts</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>start</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>end</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>context</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pts</em>&nbsp;</td><td>Ownership left to caller, this class holds a reference.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>start</em>&nbsp;</td><td></td></tr>
    <tr><td valign="top"></td><td valign="top"><em>end</em>&nbsp;</td><td></td></tr>
    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>Ownership left to caller, this class holds a reference. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a3c4e9a07da7d3248930c1aa5d52ad504"></a><!-- doxytag: member="geos::index::chain::MonotoneChain::getCoordinates" ref="a3c4e9a07da7d3248930c1aa5d52ad504" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::auto_ptr&lt;<a class="el" href="classgeos_1_1geom_1_1CoordinateSequence.html">geom::CoordinateSequence</a>&gt; geos::index::chain::MonotoneChain::getCoordinates </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Return the subsequence of coordinates forming this chain. Allocates a new CoordinateSequence to hold the Coordinates </p>

</div>
</div>
<a class="anchor" id="ad8826d97738a452d4aa5f4891b15e824"></a><!-- doxytag: member="geos::index::chain::MonotoneChain::select" ref="ad8826d97738a452d4aa5f4891b15e824" args="(const geom::Envelope &amp;searchEnv, MonotoneChainSelectAction &amp;mcs)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void geos::index::chain::MonotoneChain::select </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Envelope.html">geom::Envelope</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>searchEnv</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classgeos_1_1index_1_1chain_1_1MonotoneChainSelectAction.html">MonotoneChainSelectAction</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>mcs</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Determine all the line segments in the chain whose envelopes overlap the searchEnvelope, and process them </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="index_2chain_2MonotoneChain_8h_source.html">index/chain/MonotoneChain.h</a></li>
</ul>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Thu Jul 22 2010 for GEOS by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address>
</body>
</html>