1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>strategy::buffer::point_circle</title> 5<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../../../index.html" title="Chapter 1. Geometry"> 8<link rel="up" href="../strategies.html" title="Strategies"> 9<link rel="prev" href="strategy_buffer_distance_asymmetric.html" title="strategy::buffer::distance_asymmetric"> 10<link rel="next" href="strategy_buffer_point_square.html" title="strategy::buffer::point_square"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td> 15<td align="center"><a href="../../../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="strategy_buffer_distance_asymmetric.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../strategies.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="strategy_buffer_point_square.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h4 class="title"> 27<a name="geometry.reference.strategies.strategy_buffer_point_circle"></a><a class="link" href="strategy_buffer_point_circle.html" title="strategy::buffer::point_circle">strategy::buffer::point_circle</a> 28</h4></div></div></div> 29<p> 30 <a class="indexterm" name="idm45635670393632"></a><a class="indexterm" name="idm45635670392944"></a><a class="indexterm" name="idm45635670392256"></a> 31Create a circular buffer around a point. 32 </p> 33<h6> 34<a name="geometry.reference.strategies.strategy_buffer_point_circle.h0"></a> 35 <span class="phrase"><a name="geometry.reference.strategies.strategy_buffer_point_circle.description"></a></span><a class="link" href="strategy_buffer_point_circle.html#geometry.reference.strategies.strategy_buffer_point_circle.description">Description</a> 36 </h6> 37<p> 38 This strategy can be used as PointStrategy for the buffer algorithm. It 39 creates a circular buffer around a point. It can be applied for points 40 and multi_points, but also for a linestring (if it is degenerate, so consisting 41 of only one point) and for polygons (if it is degenerate). This strategy 42 is only applicable for Cartesian coordinate systems. 43 </p> 44<h6> 45<a name="geometry.reference.strategies.strategy_buffer_point_circle.h1"></a> 46 <span class="phrase"><a name="geometry.reference.strategies.strategy_buffer_point_circle.synopsis"></a></span><a class="link" href="strategy_buffer_point_circle.html#geometry.reference.strategies.strategy_buffer_point_circle.synopsis">Synopsis</a> 47 </h6> 48<p> 49</p> 50<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">strategy</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">::</span><span class="identifier">point_circle</span> 51<span class="special">{</span> 52 <span class="comment">// ...</span> 53<span class="special">};</span> 54</pre> 55<p> 56 </p> 57<h6> 58<a name="geometry.reference.strategies.strategy_buffer_point_circle.h2"></a> 59 <span class="phrase"><a name="geometry.reference.strategies.strategy_buffer_point_circle.constructor_s_"></a></span><a class="link" href="strategy_buffer_point_circle.html#geometry.reference.strategies.strategy_buffer_point_circle.constructor_s_">Constructor(s)</a> 60 </h6> 61<div class="informaltable"><table class="table"> 62<colgroup> 63<col> 64<col> 65<col> 66</colgroup> 67<thead><tr> 68<th> 69 <p> 70 Function 71 </p> 72 </th> 73<th> 74 <p> 75 Description 76 </p> 77 </th> 78<th> 79 <p> 80 Parameters 81 </p> 82 </th> 83</tr></thead> 84<tbody><tr> 85<td> 86 <p> 87</p> 88<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">point_circle</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">count</span> <span class="special">=</span> <span class="number">90</span><span class="special">)</span></pre> 89<p> 90 </p> 91 </td> 92<td> 93 <p> 94 Constructs the strategy. 95 </p> 96 </td> 97<td> 98 <p> 99 <span class="bold"><strong>std::size_t</strong></span>: <span class="emphasis"><em>count</em></span>: 100 number of points for the created circle (if count is smaller 101 than 3, count is internally set to 3) 102 </p> 103 </td> 104</tr></tbody> 105</table></div> 106<h6> 107<a name="geometry.reference.strategies.strategy_buffer_point_circle.h3"></a> 108 <span class="phrase"><a name="geometry.reference.strategies.strategy_buffer_point_circle.header"></a></span><a class="link" href="strategy_buffer_point_circle.html#geometry.reference.strategies.strategy_buffer_point_circle.header">Header</a> 109 </h6> 110<p> 111 <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">strategies</span><span class="special">/</span><span class="identifier">cartesian</span><span class="special">/</span><span class="identifier">buffer_point_circle</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code> 112 </p> 113<h6> 114<a name="geometry.reference.strategies.strategy_buffer_point_circle.h4"></a> 115 <span class="phrase"><a name="geometry.reference.strategies.strategy_buffer_point_circle.example"></a></span><a class="link" href="strategy_buffer_point_circle.html#geometry.reference.strategies.strategy_buffer_point_circle.example">Example</a> 116 </h6> 117<p> 118 Shows how the point_circle strategy can be used as a PointStrategy to create 119 circular buffers around points 120 </p> 121<p> 122</p> 123<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 124<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">point_xy</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 125<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 126 127 128<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> 129<span class="special">{</span> 130 <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">d2</span><span class="special">::</span><span class="identifier">point_xy</span><span class="special"><</span><span class="keyword">double</span><span class="special">></span> <span class="identifier">point</span><span class="special">;</span> 131 <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">polygon</span><span class="special"><</span><span class="identifier">point</span><span class="special">></span> <span class="identifier">polygon</span><span class="special">;</span> 132 133 <span class="comment">// Declare the point_circle strategy</span> 134 <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">strategy</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">::</span><span class="identifier">point_circle</span> <span class="identifier">point_strategy</span><span class="special">(</span><span class="number">360</span><span class="special">);</span> 135 136 <span class="comment">// Declare other strategies</span> 137 <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">strategy</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">::</span><span class="identifier">distance_symmetric</span><span class="special"><</span><span class="keyword">double</span><span class="special">></span> <span class="identifier">distance_strategy</span><span class="special">(</span><span class="number">0.7</span><span class="special">);</span> 138 <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">strategy</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">::</span><span class="identifier">join_round</span> <span class="identifier">join_strategy</span><span class="special">;</span> 139 <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">strategy</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">::</span><span class="identifier">end_round</span> <span class="identifier">end_strategy</span><span class="special">;</span> 140 <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">strategy</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">::</span><span class="identifier">side_straight</span> <span class="identifier">side_strategy</span><span class="special">;</span> 141 142 <span class="comment">// Declare/fill of a multi point</span> 143 <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">multi_point</span><span class="special"><</span><span class="identifier">point</span><span class="special">></span> <span class="identifier">mp</span><span class="special">;</span> 144 <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">read_wkt</span><span class="special">(</span><span class="string">"MULTIPOINT((3 3),(3 4),(4 4),(7 3))"</span><span class="special">,</span> <span class="identifier">mp</span><span class="special">);</span> 145 146 <span class="comment">// Create the buffer of a multi point</span> 147 <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">multi_polygon</span><span class="special"><</span><span class="identifier">polygon</span><span class="special">></span> <span class="identifier">result</span><span class="special">;</span> 148 <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">(</span><span class="identifier">mp</span><span class="special">,</span> <span class="identifier">result</span><span class="special">,</span> 149 <span class="identifier">distance_strategy</span><span class="special">,</span> <span class="identifier">side_strategy</span><span class="special">,</span> 150 <span class="identifier">join_strategy</span><span class="special">,</span> <span class="identifier">end_strategy</span><span class="special">,</span> <span class="identifier">point_strategy</span><span class="special">);</span> 151 152 153 <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span> 154<span class="special">}</span> 155</pre> 156<p> 157 </p> 158<h6> 159<a name="geometry.reference.strategies.strategy_buffer_point_circle.h5"></a> 160 <span class="phrase"><a name="geometry.reference.strategies.strategy_buffer_point_circle.output"></a></span><a class="link" href="strategy_buffer_point_circle.html#geometry.reference.strategies.strategy_buffer_point_circle.output">Output</a> 161 </h6> 162<p> 163 <span class="inlinemediaobject"><img src="../../../img/strategies/buffer_point_circle.png" alt="buffer_point_circle"></span> 164 </p> 165<h6> 166<a name="geometry.reference.strategies.strategy_buffer_point_circle.h6"></a> 167 <span class="phrase"><a name="geometry.reference.strategies.strategy_buffer_point_circle.see_also"></a></span><a class="link" href="strategy_buffer_point_circle.html#geometry.reference.strategies.strategy_buffer_point_circle.see_also">See 168 also</a> 169 </h6> 170<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 171<li class="listitem"> 172 <a class="link" href="../algorithms/buffer/buffer_7_with_strategies.html" title="buffer (with strategies)">buffer 173 (with strategies)</a> 174 </li> 175<li class="listitem"> 176 <a class="link" href="strategy_buffer_point_square.html" title="strategy::buffer::point_square">point_square</a> 177 </li> 178<li class="listitem"> 179 <a class="link" href="strategy_buffer_geographic_point_circle.html" title="strategy::buffer::geographic_point_circle">geographic_point_circle</a> 180 </li> 181</ul></div> 182</div> 183<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 184<td align="left"></td> 185<td align="right"><div class="copyright-footer">Copyright © 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam 186 Wulkiewicz, Oracle and/or its affiliates<p> 187 Distributed under the Boost Software License, Version 1.0. (See accompanying 188 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 189 </p> 190</div></td> 191</tr></table> 192<hr> 193<div class="spirit-nav"> 194<a accesskey="p" href="strategy_buffer_distance_asymmetric.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../strategies.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="strategy_buffer_point_square.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> 195</div> 196</body> 197</html> 198