Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 96617cbbea5434e5cff4ccd67437c037 > files > 31

mercator-devel-0.2.7-3.fc12.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Mercator: Area.h Source File</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.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</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 class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
    </ul>
  </div>
<h1>Area.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// This file may be redistributed and modified only under the terms of</span>
<a name="l00002"></a>00002 <span class="comment">// the GNU General Public License (See COPYING for details).</span>
<a name="l00003"></a>00003 <span class="comment">// Copyright (C) 2005 Alistair Riddoch</span>
<a name="l00004"></a>00004 
<a name="l00005"></a>00005 <span class="preprocessor">#ifndef MERCATOR_AREA_H</span>
<a name="l00006"></a>00006 <span class="preprocessor"></span><span class="preprocessor">#define MERCATOR_AREA_H</span>
<a name="l00007"></a>00007 <span class="preprocessor"></span>
<a name="l00008"></a>00008 <span class="preprocessor">#include &lt;wfmath/axisbox.h&gt;</span>
<a name="l00009"></a>00009 <span class="preprocessor">#include &lt;wfmath/polygon.h&gt;</span>
<a name="l00010"></a>00010 
<a name="l00011"></a>00011 <span class="keyword">namespace </span>Mercator
<a name="l00012"></a>00012 {
<a name="l00013"></a>00013 
<a name="l00014"></a>00014 <span class="keyword">class </span>Segment;
<a name="l00015"></a>00015 
<a name="l00025"></a><a class="code" href="classMercator_1_1Area.html">00025</a> <span class="keyword">class </span><a class="code" href="classMercator_1_1Area.html" title="Region of terrain surface which is modified.">Area</a>
<a name="l00026"></a>00026 {
<a name="l00027"></a>00027 <span class="keyword">public</span>:
<a name="l00032"></a>00032     <a class="code" href="classMercator_1_1Area.html#7c878e0c945ee272b9bc882b8e7facd7" title="Constructor.">Area</a>(<span class="keywordtype">int</span> layer, <span class="keywordtype">bool</span> hole);
<a name="l00033"></a>00033     
<a name="l00038"></a>00038     <span class="keywordtype">void</span> <a class="code" href="classMercator_1_1Area.html#7fcab9894d4b401b23222a1e9a9d6f9b" title="Set the layer number and flag indicating whether this is a hole.">setLayer</a>(<span class="keywordtype">int</span> layer, <span class="keywordtype">bool</span> hole);
<a name="l00039"></a>00039 
<a name="l00041"></a>00041     <span class="keywordtype">void</span> <a class="code" href="classMercator_1_1Area.html#fc2e16fe3fe371db9d4160996befc91e" title="Set the geometric shape of this area.">setShape</a>(<span class="keyword">const</span> WFMath::Polygon&lt;2&gt;&amp; p);
<a name="l00042"></a>00042 
<a name="l00044"></a>00044     <span class="keywordtype">bool</span> <a class="code" href="classMercator_1_1Area.html#a10b34db6052f0d26a736cf3ffb31fc5" title="Determine if a point is contained by the shape of this area.">contains</a>(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y) <span class="keyword">const</span>;
<a name="l00045"></a>00045 
<a name="l00047"></a><a class="code" href="classMercator_1_1Area.html#9d81d485c5e85c682753842211cc933f">00047</a>     <span class="keywordtype">int</span> <a class="code" href="classMercator_1_1Area.html#9d81d485c5e85c682753842211cc933f" title="Accessor for the layer number.">getLayer</a>()<span class="keyword"> const</span>
<a name="l00048"></a>00048 <span class="keyword">    </span>{
<a name="l00049"></a>00049         <span class="keywordflow">return</span> <a class="code" href="classMercator_1_1Area.html#9c5453670b795204eb81f4b19ecfe5b6" title="The layer number.">m_layer</a>;
<a name="l00050"></a>00050     }
<a name="l00051"></a>00051     
<a name="l00053"></a><a class="code" href="classMercator_1_1Area.html#7039127a59ac3e55a18c643b6ce2b261">00053</a>     <span class="keywordtype">bool</span> <a class="code" href="classMercator_1_1Area.html#7039127a59ac3e55a18c643b6ce2b261" title="Accessor for the flag indicating whether this is a hole.">isHole</a>()<span class="keyword"> const</span>
<a name="l00054"></a>00054 <span class="keyword">    </span>{
<a name="l00055"></a>00055         <span class="keywordflow">return</span> <a class="code" href="classMercator_1_1Area.html#10a76a9d5e31c5d90dd59592e91e8795" title="A flag indicating whether this is a hole.">m_hole</a>;
<a name="l00056"></a>00056     }
<a name="l00057"></a>00057     
<a name="l00059"></a><a class="code" href="classMercator_1_1Area.html#eb2617db5868cfd139dd7cbeac31cadb">00059</a>     <span class="keyword">const</span> WFMath::AxisBox&lt;2&gt; &amp; <a class="code" href="classMercator_1_1Area.html#eb2617db5868cfd139dd7cbeac31cadb" title="Accessor for the bounding box of the geometric shape.">bbox</a>()<span class="keyword"> const</span>
<a name="l00060"></a>00060 <span class="keyword">    </span>{
<a name="l00061"></a>00061         <span class="keywordflow">return</span> <a class="code" href="classMercator_1_1Area.html#d37818603fb85847e2cbb7c676a79810" title="The bounding box of the geometric shape.">m_box</a>;
<a name="l00062"></a>00062     }
<a name="l00063"></a>00063 
<a name="l00065"></a><a class="code" href="classMercator_1_1Area.html#5d795116bdab81597e4f86b6880d59db">00065</a>     <span class="keyword">const</span> WFMath::Polygon&lt;2&gt; &amp; <a class="code" href="classMercator_1_1Area.html#5d795116bdab81597e4f86b6880d59db" title="Accessor for the geometric shape.">shape</a>()<span class="keyword"> const</span>
<a name="l00066"></a>00066 <span class="keyword">    </span>{
<a name="l00067"></a>00067         <span class="keywordflow">return</span> <a class="code" href="classMercator_1_1Area.html#08b8fae164886e22219c2264eff655a9" title="The geometric shape.">m_shape</a>;
<a name="l00068"></a>00068     }
<a name="l00069"></a>00069     
<a name="l00073"></a>00073     <span class="keywordtype">bool</span> <a class="code" href="classMercator_1_1Area.html#42c098d924e789ea77914d076f553bcf">checkIntersects</a>(<span class="keyword">const</span> <a class="code" href="classMercator_1_1Segment.html" title="Class storing heightfield and other data for a single fixed size square area of terrain...">Segment</a>&amp; s) <span class="keyword">const</span>;
<a name="l00074"></a>00074 
<a name="l00082"></a>00082     WFMath::Polygon&lt;2&gt; <a class="code" href="classMercator_1_1Area.html#e1ccc0db586cbc1ea0d9dbef67da2251" title="Clip the shape of this area to a given segment.">clipToSegment</a>(<span class="keyword">const</span> <a class="code" href="classMercator_1_1Segment.html" title="Class storing heightfield and other data for a single fixed size square area of terrain...">Segment</a>&amp; s) <span class="keyword">const</span>;
<a name="l00083"></a>00083 <span class="keyword">private</span>:
<a name="l00084"></a>00084 
<a name="l00086"></a><a class="code" href="classMercator_1_1Area.html#9c5453670b795204eb81f4b19ecfe5b6">00086</a>     <span class="keywordtype">int</span> <a class="code" href="classMercator_1_1Area.html#9c5453670b795204eb81f4b19ecfe5b6" title="The layer number.">m_layer</a>;
<a name="l00088"></a><a class="code" href="classMercator_1_1Area.html#10a76a9d5e31c5d90dd59592e91e8795">00088</a>     <span class="keywordtype">bool</span> <a class="code" href="classMercator_1_1Area.html#10a76a9d5e31c5d90dd59592e91e8795" title="A flag indicating whether this is a hole.">m_hole</a>;
<a name="l00090"></a><a class="code" href="classMercator_1_1Area.html#08b8fae164886e22219c2264eff655a9">00090</a>     WFMath::Polygon&lt;2&gt; <a class="code" href="classMercator_1_1Area.html#08b8fae164886e22219c2264eff655a9" title="The geometric shape.">m_shape</a>;
<a name="l00092"></a><a class="code" href="classMercator_1_1Area.html#d37818603fb85847e2cbb7c676a79810">00092</a>     WFMath::AxisBox&lt;2&gt; <a class="code" href="classMercator_1_1Area.html#d37818603fb85847e2cbb7c676a79810" title="The bounding box of the geometric shape.">m_box</a>;
<a name="l00093"></a>00093 };
<a name="l00094"></a>00094 
<a name="l00095"></a>00095 }
<a name="l00096"></a>00096 
<a name="l00097"></a>00097 <span class="preprocessor">#endif // of MERCATOR_AREA_H</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated for Mercator by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>