• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>strategy::buffer::join_round</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_area_geographic.html" title="strategy::area::geographic">
10<link rel="next" href="strategy_buffer_join_miter.html" title="strategy::buffer::join_miter">
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_area_geographic.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_join_miter.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_join_round"></a><a class="link" href="strategy_buffer_join_round.html" title="strategy::buffer::join_round">strategy::buffer::join_round</a>
28</h4></div></div></div>
29<p>
30          <a class="indexterm" name="idm45635671454480"></a><a class="indexterm" name="idm45635671453792"></a><a class="indexterm" name="idm45635671453104"></a>
31Let the buffer create rounded corners.
32        </p>
33<h6>
34<a name="geometry.reference.strategies.strategy_buffer_join_round.h0"></a>
35          <span class="phrase"><a name="geometry.reference.strategies.strategy_buffer_join_round.description"></a></span><a class="link" href="strategy_buffer_join_round.html#geometry.reference.strategies.strategy_buffer_join_round.description">Description</a>
36        </h6>
37<p>
38          This strategy can be used as JoinStrategy for the buffer algorithm. It
39          creates a rounded corners around each convex vertex. It can be applied
40          for (multi)linestrings and (multi)polygons. This strategy is only applicable
41          for Cartesian coordinate systems.
42        </p>
43<h6>
44<a name="geometry.reference.strategies.strategy_buffer_join_round.h1"></a>
45          <span class="phrase"><a name="geometry.reference.strategies.strategy_buffer_join_round.synopsis"></a></span><a class="link" href="strategy_buffer_join_round.html#geometry.reference.strategies.strategy_buffer_join_round.synopsis">Synopsis</a>
46        </h6>
47<p>
48</p>
49<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">join_round</span>
50<span class="special">{</span>
51  <span class="comment">// ...</span>
52<span class="special">};</span>
53</pre>
54<p>
55        </p>
56<h6>
57<a name="geometry.reference.strategies.strategy_buffer_join_round.h2"></a>
58          <span class="phrase"><a name="geometry.reference.strategies.strategy_buffer_join_round.constructor_s_"></a></span><a class="link" href="strategy_buffer_join_round.html#geometry.reference.strategies.strategy_buffer_join_round.constructor_s_">Constructor(s)</a>
59        </h6>
60<div class="informaltable"><table class="table">
61<colgroup>
62<col>
63<col>
64<col>
65</colgroup>
66<thead><tr>
67<th>
68                  <p>
69                    Function
70                  </p>
71                </th>
72<th>
73                  <p>
74                    Description
75                  </p>
76                </th>
77<th>
78                  <p>
79                    Parameters
80                  </p>
81                </th>
82</tr></thead>
83<tbody><tr>
84<td>
85                  <p>
86</p>
87<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">join_round</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">points_per_circle</span> <span class="special">=</span> <span class="number">90</span><span class="special">)</span></pre>
88<p>
89                  </p>
90                </td>
91<td>
92                  <p>
93                    Constructs the strategy.
94                  </p>
95                </td>
96<td>
97                  <p>
98                    <span class="bold"><strong>std::size_t</strong></span>: <span class="emphasis"><em>points_per_circle</em></span>:
99                    points which would be used for a full circle
100                  </p>
101                </td>
102</tr></tbody>
103</table></div>
104<h6>
105<a name="geometry.reference.strategies.strategy_buffer_join_round.h3"></a>
106          <span class="phrase"><a name="geometry.reference.strategies.strategy_buffer_join_round.header"></a></span><a class="link" href="strategy_buffer_join_round.html#geometry.reference.strategies.strategy_buffer_join_round.header">Header</a>
107        </h6>
108<p>
109          <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special">&lt;</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_join_round</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
110        </p>
111<h6>
112<a name="geometry.reference.strategies.strategy_buffer_join_round.h4"></a>
113          <span class="phrase"><a name="geometry.reference.strategies.strategy_buffer_join_round.example"></a></span><a class="link" href="strategy_buffer_join_round.html#geometry.reference.strategies.strategy_buffer_join_round.example">Example</a>
114        </h6>
115<p>
116          Shows how the join_round strategy can be used as a JoinStrategy to create
117          rounded corners
118        </p>
119<p>
120</p>
121<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</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">&gt;</span>
122<span class="preprocessor">#include</span> <span class="special">&lt;</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">&gt;</span>
123<span class="preprocessor">#include</span> <span class="special">&lt;</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">&gt;</span>
124
125
126<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
127<span class="special">{</span>
128    <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">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="identifier">point</span><span class="special">;</span>
129    <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">&lt;</span><span class="identifier">point</span><span class="special">&gt;</span> <span class="identifier">polygon</span><span class="special">;</span>
130
131    <span class="comment">// Declare the join_round strategy with 72 points for a full circle</span>
132    <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><span class="number">72</span><span class="special">);</span>
133
134    <span class="comment">// Declare other strategies</span>
135    <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">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="identifier">distance_strategy</span><span class="special">(</span><span class="number">1.0</span><span class="special">);</span>
136    <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_flat</span> <span class="identifier">end_strategy</span><span class="special">;</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">side_straight</span> <span class="identifier">side_strategy</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">point_circle</span> <span class="identifier">point_strategy</span><span class="special">;</span>
139
140    <span class="comment">// Declare/fill a multi polygon</span>
141    <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">&lt;</span><span class="identifier">polygon</span><span class="special">&gt;</span> <span class="identifier">mp</span><span class="special">;</span>
142    <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">"MULTIPOLYGON(((5 5,7 8,9 5,5 5)),((8 7,8 10,11 10,11 7,8 7)))"</span><span class="special">,</span> <span class="identifier">mp</span><span class="special">);</span>
143
144    <span class="comment">// Create the buffered geometry with rounded corners</span>
145    <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">&lt;</span><span class="identifier">polygon</span><span class="special">&gt;</span> <span class="identifier">result</span><span class="special">;</span>
146    <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>
147                <span class="identifier">distance_strategy</span><span class="special">,</span> <span class="identifier">side_strategy</span><span class="special">,</span>
148                <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>
149
150
151    <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
152<span class="special">}</span>
153</pre>
154<p>
155        </p>
156<h6>
157<a name="geometry.reference.strategies.strategy_buffer_join_round.h5"></a>
158          <span class="phrase"><a name="geometry.reference.strategies.strategy_buffer_join_round.output"></a></span><a class="link" href="strategy_buffer_join_round.html#geometry.reference.strategies.strategy_buffer_join_round.output">Output</a>
159        </h6>
160<p>
161          <span class="inlinemediaobject"><img src="../../../img/strategies/buffer_join_round.png" alt="buffer_join_round"></span>
162        </p>
163<h6>
164<a name="geometry.reference.strategies.strategy_buffer_join_round.h6"></a>
165          <span class="phrase"><a name="geometry.reference.strategies.strategy_buffer_join_round.see_also"></a></span><a class="link" href="strategy_buffer_join_round.html#geometry.reference.strategies.strategy_buffer_join_round.see_also">See
166          also</a>
167        </h6>
168<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
169<li class="listitem">
170              <a class="link" href="../algorithms/buffer/buffer_7_with_strategies.html" title="buffer (with strategies)">buffer
171              (with strategies)</a>
172            </li>
173<li class="listitem">
174              <a class="link" href="strategy_buffer_join_miter.html" title="strategy::buffer::join_miter">join_miter</a>
175            </li>
176</ul></div>
177</div>
178<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
179<td align="left"></td>
180<td align="right"><div class="copyright-footer">Copyright © 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam
181      Wulkiewicz, Oracle and/or its affiliates<p>
182        Distributed under the Boost Software License, Version 1.0. (See accompanying
183        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>)
184      </p>
185</div></td>
186</tr></table>
187<hr>
188<div class="spirit-nav">
189<a accesskey="p" href="strategy_area_geographic.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_join_miter.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
190</div>
191</body>
192</html>
193