geos_390_docs/classgeos_1_1geom_1_1Precis...

645 lines
40 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::geom::PrecisionModel 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_1geom.html">geom</a></li><li class="navelem"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html">PrecisionModel</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="classgeos_1_1geom_1_1PrecisionModel-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">geos::geom::PrecisionModel Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Specifies the precision model of the <a class="el" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates. ">Coordinate</a> in a <a class="el" href="classgeos_1_1geom_1_1Geometry.html" title="Basic implementation of Geometry, constructed and destructed by GeometryFactory. ">Geometry</a>.
<a href="classgeos_1_1geom_1_1PrecisionModel.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="PrecisionModel_8h_source.html">geos.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:aa32be4a02d1faf45306fee75d68a2e12"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#aa32be4a02d1faf45306fee75d68a2e12">Type</a> { <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#aa32be4a02d1faf45306fee75d68a2e12a702c5051872b1eae28e5f8d3c0f2e8af">FIXED</a>,
<a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#aa32be4a02d1faf45306fee75d68a2e12a871d90e033044acdd1db738dc2934aaf">FLOATING</a>,
<a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#aa32be4a02d1faf45306fee75d68a2e12aec6ecfa3e6b4087810606e2a41111035">FLOATING_SINGLE</a>
}<tr class="memdesc:aa32be4a02d1faf45306fee75d68a2e12"><td class="mdescLeft">&#160;</td><td class="mdescRight">The types of Precision Model which GEOS supports. <a href="classgeos_1_1geom_1_1PrecisionModel.html#aa32be4a02d1faf45306fee75d68a2e12">More...</a><br /></td></tr>
</td></tr>
<tr class="separator:aa32be4a02d1faf45306fee75d68a2e12"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a9f4af835c0ca26c06fe20d03dac79322"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#a9f4af835c0ca26c06fe20d03dac79322">PrecisionModel</a> (void)</td></tr>
<tr class="memdesc:a9f4af835c0ca26c06fe20d03dac79322"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html" title="Specifies the precision model of the Coordinate in a Geometry. ">PrecisionModel</a> with a default precision of FLOATING. <a href="#a9f4af835c0ca26c06fe20d03dac79322">More...</a><br /></td></tr>
<tr class="separator:a9f4af835c0ca26c06fe20d03dac79322"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac6bb03bcd215e6d42406e3c8fbaaae1e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#ac6bb03bcd215e6d42406e3c8fbaaae1e">PrecisionModel</a> (<a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#aa32be4a02d1faf45306fee75d68a2e12">Type</a> nModelType)</td></tr>
<tr class="separator:ac6bb03bcd215e6d42406e3c8fbaaae1e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c68e7a03195a03d2a89fe24b9aa346a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#a5c68e7a03195a03d2a89fe24b9aa346a">PrecisionModel</a> (double newScale, double newOffsetX, double newOffsetY)</td></tr>
<tr class="memdesc:a5c68e7a03195a03d2a89fe24b9aa346a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a <code><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html" title="Specifies the precision model of the Coordinate in a Geometry. ">PrecisionModel</a></code> with Fixed precision. <a href="#a5c68e7a03195a03d2a89fe24b9aa346a">More...</a><br /></td></tr>
<tr class="separator:a5c68e7a03195a03d2a89fe24b9aa346a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab7b6f3c8fc62bb29bb7eb665c969486a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#ab7b6f3c8fc62bb29bb7eb665c969486a">PrecisionModel</a> (double newScale)</td></tr>
<tr class="memdesc:ab7b6f3c8fc62bb29bb7eb665c969486a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html" title="Specifies the precision model of the Coordinate in a Geometry. ">PrecisionModel</a> with Fixed precision. <a href="#ab7b6f3c8fc62bb29bb7eb665c969486a">More...</a><br /></td></tr>
<tr class="separator:ab7b6f3c8fc62bb29bb7eb665c969486a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac93fddf641db2575293d8987b75053af"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#ac93fddf641db2575293d8987b75053af">makePrecise</a> (double val) const </td></tr>
<tr class="memdesc:ac93fddf641db2575293d8987b75053af"><td class="mdescLeft">&#160;</td><td class="mdescRight">Rounds a numeric value to the <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html" title="Specifies the precision model of the Coordinate in a Geometry. ">PrecisionModel</a> grid. <a href="#ac93fddf641db2575293d8987b75053af">More...</a><br /></td></tr>
<tr class="separator:ac93fddf641db2575293d8987b75053af"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ade65ef4582991126ed6ebae2565b47c2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#ade65ef4582991126ed6ebae2565b47c2">makePrecise</a> (<a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;coord) const </td></tr>
<tr class="memdesc:ade65ef4582991126ed6ebae2565b47c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Rounds the given <a class="el" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates. ">Coordinate</a> to the <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html" title="Specifies the precision model of the Coordinate in a Geometry. ">PrecisionModel</a> grid. <a href="#ade65ef4582991126ed6ebae2565b47c2">More...</a><br /></td></tr>
<tr class="separator:ade65ef4582991126ed6ebae2565b47c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeb238d40042893586a64e92fc987653e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#aeb238d40042893586a64e92fc987653e">makePrecise</a> (<a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> *coord) const </td></tr>
<tr class="separator:aeb238d40042893586a64e92fc987653e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac9fd3cbb862a16a46d3ebcf601fc81fb"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#ac9fd3cbb862a16a46d3ebcf601fc81fb">isFloating</a> () const </td></tr>
<tr class="separator:ac9fd3cbb862a16a46d3ebcf601fc81fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab414dc6879f0e81e9672dc04ad00e4e1"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#ab414dc6879f0e81e9672dc04ad00e4e1">getMaximumSignificantDigits</a> () const </td></tr>
<tr class="memdesc:ab414dc6879f0e81e9672dc04ad00e4e1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the maximum number of significant digits provided by this precision model. <a href="#ab414dc6879f0e81e9672dc04ad00e4e1">More...</a><br /></td></tr>
<tr class="separator:ab414dc6879f0e81e9672dc04ad00e4e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ec7a6585c53fba22cf6b30fe1077abb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#aa32be4a02d1faf45306fee75d68a2e12">Type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#a3ec7a6585c53fba22cf6b30fe1077abb">getType</a> () const </td></tr>
<tr class="separator:a3ec7a6585c53fba22cf6b30fe1077abb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a457c0f35f3ae4193c5713ac99a400bc8"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#a457c0f35f3ae4193c5713ac99a400bc8">getScale</a> () const </td></tr>
<tr class="memdesc:a457c0f35f3ae4193c5713ac99a400bc8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the multiplying factor used to obtain a precise coordinate. <a href="#a457c0f35f3ae4193c5713ac99a400bc8">More...</a><br /></td></tr>
<tr class="separator:a457c0f35f3ae4193c5713ac99a400bc8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abd9ded598191954a40e40aaabed6242d"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#abd9ded598191954a40e40aaabed6242d">getOffsetX</a> () const </td></tr>
<tr class="separator:abd9ded598191954a40e40aaabed6242d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae0772ba6e7f4df08bb4e38a9cc80cf0b"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#ae0772ba6e7f4df08bb4e38a9cc80cf0b">getOffsetY</a> () const </td></tr>
<tr class="separator:ae0772ba6e7f4df08bb4e38a9cc80cf0b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6fba7ce37a54d9bce731f6a1f069b31d"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#a6fba7ce37a54d9bce731f6a1f069b31d">toString</a> () const </td></tr>
<tr class="separator:a6fba7ce37a54d9bce731f6a1f069b31d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acf4a8556c689a152b4f6f51284ad1c88"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#acf4a8556c689a152b4f6f51284ad1c88">compareTo</a> (const <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html">PrecisionModel</a> *other) const </td></tr>
<tr class="memdesc:acf4a8556c689a152b4f6f51284ad1c88"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compares this <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html" title="Specifies the precision model of the Coordinate in a Geometry. ">PrecisionModel</a> object with the specified object for order. <a href="#acf4a8556c689a152b4f6f51284ad1c88">More...</a><br /></td></tr>
<tr class="separator:acf4a8556c689a152b4f6f51284ad1c88"><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-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:a92ff29ac9cd8f93f1ab9283788313a5e"><td class="memItemLeft" align="right" valign="top">static const double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#a92ff29ac9cd8f93f1ab9283788313a5e">maximumPreciseValue</a></td></tr>
<tr class="separator:a92ff29ac9cd8f93f1ab9283788313a5e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr class="memitem:ac0ea69b029c71ad0ffa0bd5ca24d1756"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#ac0ea69b029c71ad0ffa0bd5ca24d1756">setScale</a> (double newScale)</td></tr>
<tr class="memdesc:ac0ea69b029c71ad0ffa0bd5ca24d1756"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the multiplying factor used to obtain a precise coordinate. <a href="#ac0ea69b029c71ad0ffa0bd5ca24d1756">More...</a><br /></td></tr>
<tr class="separator:ac0ea69b029c71ad0ffa0bd5ca24d1756"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:a2217bfa530c0a602bcb268fec65b2716"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#aa32be4a02d1faf45306fee75d68a2e12">Type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#a2217bfa530c0a602bcb268fec65b2716">modelType</a></td></tr>
<tr class="separator:a2217bfa530c0a602bcb268fec65b2716"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c8962f6e7348bb37b8f877e7cf91082"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#a5c8962f6e7348bb37b8f877e7cf91082">scale</a></td></tr>
<tr class="separator:a5c8962f6e7348bb37b8f877e7cf91082"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:ab829c6cc2e53f09a6ab263b76734c222"><td class="memItemLeft" align="right" valign="top">class&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#ab829c6cc2e53f09a6ab263b76734c222">io::Unload</a></td></tr>
<tr class="separator:ab829c6cc2e53f09a6ab263b76734c222"><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>Specifies the precision model of the <a class="el" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates. ">Coordinate</a> in a <a class="el" href="classgeos_1_1geom_1_1Geometry.html" title="Basic implementation of Geometry, constructed and destructed by GeometryFactory. ">Geometry</a>. </p>
<p>In other words, specifies the grid of allowable points for all <code><a class="el" href="classgeos_1_1geom_1_1Geometry.html" title="Basic implementation of Geometry, constructed and destructed by GeometryFactory. ">Geometry</a></code>s.</p>
<p>The makePrecise method allows rounding a coordinate to a "precise" value; that is, one whose precision is known exactly.</p>
<p>Coordinates are assumed to be precise in geometries. That is, the coordinates are assumed to be rounded to the precision model given for the geometry. JTS input routines automatically round coordinates to the precision model before creating Geometries. All internal operations assume that coordinates are rounded to the precision model. Constructive methods (such as boolean operations) always round computed coordinates to the appropriate precision model.</p>
<p>Currently three types of precision model are supported:</p><ul>
<li>FLOATING - represents full double precision floating point. This is the default precision model used in JTS</li>
<li>FLOATING_SINGLE - represents single precision floating point.</li>
<li>FIXED - represents a model with a fixed number of decimal places. A Fixed Precision Model is specified by a scale factor. The scale factor specifies the grid which numbers are rounded to. Input coordinates are mapped to fixed coordinates according to the following equations:<ul>
<li>jtsPt.x = round( inputPt.x * scale ) / scale</li>
<li>jtsPt.y = round( inputPt.y * scale ) / scale</li>
</ul>
</li>
</ul>
<p>For example, to specify 3 decimal places of precision, use a scale factor of 1000. To specify -3 decimal places of precision (i.e. rounding to the nearest 1000), use a scale factor of 0.001.</p>
<p>Coordinates are represented internally as Java double-precision values. Since Java uses the IEEE-394 floating point standard, this provides 53 bits of precision. (Thus the maximum precisely representable integer is 9,007,199,254,740,992).</p>
<p>JTS methods currently do not handle inputs with different precision models. </p>
<p>Definition at line <a class="el" href="PrecisionModel_8h_source.html#l00087">87</a> of file <a class="el" href="PrecisionModel_8h_source.html">PrecisionModel.h</a>.</p>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a class="anchor" id="aa32be4a02d1faf45306fee75d68a2e12"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#aa32be4a02d1faf45306fee75d68a2e12">geos::geom::PrecisionModel::Type</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>The types of Precision Model which GEOS supports. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="aa32be4a02d1faf45306fee75d68a2e12a702c5051872b1eae28e5f8d3c0f2e8af"></a>FIXED&#160;</td><td class="fielddoc">
<p>Fixed Precision indicates that coordinates have a fixed number of decimal places. The number of decimal places is determined by the log10 of the scale factor. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="aa32be4a02d1faf45306fee75d68a2e12a871d90e033044acdd1db738dc2934aaf"></a>FLOATING&#160;</td><td class="fielddoc">
<p>Floating precision corresponds to the standard Java double-precision floating-point representation, which is based on the IEEE-754 standard </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="aa32be4a02d1faf45306fee75d68a2e12aec6ecfa3e6b4087810606e2a41111035"></a>FLOATING_SINGLE&#160;</td><td class="fielddoc">
<p>Floating single precision corresponds to the standard Java single-precision floating-point representation, which is based on the IEEE-754 standard </p>
</td></tr>
</table>
<p>Definition at line <a class="el" href="PrecisionModel_8h_source.html#l00093">93</a> of file <a class="el" href="PrecisionModel_8h_source.html">PrecisionModel.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a9f4af835c0ca26c06fe20d03dac79322"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">geos::geom::PrecisionModel::PrecisionModel </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html" title="Specifies the precision model of the Coordinate in a Geometry. ">PrecisionModel</a> with a default precision of FLOATING. </p>
</div>
</div>
<a class="anchor" id="ac6bb03bcd215e6d42406e3c8fbaaae1e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">geos::geom::PrecisionModel::PrecisionModel </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#aa32be4a02d1faf45306fee75d68a2e12">Type</a>&#160;</td>
<td class="paramname"><em>nModelType</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html" title="Specifies the precision model of the Coordinate in a Geometry. ">PrecisionModel</a> specifying an explicit precision model type.</p>
<p>If the model type is FIXED the scale factor will default to 1.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">nModelType</td><td>the type of the precision model </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a5c68e7a03195a03d2a89fe24b9aa346a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">geos::geom::PrecisionModel::PrecisionModel </td>
<td>(</td>
<td class="paramtype">double&#160;</td>
<td class="paramname"><em>newScale</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double&#160;</td>
<td class="paramname"><em>newOffsetX</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double&#160;</td>
<td class="paramname"><em>newOffsetY</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a <code><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html" title="Specifies the precision model of the Coordinate in a Geometry. ">PrecisionModel</a></code> with Fixed precision. </p>
<p>Fixed-precision coordinates are represented as precise internal coordinates, which are rounded to the grid defined by the scale factor.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">newScale</td><td>amount by which to multiply a coordinate after subtracting the offset, to obtain a precise coordinate </td></tr>
<tr><td class="paramname">newOffsetX</td><td>not used. </td></tr>
<tr><td class="paramname">newOffsetY</td><td>not used.</td></tr>
</table>
</dd>
</dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000001">Deprecated:</a></b></dt><dd>offsets are no longer supported, since internal representation is rounded floating point </dd></dl>
</div>
</div>
<a class="anchor" id="ab7b6f3c8fc62bb29bb7eb665c969486a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">geos::geom::PrecisionModel::PrecisionModel </td>
<td>(</td>
<td class="paramtype">double&#160;</td>
<td class="paramname"><em>newScale</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html" title="Specifies the precision model of the Coordinate in a Geometry. ">PrecisionModel</a> with Fixed precision. </p>
<p>Fixed-precision coordinates are represented as precise internal coordinates which are rounded to the grid defined by the scale factor.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">newScale</td><td>amount by which to multiply a coordinate after subtracting the offset, to obtain a precise coordinate </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="acf4a8556c689a152b4f6f51284ad1c88"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int geos::geom::PrecisionModel::compareTo </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html">PrecisionModel</a> *&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Compares this <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html" title="Specifies the precision model of the Coordinate in a Geometry. ">PrecisionModel</a> object with the specified object for order. </p>
<p>A <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html" title="Specifies the precision model of the Coordinate in a Geometry. ">PrecisionModel</a> is greater than another if it provides greater precision. The comparison is based on the value returned by the getMaximumSignificantDigits method. This comparison is not strictly accurate when comparing floating precision models to fixed models; however, it is correct when both models are either floating or fixed.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">other</td><td>the <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html" title="Specifies the precision model of the Coordinate in a Geometry. ">PrecisionModel</a> with which this <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html" title="Specifies the precision model of the Coordinate in a Geometry. ">PrecisionModel</a> is being compared </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a negative integer, zero, or a positive integer as this <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html" title="Specifies the precision model of the Coordinate in a Geometry. ">PrecisionModel</a> is less than, equal to, or greater than the specified <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html" title="Specifies the precision model of the Coordinate in a Geometry. ">PrecisionModel</a>. </dd></dl>
</div>
</div>
<a class="anchor" id="ab414dc6879f0e81e9672dc04ad00e4e1"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int geos::geom::PrecisionModel::getMaximumSignificantDigits </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the maximum number of significant digits provided by this precision model. </p>
<p>Intended for use by routines which need to print out precise values.</p>
<dl class="section return"><dt>Returns</dt><dd>the maximum number of decimal places provided by this precision model </dd></dl>
</div>
</div>
<a class="anchor" id="abd9ded598191954a40e40aaabed6242d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double geos::geom::PrecisionModel::getOffsetX </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the x-offset used to obtain a precise coordinate.</p>
<dl class="section return"><dt>Returns</dt><dd>the amount by which to subtract the x-coordinate before multiplying by the scale </dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000002">Deprecated:</a></b></dt><dd>Offsets are no longer used </dd></dl>
</div>
</div>
<a class="anchor" id="ae0772ba6e7f4df08bb4e38a9cc80cf0b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double geos::geom::PrecisionModel::getOffsetY </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the y-offset used to obtain a precise coordinate.</p>
<dl class="section return"><dt>Returns</dt><dd>the amount by which to subtract the y-coordinate before multiplying by the scale </dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000003">Deprecated:</a></b></dt><dd>Offsets are no longer used </dd></dl>
</div>
</div>
<a class="anchor" id="a457c0f35f3ae4193c5713ac99a400bc8"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double geos::geom::PrecisionModel::getScale </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the multiplying factor used to obtain a precise coordinate. </p>
</div>
</div>
<a class="anchor" id="a3ec7a6585c53fba22cf6b30fe1077abb"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#aa32be4a02d1faf45306fee75d68a2e12">Type</a> geos::geom::PrecisionModel::getType </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Gets the type of this <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html" title="Specifies the precision model of the Coordinate in a Geometry. ">PrecisionModel</a></p>
<dl class="section return"><dt>Returns</dt><dd>the type of this <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html" title="Specifies the precision model of the Coordinate in a Geometry. ">PrecisionModel</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ac9fd3cbb862a16a46d3ebcf601fc81fb"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool geos::geom::PrecisionModel::isFloating </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Tests whether the precision model supports floating point</p>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the precision model supports floating point </dd></dl>
</div>
</div>
<a class="anchor" id="ac93fddf641db2575293d8987b75053af"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double geos::geom::PrecisionModel::makePrecise </td>
<td>(</td>
<td class="paramtype">double&#160;</td>
<td class="paramname"><em>val</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Rounds a numeric value to the <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html" title="Specifies the precision model of the Coordinate in a Geometry. ">PrecisionModel</a> grid. </p>
<p>Asymmetric Arithmetic Rounding is used, to provide uniform rounding behaviour no matter where the number is on the number line.</p>
<p><b>Note:</b> Java's <code>Math::rint</code> uses the "Banker's Rounding" algorithm, which is not suitable for precision operations elsewhere in JTS. </p>
<p>Referenced by <a class="el" href="OffsetSegmentString_8h_source.html#l00127">geos::operation::buffer::OffsetSegmentString::addPt()</a>.</p>
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="classgeos_1_1geom_1_1PrecisionModel_ac93fddf641db2575293d8987b75053af_icgraph.svg" width="643" height="71"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
</p>
</div>
</div>
<a class="anchor" id="ade65ef4582991126ed6ebae2565b47c2"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void geos::geom::PrecisionModel::makePrecise </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;&#160;</td>
<td class="paramname"><em>coord</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Rounds the given <a class="el" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates. ">Coordinate</a> to the <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html" title="Specifies the precision model of the Coordinate in a Geometry. ">PrecisionModel</a> grid. </p>
</div>
</div>
<a class="anchor" id="aeb238d40042893586a64e92fc987653e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void geos::geom::PrecisionModel::makePrecise </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> *&#160;</td>
<td class="paramname"><em>coord</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="ac0ea69b029c71ad0ffa0bd5ca24d1756"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void geos::geom::PrecisionModel::setScale </td>
<td>(</td>
<td class="paramtype">double&#160;</td>
<td class="paramname"><em>newScale</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the multiplying factor used to obtain a precise coordinate. </p>
<p>This method is private because <a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html" title="Specifies the precision model of the Coordinate in a Geometry. ">PrecisionModel</a> is intended to be an immutable (value) type. </p>
</div>
</div>
<a class="anchor" id="a6fba7ce37a54d9bce731f6a1f069b31d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::string geos::geom::PrecisionModel::toString </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Friends And Related Function Documentation</h2>
<a class="anchor" id="ab829c6cc2e53f09a6ab263b76734c222"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">friend class <a class="el" href="classgeos_1_1io_1_1Unload.html">io::Unload</a></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="PrecisionModel_8h_source.html#l00088">88</a> of file <a class="el" href="PrecisionModel_8h_source.html">PrecisionModel.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a92ff29ac9cd8f93f1ab9283788313a5e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const double geos::geom::PrecisionModel::maximumPreciseValue</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>The maximum precise value representable in a double.</p>
<p>Since IEE754 double-precision numbers allow 53 bits of mantissa, the value is equal to 2^53 - 1. This provides <em>almost</em> 16 decimal digits of precision. </p>
<p>Definition at line <a class="el" href="PrecisionModel_8h_source.html#l00166">166</a> of file <a class="el" href="PrecisionModel_8h_source.html">PrecisionModel.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2217bfa530c0a602bcb268fec65b2716"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classgeos_1_1geom_1_1PrecisionModel.html#aa32be4a02d1faf45306fee75d68a2e12">Type</a> geos::geom::PrecisionModel::modelType</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="PrecisionModel_8h_source.html#l00307">307</a> of file <a class="el" href="PrecisionModel_8h_source.html">PrecisionModel.h</a>.</p>
</div>
</div>
<a class="anchor" id="a5c8962f6e7348bb37b8f877e7cf91082"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">double geos::geom::PrecisionModel::scale</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="PrecisionModel_8h_source.html#l00309">309</a> of file <a class="el" href="PrecisionModel_8h_source.html">PrecisionModel.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="PrecisionModel_8h_source.html">PrecisionModel.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>