geos_390_docs/classgeos_1_1algorithm_1_1O...

224 lines
14 KiB
HTML

<!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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>GEOS: geos::algorithm::Orientation Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">GEOS
&#160;<span id="projectnumber">3.9.1dev</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacegeos.html">geos</a></li><li class="navelem"><a class="el" href="namespacegeos_1_1algorithm.html">algorithm</a></li><li class="navelem"><a class="el" href="classgeos_1_1algorithm_1_1Orientation.html">Orientation</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classgeos_1_1algorithm_1_1Orientation-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">geos::algorithm::Orientation Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Functions to compute the orientation of basic geometric structures including point triplets (triangles) and rings.
<a href="classgeos_1_1algorithm_1_1Orientation.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="Orientation_8h_source.html">Orientation.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a36890e95967fc02803d17dc7c6e232b5"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom">{ <br />
&#160;&#160;<a class="el" href="classgeos_1_1algorithm_1_1Orientation.html#a36890e95967fc02803d17dc7c6e232b5a1c4c49924f5f3e1a814b1943006613a2">CLOCKWISE</a> = -1,
<a class="el" href="classgeos_1_1algorithm_1_1Orientation.html#a36890e95967fc02803d17dc7c6e232b5a6e8b6f908d14cfa3951435d421f29506">COLLINEAR</a> = 0,
<a class="el" href="classgeos_1_1algorithm_1_1Orientation.html#a36890e95967fc02803d17dc7c6e232b5ad7622a477e6e6bbf881fd3c3ac46fcb5">COUNTERCLOCKWISE</a> = 1,
<a class="el" href="classgeos_1_1algorithm_1_1Orientation.html#a36890e95967fc02803d17dc7c6e232b5a7f91a0fd332507d275e1331aad8903d7">RIGHT</a> = -1,
<br />
&#160;&#160;<a class="el" href="classgeos_1_1algorithm_1_1Orientation.html#a36890e95967fc02803d17dc7c6e232b5a427c42ea30af20913871777ed79ade89">LEFT</a> = 1,
<a class="el" href="classgeos_1_1algorithm_1_1Orientation.html#a36890e95967fc02803d17dc7c6e232b5a6d88407e13539fe9d16992f49ddbc64f">STRAIGHT</a> = 0
<br />
}</td></tr>
<tr class="separator:a36890e95967fc02803d17dc7c6e232b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a9ba62e9b01a7c97af6ba630910ffb3fe"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1Orientation.html#a9ba62e9b01a7c97af6ba630910ffb3fe">index</a> (const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &amp;p1, const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &amp;p2, const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &amp;q)</td></tr>
<tr class="memdesc:a9ba62e9b01a7c97af6ba630910ffb3fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the orientation index of the direction of the point q relative to a directed infinite line specified by p1-p2. <a href="#a9ba62e9b01a7c97af6ba630910ffb3fe">More...</a><br /></td></tr>
<tr class="separator:a9ba62e9b01a7c97af6ba630910ffb3fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5af93795969b80f97d7997195974d7c8"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1Orientation.html#a5af93795969b80f97d7997195974d7c8">isCCW</a> (const <a class="el" href="classgeos_1_1geom_1_1CoordinateSequence.html">geom::CoordinateSequence</a> *ring)</td></tr>
<tr class="separator:a5af93795969b80f97d7997195974d7c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Functions to compute the orientation of basic geometric structures including point triplets (triangles) and rings. </p>
<p><a class="el" href="classgeos_1_1algorithm_1_1Orientation.html" title="Functions to compute the orientation of basic geometric structures including point triplets (triangle...">Orientation</a> is a fundamental property of planar geometries (and more generally geometry on two-dimensional manifolds).</p>
<p><a class="el" href="classgeos_1_1algorithm_1_1Orientation.html" title="Functions to compute the orientation of basic geometric structures including point triplets (triangle...">Orientation</a> is notoriously subject to numerical precision errors in the case of collinear or nearly collinear points. JTS uses extended-precision arithmetic to increase the robustness of the computation.</p>
<dl class="section author"><dt>Author</dt><dd>Martin Davis </dd></dl>
<p>Definition at line <a class="el" href="Orientation_8h_source.html#l00043">43</a> of file <a class="el" href="Orientation_8h_source.html">Orientation.h</a>.</p>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a class="anchor" id="a36890e95967fc02803d17dc7c6e232b5"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">anonymous enum</td>
</tr>
</table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="a36890e95967fc02803d17dc7c6e232b5a1c4c49924f5f3e1a814b1943006613a2"></a>CLOCKWISE&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a36890e95967fc02803d17dc7c6e232b5a6e8b6f908d14cfa3951435d421f29506"></a>COLLINEAR&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a36890e95967fc02803d17dc7c6e232b5ad7622a477e6e6bbf881fd3c3ac46fcb5"></a>COUNTERCLOCKWISE&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a36890e95967fc02803d17dc7c6e232b5a7f91a0fd332507d275e1331aad8903d7"></a>RIGHT&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a36890e95967fc02803d17dc7c6e232b5a427c42ea30af20913871777ed79ade89"></a>LEFT&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a36890e95967fc02803d17dc7c6e232b5a6d88407e13539fe9d16992f49ddbc64f"></a>STRAIGHT&#160;</td><td class="fielddoc">
</td></tr>
</table>
<p>Definition at line <a class="el" href="Orientation_8h_source.html#l00047">47</a> of file <a class="el" href="Orientation_8h_source.html">Orientation.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a9ba62e9b01a7c97af6ba630910ffb3fe"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static int geos::algorithm::Orientation::index </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &amp;&#160;</td>
<td class="paramname"><em>p1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &amp;&#160;</td>
<td class="paramname"><em>p2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &amp;&#160;</td>
<td class="paramname"><em>q</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the orientation index of the direction of the point q relative to a directed infinite line specified by p1-p2. </p>
<p>The index indicates whether the point lies to the <code><a class="el" href="classgeos_1_1algorithm_1_1Orientation.html#a36890e95967fc02803d17dc7c6e232b5a427c42ea30af20913871777ed79ade89">Orientation::LEFT</a></code> or <code><a class="el" href="classgeos_1_1algorithm_1_1Orientation.html#a36890e95967fc02803d17dc7c6e232b5a7f91a0fd332507d275e1331aad8903d7">Orientation::RIGHT</a></code> of the line, or lies on it <code><a class="el" href="classgeos_1_1algorithm_1_1Orientation.html#a36890e95967fc02803d17dc7c6e232b5a6e8b6f908d14cfa3951435d421f29506">Orientation::COLLINEAR</a></code>. The index also indicates the orientation of the triangle formed by the three points ( <code><a class="el" href="classgeos_1_1algorithm_1_1Orientation.html#a36890e95967fc02803d17dc7c6e232b5ad7622a477e6e6bbf881fd3c3ac46fcb5">Orientation::COUNTERCLOCKWISE</a></code>, <code><a class="el" href="classgeos_1_1algorithm_1_1Orientation.html#a36890e95967fc02803d17dc7c6e232b5a1c4c49924f5f3e1a814b1943006613a2">Orientation::CLOCKWISE</a></code>, or <code><a class="el" href="classgeos_1_1algorithm_1_1Orientation.html#a36890e95967fc02803d17dc7c6e232b5a6d88407e13539fe9d16992f49ddbc64f">Orientation::STRAIGHT</a></code> ) </p>
</div>
</div>
<a class="anchor" id="a5af93795969b80f97d7997195974d7c8"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static bool geos::algorithm::Orientation::isCCW </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1CoordinateSequence.html">geom::CoordinateSequence</a> *&#160;</td>
<td class="paramname"><em>ring</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Computes whether a ring defined by a <a class="el" href="classgeos_1_1geom_1_1CoordinateSequence.html" title="The internal representation of a list of coordinates inside a Geometry. ">geom::CoordinateSequence</a> is oriented counter-clockwise.</p>
<ul>
<li>The list of points is assumed to have the first and last points equal.</li>
<li>This handles coordinate lists which contain repeated points.</li>
<li>This handles rings which contain collapsed segments (in particular, along the top of the ring).</li>
</ul>
<p>This algorithm is guaranteed to work with valid rings. It also works with "mildly invalid" rings which contain collapsed (coincident) flat segments along the top of the ring. If the ring is "more" invalid (e.g. self-crosses or touches), the computed result may not be correct.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ring</td><td>a CoordinateSequence forming a ring (with first and last point identical) </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if the ring is oriented counter-clockwise. </dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">IllegalArgumentException</td><td>if there are too few points to determine orientation (&lt; 4) </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="Orientation_8h_source.html">Orientation.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>