geometry/doc/doxygen_output/html/labelinfo_8hpp_source.html
Barend Gehrels 363580fbf6 Added old doxygen docs
[SVN r59777]
2010-02-20 15:57:12 +00:00

168 lines
14 KiB
HTML
Raw Blame History

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Boost.Geometry (aka GGL, Generic Geometry Library)</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head>
<table cellpadding="2" width="100%">
<tbody>
<tr>
<td valign="top">
<img alt="Boost.Geometry" src="images/ggl-logo-big.png" height="80" width="200">
&nbsp;&nbsp;
</td>
<td valign="top" align="right">
<a href="http://www.boost.org">
<img alt="Boost C++ Libraries" src="images/accepted_by_boost.png" height="80" width="230" border="0">
</a>
</td>
</tr>
</tbody>
</table>
<!-- 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="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</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>
<li><a href="examples.html"><span>Examples</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<h1>boost/geometry/algorithms/labelinfo.hpp</h1><a href="labelinfo_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Boost.Geometry (aka GGL, Generic Geometry Library)</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands.</span>
<a name="l00004"></a>00004 <span class="comment">// Copyright Bruno Lalande 2008, 2009</span>
<a name="l00005"></a>00005 <span class="comment">// Use, modification and distribution is subject to the Boost Software License,</span>
<a name="l00006"></a>00006 <span class="comment">// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at</span>
<a name="l00007"></a>00007 <span class="comment">// http://www.boost.org/LICENSE_1_0.txt)</span>
<a name="l00008"></a>00008
<a name="l00009"></a>00009 <span class="preprocessor">#ifndef BOOST_GEOMETRY_ALGORITHMS_LABELINFO_HPP</span>
<a name="l00010"></a>00010 <span class="preprocessor"></span><span class="preprocessor">#define BOOST_GEOMETRY_ALGORITHMS_LABELINFO_HPP</span>
<a name="l00011"></a>00011 <span class="preprocessor"></span>
<a name="l00012"></a>00012 <span class="comment">// Algorithms to generate appropriate labelpoint(s) for all geometries</span>
<a name="l00013"></a>00013
<a name="l00014"></a>00014
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;<a class="code" href="algorithms_2centroid_8hpp.html">boost/geometry/algorithms/centroid.hpp</a>&gt;</span>
<a name="l00016"></a>00016
<a name="l00017"></a>00017 <span class="keyword">namespace </span>boost { <span class="keyword">namespace </span>geometry
<a name="l00018"></a>00018 {
<a name="l00019"></a>00019
<a name="l00020"></a>00020 <span class="comment">// For a polygon the broadest line is probably the best, so two points (left/right)</span>
<a name="l00021"></a>00021 <span class="comment">// For a line either the centerpoint, of the longest line, or the most horizontal line,</span>
<a name="l00022"></a>00022 <span class="comment">// or more than two points to smooth the text around some points. So one/two or more points.</span>
<a name="l00023"></a>00023 <span class="comment">// For a point just return the point.</span>
<a name="l00024"></a>00024
<a name="l00025"></a>00025 <span class="comment">// The algorithms output to an output iterator</span>
<a name="l00026"></a>00026 <span class="comment">// They have a label_option to influence behaviour. Not yet implemented.</span>
<a name="l00027"></a>00027 <span class="comment">// Is there a better approach? Class?</span>
<a name="l00028"></a>00028
<a name="l00029"></a><a class="code" href="namespaceboost_1_1geometry.html#382ec2ca431737ef0557e0073ab6a473">00029</a> <span class="keyword">enum</span> <a class="code" href="namespaceboost_1_1geometry.html#382ec2ca431737ef0557e0073ab6a473">label_option</a>
<a name="l00030"></a>00030 {
<a name="l00031"></a><a class="code" href="namespaceboost_1_1geometry.html#382ec2ca431737ef0557e0073ab6a473f18b68efbfadc8d4c6f3bdb4c58260d3">00031</a> <a class="code" href="namespaceboost_1_1geometry.html#382ec2ca431737ef0557e0073ab6a473f18b68efbfadc8d4c6f3bdb4c58260d3">label_default</a>,
<a name="l00032"></a>00032 <span class="comment">// line</span>
<a name="l00033"></a><a class="code" href="namespaceboost_1_1geometry.html#382ec2ca431737ef0557e0073ab6a4738f7107d9565307c23add37f332d66774">00033</a> <a class="code" href="namespaceboost_1_1geometry.html#382ec2ca431737ef0557e0073ab6a4738f7107d9565307c23add37f332d66774">label_longest</a>,
<a name="l00034"></a><a class="code" href="namespaceboost_1_1geometry.html#382ec2ca431737ef0557e0073ab6a4730301f53903ab3d9299ce285eb0a3a34d">00034</a> <a class="code" href="namespaceboost_1_1geometry.html#382ec2ca431737ef0557e0073ab6a4730301f53903ab3d9299ce285eb0a3a34d">label_horizontal</a>,
<a name="l00035"></a>00035 <span class="comment">// polygon</span>
<a name="l00036"></a><a class="code" href="namespaceboost_1_1geometry.html#382ec2ca431737ef0557e0073ab6a4739378ef965d7975bba294fe86e1d6662c">00036</a> <a class="code" href="namespaceboost_1_1geometry.html#382ec2ca431737ef0557e0073ab6a4739378ef965d7975bba294fe86e1d6662c">label_centroid</a>,
<a name="l00037"></a><a class="code" href="namespaceboost_1_1geometry.html#382ec2ca431737ef0557e0073ab6a473502513e6b38ef2797b9792dc0aea7908">00037</a> <a class="code" href="namespaceboost_1_1geometry.html#382ec2ca431737ef0557e0073ab6a473502513e6b38ef2797b9792dc0aea7908">label_broadest</a>
<a name="l00038"></a>00038 };
<a name="l00039"></a>00039
<a name="l00040"></a>00040 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> P, <span class="keyword">typename</span> M&gt;
<a name="l00041"></a>00041 <span class="keyword">inline</span>
<a name="l00042"></a>00042 BOOST_CONCEPT_REQUIRES(((Point&lt;P&gt;))
<a name="l00043"></a><a class="code" href="namespaceboost_1_1geometry.html#3b9e94c1ab353f81fa06e80498a7855a">00043</a> (<span class="keywordtype">void</span>)) <a class="code" href="namespaceboost_1_1geometry.html#3b9e94c1ab353f81fa06e80498a7855a">label_info_point</a>(const P&amp; <a class="code" href="classboost_1_1geometry_1_1point.html" title="Basic point class, having coordinates defined in a neutral way.">point</a>, <a class="code" href="namespaceboost_1_1geometry.html#382ec2ca431737ef0557e0073ab6a473">label_option</a> option, M&amp; mp)
<a name="l00044"></a>00044 {
<a name="l00045"></a>00045 mp.resize(1);
<a name="l00046"></a>00046 get&lt;0&gt;(mp.front()) = get&lt;0&gt;(point);
<a name="l00047"></a>00047 get&lt;1&gt;(mp.front()) = get&lt;1&gt;(point);
<a name="l00048"></a>00048 }
<a name="l00049"></a>00049
<a name="l00050"></a>00050 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Y, <span class="keyword">typename</span> M&gt;
<a name="l00051"></a><a class="code" href="namespaceboost_1_1geometry.html#e36f68485b981d37c273d49d1dc8473b">00051</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespaceboost_1_1geometry.html#e36f68485b981d37c273d49d1dc8473b">label_info_polygon</a>(<span class="keyword">const</span> Y&amp; poly, <a class="code" href="namespaceboost_1_1geometry.html#382ec2ca431737ef0557e0073ab6a473">label_option</a> option, M&amp; mp)
<a name="l00052"></a>00052 {
<a name="l00053"></a>00053 mp.resize(0);
<a name="l00054"></a>00054 mp.push_back(centroid_polygon&lt;<span class="keyword">typename</span> boost::range_value&lt;M&gt;::type&gt;(poly));
<a name="l00055"></a>00055 }
<a name="l00056"></a>00056
<a name="l00057"></a>00057 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> B, <span class="keyword">typename</span> M&gt;
<a name="l00058"></a><a class="code" href="namespaceboost_1_1geometry.html#44aaaee750bf8e150cc56b9b430ad1d8">00058</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespaceboost_1_1geometry.html#44aaaee750bf8e150cc56b9b430ad1d8">label_info_box</a>(<span class="keyword">const</span> B&amp; <a class="code" href="classboost_1_1geometry_1_1box.html" title="Class box: defines a box made of two describing points.">box</a>, <a class="code" href="namespaceboost_1_1geometry.html#382ec2ca431737ef0557e0073ab6a473">label_option</a> option, M&amp; mp)
<a name="l00059"></a>00059 {
<a name="l00060"></a>00060 mp.resize(0);
<a name="l00061"></a>00061 mp.push_back(centroid_box(box));
<a name="l00062"></a>00062 }
<a name="l00063"></a>00063
<a name="l00064"></a>00064 <span class="comment">//-------------------------------------------------------------------------------------------------------</span>
<a name="l00065"></a>00065 <span class="comment">// General "label_info" versions</span>
<a name="l00066"></a>00066 <span class="comment">//-------------------------------------------------------------------------------------------------------</span>
<a name="l00067"></a>00067 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> P, <span class="keyword">typename</span> M&gt;
<a name="l00068"></a>00068 <span class="keyword">inline</span>
<a name="l00069"></a>00069 BOOST_CONCEPT_REQUIRES(((ConstPoint&lt;P&gt;))
<a name="l00070"></a><a class="code" href="namespaceboost_1_1geometry.html#2824acfcac0e9e6f1c130cbc877c2a24">00070</a> (<span class="keywordtype">void</span>)) <a class="code" href="namespaceboost_1_1geometry.html#2824acfcac0e9e6f1c130cbc877c2a24">label_info</a>(const P&amp; p, <a class="code" href="namespaceboost_1_1geometry.html#382ec2ca431737ef0557e0073ab6a473">label_option</a> option, M&amp; mp)
<a name="l00071"></a>00071 {
<a name="l00072"></a>00072 <a class="code" href="namespaceboost_1_1geometry.html#3b9e94c1ab353f81fa06e80498a7855a">label_info_point</a>(p, option, mp);
<a name="l00073"></a>00073 }
<a name="l00074"></a>00074
<a name="l00075"></a>00075 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> P, <span class="keyword">typename</span> M&gt;
<a name="l00076"></a>00076 <span class="keyword">inline</span>
<a name="l00077"></a>00077 BOOST_CONCEPT_REQUIRES(((ConstPoint&lt;P&gt;))
<a name="l00078"></a><a class="code" href="namespaceboost_1_1geometry.html#6e99b001851e3f5a2cc2f3d0518bde6e">00078</a> (<span class="keywordtype">void</span>)) <a class="code" href="namespaceboost_1_1geometry.html#2824acfcac0e9e6f1c130cbc877c2a24">label_info</a>(const <a class="code" href="classboost_1_1geometry_1_1box.html" title="Class box: defines a box made of two describing points.">box</a>&lt;P&gt;&amp; b, <a class="code" href="namespaceboost_1_1geometry.html#382ec2ca431737ef0557e0073ab6a473">label_option</a> option, M&amp; mp)
<a name="l00079"></a>00079 {
<a name="l00080"></a>00080 <a class="code" href="namespaceboost_1_1geometry.html#44aaaee750bf8e150cc56b9b430ad1d8">label_info_box</a>(b, option, mp);
<a name="l00081"></a>00081 }
<a name="l00082"></a>00082
<a name="l00083"></a>00083 <span class="keyword">template</span>
<a name="l00084"></a>00084 &lt;
<a name="l00085"></a>00085 <span class="keyword">typename</span> P,
<a name="l00086"></a>00086 <span class="keyword">template</span>&lt;<span class="keyword">typename</span>, <span class="keyword">typename</span>&gt; <span class="keyword">class </span><a class="code" href="class_point_list.html">PointList</a>,
<a name="l00087"></a>00087 <span class="keyword">template</span>&lt;<span class="keyword">typename</span>, <span class="keyword">typename</span>&gt; <span class="keyword">class </span>RingList,
<a name="l00088"></a>00088 <span class="keyword">template</span>&lt;<span class="keyword">typename</span>&gt; <span class="keyword">class </span>PointAlloc,
<a name="l00089"></a>00089 <span class="keyword">template</span>&lt;<span class="keyword">typename</span>&gt; <span class="keyword">class </span>RingAlloc,
<a name="l00090"></a>00090 <span class="keyword">typename</span> M
<a name="l00091"></a>00091 &gt;
<a name="l00092"></a>00092 <span class="keyword">inline</span>
<a name="l00093"></a>00093 BOOST_CONCEPT_REQUIRES(((ConstPoint&lt;P&gt;))
<a name="l00094"></a><a class="code" href="namespaceboost_1_1geometry.html#017936ebc3b030be0f2427ed82af646f">00094</a> (<span class="keywordtype">void</span>)) <a class="code" href="namespaceboost_1_1geometry.html#2824acfcac0e9e6f1c130cbc877c2a24">label_info</a>(const <a class="code" href="classboost_1_1geometry_1_1polygon.html" title="The polygon contains an outer ring and zero or more inner rings.">polygon</a>&lt;P, <a class="code" href="class_point_list.html">PointList</a>, RingList, PointAlloc, RingAlloc&gt;&amp; poly, <a class="code" href="namespaceboost_1_1geometry.html#382ec2ca431737ef0557e0073ab6a473">label_option</a> option, M&amp; mp)
<a name="l00095"></a>00095 {
<a name="l00096"></a>00096 <a class="code" href="namespaceboost_1_1geometry.html#e36f68485b981d37c273d49d1dc8473b">label_info_polygon</a>(poly, option, mp);
<a name="l00097"></a>00097 }
<a name="l00098"></a>00098
<a name="l00099"></a>00099 }} <span class="comment">// namespace boost::geometry</span>
<a name="l00100"></a>00100
<a name="l00101"></a>00101 <span class="preprocessor">#endif // BOOST_GEOMETRY_ALGORITHMS_LABELINFO_HPP</span>
</pre></div></div>
<hr size="1">
<table width="100%">
<tbody>
<tr>
<td align="left"><small>
<p>December 1, 2009</p>
</small></td>
<td align="right">
<small>Copyright <20> 1995-2009 Barend Gehrels, Geodan, Amsterdam<br>
Copyright <20> 2008-2009 Bruno Lalande, Paris<br>
Copyright <20> 2009 Mateusz Loskot, Cadcorp, London<br>
</small>
</td>
</tr>
</tbody>
</table>
<address style="text-align: right;"><small>
Documentation is generated by&nbsp;<a href="http://www.doxygen.org/index.html">Doxygen</a>
</small></address>
</body>
</html>