Sophie

Sophie

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

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: Coordinate.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.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><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="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<h1>Coordinate.h</h1>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/**********************************************************************</span>
<a name="l00002"></a>00002 <span class="comment"> * $Id: Coordinate.h 2556 2009-06-06 22:22:28Z strk $</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * GEOS - Geometry Engine Open Source</span>
<a name="l00005"></a>00005 <span class="comment"> * http://geos.refractions.net</span>
<a name="l00006"></a>00006 <span class="comment"> *</span>
<a name="l00007"></a>00007 <span class="comment"> * Copyright (C) 2006 Refractions Research Inc.</span>
<a name="l00008"></a>00008 <span class="comment"> *</span>
<a name="l00009"></a>00009 <span class="comment"> * This is free software; you can redistribute and/or modify it under</span>
<a name="l00010"></a>00010 <span class="comment"> * the terms of the GNU Lesser General Public Licence as published</span>
<a name="l00011"></a>00011 <span class="comment"> * by the Free Software Foundation. </span>
<a name="l00012"></a>00012 <span class="comment"> * See the COPYING file for more information.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> **********************************************************************/</span>
<a name="l00015"></a>00015 
<a name="l00016"></a>00016 <span class="preprocessor">#ifndef GEOS_GEOM_COORDINATE_H</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#define GEOS_GEOM_COORDINATE_H</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span>
<a name="l00019"></a>00019 <span class="preprocessor">#include &lt;geos/export.h&gt;</span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &lt;geos/platform.h&gt;</span> <span class="comment">// for DoubleNotANumber</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &lt;geos/inline.h&gt;</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;set&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;stack&gt;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;vector&gt;</span> <span class="comment">// for typedefs</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;limits&gt;</span>
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 <span class="keyword">namespace </span>geos {
<a name="l00029"></a>00029 <span class="keyword">namespace </span>geom { <span class="comment">// geos.geom</span>
<a name="l00030"></a>00030 
<a name="l00031"></a>00031 <span class="keyword">struct </span>CoordinateLessThen;
<a name="l00032"></a>00032 
<a name="l00053"></a>00053 <span class="comment">// Define the following to make assignments and copy constructions </span>
<a name="l00054"></a>00054 <span class="comment">// NON-inline (will let profilers report usages)</span>
<a name="l00055"></a>00055 <span class="comment">//#define PROFILE_COORDINATE_COPIES 1</span>
<a name="l00056"></a><a class="code" href="classgeos_1_1geom_1_1Coordinate.html">00056</a> <span class="keyword">class </span>GEOS_DLL <a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a> {
<a name="l00057"></a>00057 
<a name="l00058"></a>00058 <span class="keyword">private</span>:
<a name="l00059"></a>00059 
<a name="l00060"></a>00060         <span class="keyword">static</span> <a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a> nullCoord;
<a name="l00061"></a>00061 
<a name="l00062"></a>00062 <span class="keyword">public</span>:
<a name="l00064"></a><a class="code" href="classgeos_1_1geom_1_1Coordinate.html#ad2287150888bce0481a99cc1d3faabbb">00064</a>         <span class="keyword">typedef</span> std::set&lt;const Coordinate *, CoordinateLessThen&gt; ConstSet;
<a name="l00065"></a>00065 
<a name="l00067"></a><a class="code" href="classgeos_1_1geom_1_1Coordinate.html#a1735d833ea7d033b82c317f883948525">00067</a>         <span class="keyword">typedef</span> std::vector&lt;const Coordinate *&gt; ConstVect;
<a name="l00068"></a>00068 
<a name="l00070"></a><a class="code" href="classgeos_1_1geom_1_1Coordinate.html#af8601defdd78458e835c6a8ee7483231">00070</a>         <span class="keyword">typedef</span> std::stack&lt;const Coordinate *&gt; ConstStack;
<a name="l00071"></a>00071 
<a name="l00073"></a><a class="code" href="classgeos_1_1geom_1_1Coordinate.html#a59345d3a409b5d2ebe01fcfcdcca92cb">00073</a>         <span class="keyword">typedef</span> std::vector&lt;Coordinate&gt; Vect;
<a name="l00074"></a>00074 
<a name="l00076"></a><a class="code" href="classgeos_1_1geom_1_1Coordinate.html#ad809a77e5715e490a7e5f95c8611737e">00076</a>         <span class="keywordtype">double</span> x;
<a name="l00077"></a>00077 
<a name="l00079"></a><a class="code" href="classgeos_1_1geom_1_1Coordinate.html#acdeb58356624ebe25cbbf5b6021c3d9d">00079</a>         <span class="keywordtype">double</span> y;
<a name="l00080"></a>00080 
<a name="l00082"></a><a class="code" href="classgeos_1_1geom_1_1Coordinate.html#af0c1b234c851ae467c371dea8861612f">00082</a>         <span class="keywordtype">double</span> z;
<a name="l00083"></a>00083 
<a name="l00084"></a>00084         <span class="keywordtype">void</span> setNull();
<a name="l00085"></a>00085 
<a name="l00086"></a>00086         <span class="keyword">static</span> <a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a>&amp; getNull();
<a name="l00087"></a>00087 
<a name="l00088"></a>00088         <span class="keywordtype">bool</span> isNull() <span class="keyword">const</span>;
<a name="l00089"></a>00089 
<a name="l00090"></a>00090         ~<a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a>();
<a name="l00091"></a>00091 
<a name="l00092"></a>00092         <a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a>(<span class="keywordtype">double</span> xNew=0.0, <span class="keywordtype">double</span> yNew=0.0, <span class="keywordtype">double</span> zNew=DoubleNotANumber);
<a name="l00093"></a>00093 
<a name="l00094"></a>00094 <span class="comment">// Letting the compiler synthetize these gives us more numerical stability</span>
<a name="l00095"></a>00095 <span class="preprocessor">#if 0</span>
<a name="l00096"></a>00096 <span class="preprocessor"></span>        <a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a>(<span class="keyword">const</span> <a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a>&amp; c);
<a name="l00097"></a>00097 
<a name="l00098"></a>00098         <a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a> &amp;operator=(<span class="keyword">const</span> <a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a> &amp;c);
<a name="l00099"></a>00099 <span class="preprocessor">#endif</span>
<a name="l00100"></a>00100 <span class="preprocessor"></span>
<a name="l00101"></a>00101         <span class="keywordtype">bool</span> equals2D(<span class="keyword">const</span> <a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a>&amp; other) <span class="keyword">const</span>;
<a name="l00102"></a>00102 
<a name="l00104"></a>00104         <span class="keywordtype">bool</span> equals(<span class="keyword">const</span> <a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a>&amp; other) <span class="keyword">const</span>;
<a name="l00105"></a>00105 
<a name="l00107"></a>00107         <span class="keywordtype">int</span> compareTo(<span class="keyword">const</span> <a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a>&amp; other) <span class="keyword">const</span>;
<a name="l00108"></a>00108 
<a name="l00110"></a>00110         <span class="keywordtype">bool</span> equals3D(<span class="keyword">const</span> <a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a>&amp; other) <span class="keyword">const</span>;
<a name="l00111"></a>00111 
<a name="l00113"></a>00113         std::string toString() <span class="keyword">const</span>;
<a name="l00114"></a>00114 
<a name="l00117"></a>00117         <span class="comment">//void makePrecise(const PrecisionModel *pm);</span>
<a name="l00118"></a>00118 
<a name="l00119"></a>00119         <span class="keywordtype">double</span> distance(<span class="keyword">const</span> <a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a>&amp; p) <span class="keyword">const</span>;
<a name="l00120"></a>00120 
<a name="l00121"></a>00121         <span class="keywordtype">int</span> hashCode() <span class="keyword">const</span>;
<a name="l00122"></a>00122 
<a name="l00127"></a>00127         <span class="keyword">static</span> <span class="keywordtype">int</span> hashCode(<span class="keywordtype">double</span> d);
<a name="l00128"></a>00128 
<a name="l00129"></a>00129 };
<a name="l00130"></a>00130 
<a name="l00132"></a><a class="code" href="structgeos_1_1geom_1_1CoordinateLessThen.html">00132</a> <span class="keyword">struct </span>GEOS_DLL <a class="code" href="structgeos_1_1geom_1_1CoordinateLessThen.html" title="Strict weak ordering Functor for Coordinate.">CoordinateLessThen</a> {
<a name="l00133"></a>00133 
<a name="l00134"></a>00134         <span class="keywordtype">bool</span> operator()(<span class="keyword">const</span> <a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a>* a, <span class="keyword">const</span> <a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a>* b) <span class="keyword">const</span>;
<a name="l00135"></a>00135         <span class="keywordtype">bool</span> operator()(<span class="keyword">const</span> <a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a>&amp; a, <span class="keyword">const</span> <a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a>&amp; b) <span class="keyword">const</span>;
<a name="l00136"></a>00136 
<a name="l00137"></a>00137 };
<a name="l00138"></a>00138 
<a name="l00140"></a>00140 GEOS_DLL std::ostream&amp; <a class="code" href="namespacegeos_1_1geom.html#ab8723f7afa29f8c4dcb9b77fa42132e4" title="Output function.">operator&lt;&lt; </a>(std::ostream&amp; os, <span class="keyword">const</span> <a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a>&amp; c);
<a name="l00141"></a>00141 
<a name="l00143"></a>00143 GEOS_DLL <span class="keywordtype">bool</span> <a class="code" href="namespacegeos_1_1geom.html#a47d9ceb105719b7108cf095799b4888d" title="Equality operator for Coordinate. 2D only.">operator==</a>(<span class="keyword">const</span> <a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a>&amp; a, <span class="keyword">const</span> <a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a>&amp; b);
<a name="l00144"></a>00144 
<a name="l00146"></a>00146 GEOS_DLL <span class="keywordtype">bool</span> <a class="code" href="namespacegeos_1_1geom.html#ab2cc58666ff137d5495bb4614a4ecbc3" title="Inequality operator for Coordinate. 2D only.">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a>&amp; a, <span class="keyword">const</span> <a class="code" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates.">Coordinate</a>&amp; b);
<a name="l00147"></a>00147 
<a name="l00148"></a>00148 
<a name="l00149"></a>00149 
<a name="l00150"></a>00150 } <span class="comment">// namespace geos.geom</span>
<a name="l00151"></a>00151 } <span class="comment">// namespace geos</span>
<a name="l00152"></a>00152 
<a name="l00153"></a>00153 <span class="preprocessor">#ifdef GEOS_INLINE</span>
<a name="l00154"></a>00154 <span class="preprocessor"></span><span class="preprocessor"># include &quot;geos/geom/Coordinate.inl&quot;</span>
<a name="l00155"></a>00155 <span class="preprocessor">#endif</span>
<a name="l00156"></a>00156 <span class="preprocessor"></span>
<a name="l00157"></a>00157 <span class="preprocessor">#endif // ndef GEOS_GEOM_COORDINATE_H</span>
<a name="l00158"></a>00158 <span class="preprocessor"></span>
<a name="l00159"></a>00159 <span class="comment">/**********************************************************************</span>
<a name="l00160"></a>00160 <span class="comment"> * $Log$</span>
<a name="l00161"></a>00161 <span class="comment"> * Revision 1.6  2006/06/14 19:27:02  strk</span>
<a name="l00162"></a>00162 <span class="comment"> * Let the compiler synthetize copy ctor and assignment op for Coordinate class to obtain better numerical stability.</span>
<a name="l00163"></a>00163 <span class="comment"> *</span>
<a name="l00164"></a>00164 <span class="comment"> * Revision 1.5  2006/05/23 15:06:07  strk</span>
<a name="l00165"></a>00165 <span class="comment"> * * source/headers/geos/geom/Coordinate.h: added missing &lt;string&gt; include.</span>
<a name="l00166"></a>00166 <span class="comment"> *</span>
<a name="l00167"></a>00167 <span class="comment"> * Revision 1.4  2006/03/27 15:57:39  strk</span>
<a name="l00168"></a>00168 <span class="comment"> * Commented need for platform.h include</span>
<a name="l00169"></a>00169 <span class="comment"> *</span>
<a name="l00170"></a>00170 <span class="comment"> * Revision 1.3  2006/03/24 09:52:41  strk</span>
<a name="l00171"></a>00171 <span class="comment"> * USE_INLINE =&gt; GEOS_INLINE</span>
<a name="l00172"></a>00172 <span class="comment"> *</span>
<a name="l00173"></a>00173 <span class="comment"> * Revision 1.2  2006/03/20 10:12:45  strk</span>
<a name="l00174"></a>00174 <span class="comment"> * Bug #70 - Small fix in fwd decl. of CoordinateLessThen</span>
<a name="l00175"></a>00175 <span class="comment"> *</span>
<a name="l00176"></a>00176 <span class="comment"> * Revision 1.1  2006/03/09 16:46:49  strk</span>
<a name="l00177"></a>00177 <span class="comment"> * geos::geom namespace definition, first pass at headers split</span>
<a name="l00178"></a>00178 <span class="comment"> *</span>
<a name="l00179"></a>00179 <span class="comment"> **********************************************************************/</span>
</pre></div></div>
</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>