geos_390_docs/Rectangle_8h_source.html

84 lines
38 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: Rectangle.h Source File</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><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_0bc14b2fb119a11b6a0f32f4d350db61.html">geos</a></li><li class="navelem"><a class="el" href="dir_cc91dd2a378845bf7e3e6edb554afff8.html">operation</a></li><li class="navelem"><a class="el" href="dir_01fd903a2cfb74b790d35b57f102aed3.html">intersection</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Rectangle.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="Rectangle_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/**********************************************************************</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> * GEOS - Geometry Engine Open Source</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * http://geos.osgeo.org</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Copyright (C) 2014 Mika Heiskanen &lt;mika.heiskanen@fmi.fi&gt;</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * This is free software; you can redistribute and/or modify it under</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * the terms of the GNU Lesser General Public Licence as published</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * by the Free Software Foundation.</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> * See the COPYING file for more information.</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> **********************************************************************/</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;</div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="preprocessor">#ifndef GEOS_OP_INTERSECTION_RECTANGLE_H</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="preprocessor">#define GEOS_OP_INTERSECTION_RECTANGLE_H</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="export_8h.html">geos/export.h</a>&gt;</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#ifdef _MSC_VER</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#pragma warning(push)</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="comment">// Forward declarations</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacegeos.html">geos</a> {</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="keyword">namespace </span>geom {</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="keyword">class </span>GeometryFactory;</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="keyword">class </span>Geometry;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="keyword">class </span>Polygon;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="keyword">class </span>LinearRing;</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;}</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;}</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacegeos.html">geos</a> {</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="keyword">namespace </span>operation { <span class="comment">// geos::operation</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="keyword">namespace </span>intersection { <span class="comment">// geos::operation::intersection</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html"> 51</a></span>&#160;<span class="keyword">class </span><a class="code" href="export_8h.html#ae36df939090171f6e9a28a8cb6254fea">GEOS_DLL</a> <a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html">Rectangle</a> {</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html">Rectangle</a>(<span class="keywordtype">double</span> x1, <span class="keywordtype">double</span> y1, <span class="keywordtype">double</span> x2, <span class="keywordtype">double</span> y2);</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="keywordtype">double</span></div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#aa5b87d939c6f5e1d580b828fdcfcdd8a"> 70</a></span>&#160; <a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#aa5b87d939c6f5e1d580b828fdcfcdd8a">xmin</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="keywordflow">return</span> xMin;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; }</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keywordtype">double</span></div><div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ae5751bc8bd4ebfb979bf73211d59e02c"> 80</a></span>&#160; <a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ae5751bc8bd4ebfb979bf73211d59e02c">ymin</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="keywordflow">return</span> yMin;</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; }</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="keywordtype">double</span></div><div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ab7463dc82a25f081d33c91de7e937ce0"> 91</a></span>&#160; <a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ab7463dc82a25f081d33c91de7e937ce0">xmax</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keywordflow">return</span> xMax;</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; }</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <span class="keywordtype">double</span></div><div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#a87d5674171357305fb2599e80b6c96fc"> 102</a></span>&#160; <a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#a87d5674171357305fb2599e80b6c96fc">ymax</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <span class="keywordflow">return</span> yMax;</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; }</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <a class="code" href="classgeos_1_1geom_1_1Polygon.html">geom::Polygon</a>* toPolygon(<span class="keyword">const</span> <a class="code" href="classgeos_1_1geom_1_1GeometryFactory.html">geom::GeometryFactory</a>&amp; f) <span class="keyword">const</span>;</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <a class="code" href="classgeos_1_1geom_1_1LinearRing.html">geom::LinearRing</a>* toLinearRing(<span class="keyword">const</span> <a class="code" href="classgeos_1_1geom_1_1GeometryFactory.html">geom::GeometryFactory</a>&amp; f) <span class="keyword">const</span>;</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;</div><div class="line"><a name="l00120"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ac456ee3b1edf3996072d5b16d84150dc"> 120</a></span>&#160; <span class="keyword">enum</span> <a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ac456ee3b1edf3996072d5b16d84150dc">Position</a> {</div><div class="line"><a name="l00121"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ac456ee3b1edf3996072d5b16d84150dca8185d72d66f5d3711a9d23698026d946"> 121</a></span>&#160; Inside = 1,</div><div class="line"><a name="l00122"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ac456ee3b1edf3996072d5b16d84150dcaa148ee6984bc1c1e6cc06181fda1fc30"> 122</a></span>&#160; Outside = 2,</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;</div><div class="line"><a name="l00124"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ac456ee3b1edf3996072d5b16d84150dca2668870db162eb3cde51d81c2206df3f"> 124</a></span>&#160; Left = 4,</div><div class="line"><a name="l00125"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ac456ee3b1edf3996072d5b16d84150dcaf95c00cc5c43ede820a6c2c78bee425e"> 125</a></span>&#160; Top = 8,</div><div class="line"><a name="l00126"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ac456ee3b1edf3996072d5b16d84150dca3b34fed67bcc70298f39ee2c1c1767d1"> 126</a></span>&#160; Right = 16,</div><div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ac456ee3b1edf3996072d5b16d84150dcaf94a581f67efe35c55977223b9ddde46"> 127</a></span>&#160; Bottom = 32,</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;</div><div class="line"><a name="l00129"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ac456ee3b1edf3996072d5b16d84150dca7fdbaad68e2a557d0efaf30a849b0ffb"> 129</a></span>&#160; TopLeft = Top | Left, <span class="comment">// 12</span></div><div class="line"><a name="l00130"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ac456ee3b1edf3996072d5b16d84150dcab9399418277d6a7fc4e441f34b8ec199"> 130</a></span>&#160; TopRight = Top | Right, <span class="comment">// 24</span></div><div class="line"><a name="l00131"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ac456ee3b1edf3996072d5b16d84150dca4b7bf9f4fb50aed073a1734886e09f9f"> 131</a></span>&#160; BottomLeft = Bottom | Left, <span class="comment">// 36</span></div><div class="line"><a name="l00132"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ac456ee3b1edf3996072d5b16d84150dcadf8a0398e22a82f2f92ab76c812fe473"> 132</a></span>&#160; BottomRight = Bottom | Right <span class="comment">// 48</span></div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; };</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <span class="keyword">static</span> <span class="keywordtype">bool</span></div><div class="line"><a name="l00142"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#a77facc8dce2b41887d11f35e660fb463"> 142</a></span>&#160; <a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#a77facc8dce2b41887d11f35e660fb463">onEdge</a>(<a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ac456ee3b1edf3996072d5b16d84150dc">Position</a> pos)</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; {</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <span class="keywordflow">return</span> (pos &gt; Outside);</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; }</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <span class="keyword">static</span> <span class="keywordtype">bool</span></div><div class="line"><a name="l00155"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#aa2b60d016a4153e8f5b2b9aca5ba8f1a"> 155</a></span>&#160; <a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#aa2b60d016a4153e8f5b2b9aca5ba8f1a">onSameEdge</a>(<a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ac456ee3b1edf3996072d5b16d84150dc">Position</a> pos1, <a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ac456ee3b1edf3996072d5b16d84150dc">Position</a> pos2)</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; {</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <span class="keywordflow">return</span> onEdge(<a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ac456ee3b1edf3996072d5b16d84150dc">Position</a>(pos1 &amp; pos2));</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; }</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ac456ee3b1edf3996072d5b16d84150dc">Position</a></div><div class="line"><a name="l00168"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#a1189ddf34745aec6b1fc50a218dafe12"> 168</a></span>&#160; <a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#a1189ddf34745aec6b1fc50a218dafe12">position</a>(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y)<span class="keyword"> const</span></div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <span class="comment">// We assume the point to be inside and test it first</span></div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <span class="keywordflow">if</span>(x &gt; xMin &amp;&amp; x &lt; xMax &amp;&amp; y &gt; yMin &amp;&amp; y &lt; yMax) {</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; <span class="keywordflow">return</span> Inside;</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; }</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <span class="comment">// Next we assume the point to be outside and test it next</span></div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="keywordflow">if</span>(x &lt; xMin || x &gt; xMax || y &lt; yMin || y &gt; yMax) {</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="keywordflow">return</span> Outside;</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; }</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; <span class="comment">// Slower cases</span></div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pos = 0;</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <span class="keywordflow">if</span>(x == xMin) {</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; pos |= Left;</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; }</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span>(x == xMax) {</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; pos |= Right;</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; }</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <span class="keywordflow">if</span>(y == yMin) {</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; pos |= Bottom;</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; }</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span>(y == yMax) {</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; pos |= Top;</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; }</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ac456ee3b1edf3996072d5b16d84150dc">Position</a>(pos);</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; }</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160;</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; <span class="keyword">static</span> <a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ac456ee3b1edf3996072d5b16d84150dc">Position</a></div><div class="line"><a name="l00202"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#a61f1bb4b9a8a31439d343e4e7bb807ae"> 202</a></span>&#160; <a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#a61f1bb4b9a8a31439d343e4e7bb807ae">nextEdge</a>(<a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ac456ee3b1edf3996072d5b16d84150dc">Position</a> pos)</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; {</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; <span class="keywordflow">switch</span>(pos) {</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <span class="keywordflow">case</span> BottomLeft:</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; <span class="keywordflow">case</span> Left:</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; <span class="keywordflow">return</span> Top;</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; <span class="keywordflow">case</span> TopLeft:</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; <span class="keywordflow">case</span> Top:</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; <span class="keywordflow">return</span> Right;</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; <span class="keywordflow">case</span> TopRight:</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; <span class="keywordflow">case</span> Right:</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; <span class="keywordflow">return</span> Bottom;</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; <span class="keywordflow">case</span> BottomRight:</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; <span class="keywordflow">case</span> Bottom:</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; <span class="keywordflow">return</span> Left;</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; <span class="comment">/* silences compiler warnings, Inside &amp; Outside are not handled explicitly */</span></div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; <span class="keywordflow">default</span>:</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; <span class="keywordflow">return</span> pos;</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; }</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; }</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160;</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160;</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; <a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html">Rectangle</a>();</div><div class="line"><a name="l00226"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#a40a4b9b3586403272feb01c4fc2fdb8d"> 226</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#a40a4b9b3586403272feb01c4fc2fdb8d">xMin</a>;</div><div class="line"><a name="l00227"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#a77d9664db7d45ef3a8559ef3cb653042"> 227</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#a77d9664db7d45ef3a8559ef3cb653042">yMin</a>;</div><div class="line"><a name="l00228"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#a58ded076e8a4b5c63c7a7bda9b341e85"> 228</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#a58ded076e8a4b5c63c7a7bda9b341e85">xMax</a>;</div><div class="line"><a name="l00229"></a><span class="lineno"><a class="line" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ab986e3d06cdda728e85751743b657fed"> 229</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ab986e3d06cdda728e85751743b657fed">yMax</a>;</div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160;</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160;}; <span class="comment">// class RectangleIntersection</span></div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160;</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160;} <span class="comment">// namespace geos::operation::intersection</span></div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160;} <span class="comment">// namespace geos::operation</span></div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160;} <span class="comment">// namespace geos</span></div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160;</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160;<span class="preprocessor">#endif // GEOS_OP_INTERSECTION_RECTANGLE_H</span></div><div class="ttc" id="classgeos_1_1operation_1_1intersection_1_1Rectangle_html_a61f1bb4b9a8a31439d343e4e7bb807ae"><div class="ttname"><a href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#a61f1bb4b9a8a31439d343e4e7bb807ae">geos::operation::intersection::Rectangle::nextEdge</a></div><div class="ttdeci">static Position nextEdge(Position pos)</div><div class="ttdoc">Next edge in clock-wise direction. </div><div class="ttdef"><b>Definition:</b> <a href="Rectangle_8h_source.html#l00202">Rectangle.h:202</a></div></div>
<div class="ttc" id="classgeos_1_1operation_1_1intersection_1_1Rectangle_html_a77d9664db7d45ef3a8559ef3cb653042"><div class="ttname"><a href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#a77d9664db7d45ef3a8559ef3cb653042">geos::operation::intersection::Rectangle::yMin</a></div><div class="ttdeci">double yMin</div><div class="ttdef"><b>Definition:</b> <a href="Rectangle_8h_source.html#l00227">Rectangle.h:227</a></div></div>
<div class="ttc" id="export_8h_html_ae36df939090171f6e9a28a8cb6254fea"><div class="ttname"><a href="export_8h.html#ae36df939090171f6e9a28a8cb6254fea">GEOS_DLL</a></div><div class="ttdeci">#define GEOS_DLL</div><div class="ttdef"><b>Definition:</b> <a href="export_8h_source.html#l00028">export.h:28</a></div></div>
<div class="ttc" id="classgeos_1_1operation_1_1intersection_1_1Rectangle_html_a87d5674171357305fb2599e80b6c96fc"><div class="ttname"><a href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#a87d5674171357305fb2599e80b6c96fc">geos::operation::intersection::Rectangle::ymax</a></div><div class="ttdeci">double ymax() const </div><div class="ttdef"><b>Definition:</b> <a href="Rectangle_8h_source.html#l00102">Rectangle.h:102</a></div></div>
<div class="ttc" id="export_8h_html"><div class="ttname"><a href="export_8h.html">export.h</a></div></div>
<div class="ttc" id="classgeos_1_1operation_1_1intersection_1_1Rectangle_html_aa2b60d016a4153e8f5b2b9aca5ba8f1a"><div class="ttname"><a href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#aa2b60d016a4153e8f5b2b9aca5ba8f1a">geos::operation::intersection::Rectangle::onSameEdge</a></div><div class="ttdeci">static bool onSameEdge(Position pos1, Position pos2)</div><div class="ttdoc">Test if the given positions are on the same Rectangle edge. </div><div class="ttdef"><b>Definition:</b> <a href="Rectangle_8h_source.html#l00155">Rectangle.h:155</a></div></div>
<div class="ttc" id="classgeos_1_1operation_1_1intersection_1_1Rectangle_html_a40a4b9b3586403272feb01c4fc2fdb8d"><div class="ttname"><a href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#a40a4b9b3586403272feb01c4fc2fdb8d">geos::operation::intersection::Rectangle::xMin</a></div><div class="ttdeci">double xMin</div><div class="ttdef"><b>Definition:</b> <a href="Rectangle_8h_source.html#l00226">Rectangle.h:226</a></div></div>
<div class="ttc" id="classgeos_1_1operation_1_1intersection_1_1Rectangle_html_a77facc8dce2b41887d11f35e660fb463"><div class="ttname"><a href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#a77facc8dce2b41887d11f35e660fb463">geos::operation::intersection::Rectangle::onEdge</a></div><div class="ttdeci">static bool onEdge(Position pos)</div><div class="ttdoc">Test if the given position is on a Rectangle edge. </div><div class="ttdef"><b>Definition:</b> <a href="Rectangle_8h_source.html#l00142">Rectangle.h:142</a></div></div>
<div class="ttc" id="classgeos_1_1operation_1_1intersection_1_1Rectangle_html_a1189ddf34745aec6b1fc50a218dafe12"><div class="ttname"><a href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#a1189ddf34745aec6b1fc50a218dafe12">geos::operation::intersection::Rectangle::position</a></div><div class="ttdeci">Position position(double x, double y) const </div><div class="ttdoc">Establish position of coordinate with respect to a Rectangle. </div><div class="ttdef"><b>Definition:</b> <a href="Rectangle_8h_source.html#l00168">Rectangle.h:168</a></div></div>
<div class="ttc" id="classgeos_1_1geom_1_1Polygon_html"><div class="ttname"><a href="classgeos_1_1geom_1_1Polygon.html">geos::geom::Polygon</a></div><div class="ttdoc">Represents a linear polygon, which may include holes. </div><div class="ttdef"><b>Definition:</b> <a href="Polygon_8h_source.html#l00064">Polygon.h:64</a></div></div>
<div class="ttc" id="classgeos_1_1geom_1_1GeometryFactory_html"><div class="ttname"><a href="classgeos_1_1geom_1_1GeometryFactory.html">geos::geom::GeometryFactory</a></div><div class="ttdoc">Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...</div><div class="ttdef"><b>Definition:</b> <a href="GeometryFactory_8h_source.html#l00068">GeometryFactory.h:68</a></div></div>
<div class="ttc" id="namespacegeos_html"><div class="ttname"><a href="namespacegeos.html">geos</a></div><div class="ttdoc">Basic namespace for all GEOS functionalities. </div><div class="ttdef"><b>Definition:</b> <a href="IndexedNestedRingTester_8h_source.html#l00026">IndexedNestedRingTester.h:26</a></div></div>
<div class="ttc" id="classgeos_1_1operation_1_1intersection_1_1Rectangle_html_a58ded076e8a4b5c63c7a7bda9b341e85"><div class="ttname"><a href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#a58ded076e8a4b5c63c7a7bda9b341e85">geos::operation::intersection::Rectangle::xMax</a></div><div class="ttdeci">double xMax</div><div class="ttdef"><b>Definition:</b> <a href="Rectangle_8h_source.html#l00228">Rectangle.h:228</a></div></div>
<div class="ttc" id="classgeos_1_1operation_1_1intersection_1_1Rectangle_html_ac456ee3b1edf3996072d5b16d84150dc"><div class="ttname"><a href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ac456ee3b1edf3996072d5b16d84150dc">geos::operation::intersection::Rectangle::Position</a></div><div class="ttdeci">Position</div><div class="ttdoc">Position with respect to a clipping rectangle. </div><div class="ttdef"><b>Definition:</b> <a href="Rectangle_8h_source.html#l00120">Rectangle.h:120</a></div></div>
<div class="ttc" id="classgeos_1_1geom_1_1LinearRing_html"><div class="ttname"><a href="classgeos_1_1geom_1_1LinearRing.html">geos::geom::LinearRing</a></div><div class="ttdoc">Models an OGC SFS LinearRing. A LinearRing is a LineString which is both closed and simple...</div><div class="ttdef"><b>Definition:</b> <a href="LinearRing_8h_source.html#l00054">LinearRing.h:54</a></div></div>
<div class="ttc" id="classgeos_1_1operation_1_1intersection_1_1Rectangle_html_ae5751bc8bd4ebfb979bf73211d59e02c"><div class="ttname"><a href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ae5751bc8bd4ebfb979bf73211d59e02c">geos::operation::intersection::Rectangle::ymin</a></div><div class="ttdeci">double ymin() const </div><div class="ttdef"><b>Definition:</b> <a href="Rectangle_8h_source.html#l00080">Rectangle.h:80</a></div></div>
<div class="ttc" id="classgeos_1_1operation_1_1intersection_1_1Rectangle_html_ab986e3d06cdda728e85751743b657fed"><div class="ttname"><a href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ab986e3d06cdda728e85751743b657fed">geos::operation::intersection::Rectangle::yMax</a></div><div class="ttdeci">double yMax</div><div class="ttdef"><b>Definition:</b> <a href="Rectangle_8h_source.html#l00229">Rectangle.h:229</a></div></div>
<div class="ttc" id="classgeos_1_1operation_1_1intersection_1_1Rectangle_html"><div class="ttname"><a href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html">geos::operation::intersection::Rectangle</a></div><div class="ttdoc">Clipping rectangle. </div><div class="ttdef"><b>Definition:</b> <a href="Rectangle_8h_source.html#l00051">Rectangle.h:51</a></div></div>
<div class="ttc" id="classgeos_1_1operation_1_1intersection_1_1Rectangle_html_aa5b87d939c6f5e1d580b828fdcfcdd8a"><div class="ttname"><a href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#aa5b87d939c6f5e1d580b828fdcfcdd8a">geos::operation::intersection::Rectangle::xmin</a></div><div class="ttdeci">double xmin() const </div><div class="ttdef"><b>Definition:</b> <a href="Rectangle_8h_source.html#l00070">Rectangle.h:70</a></div></div>
<div class="ttc" id="classgeos_1_1operation_1_1intersection_1_1Rectangle_html_ab7463dc82a25f081d33c91de7e937ce0"><div class="ttname"><a href="classgeos_1_1operation_1_1intersection_1_1Rectangle.html#ab7463dc82a25f081d33c91de7e937ce0">geos::operation::intersection::Rectangle::xmax</a></div><div class="ttdeci">double xmax() const </div><div class="ttdef"><b>Definition:</b> <a href="Rectangle_8h_source.html#l00091">Rectangle.h:91</a></div></div>
</div><!-- fragment --></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>