• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>buffer</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="../buffer.html" title="buffer">
9<link rel="prev" href="../buffer.html" title="buffer">
10<link rel="next" href="buffer_7_with_strategies.html" title="buffer (with strategies)">
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="../buffer.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../buffer.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="buffer_7_with_strategies.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="section">
26<div class="titlepage"><div><div><h5 class="title">
27<a name="geometry.reference.algorithms.buffer.buffer_4"></a><a class="link" href="buffer_4.html" title="buffer">buffer</a>
28</h5></div></div></div>
29<p>
30            <a class="indexterm" name="idm45635706375280"></a>
31Calculates the buffer of a geometry.
32          </p>
33<h6>
34<a name="geometry.reference.algorithms.buffer.buffer_4.h0"></a>
35            <span class="phrase"><a name="geometry.reference.algorithms.buffer.buffer_4.description"></a></span><a class="link" href="buffer_4.html#geometry.reference.algorithms.buffer.buffer_4.description">Description</a>
36          </h6>
37<p>
38            The free function buffer calculates the buffer (a polygon being the spatial
39            point set collection within a specified maximum distance from a geometry)
40            of a geometry.
41          </p>
42<h6>
43<a name="geometry.reference.algorithms.buffer.buffer_4.h1"></a>
44            <span class="phrase"><a name="geometry.reference.algorithms.buffer.buffer_4.synopsis"></a></span><a class="link" href="buffer_4.html#geometry.reference.algorithms.buffer.buffer_4.synopsis">Synopsis</a>
45          </h6>
46<p>
47</p>
48<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Input</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Output</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Distance</span><span class="special">&gt;</span>
49<span class="keyword">void</span> <span class="identifier">buffer</span><span class="special">(</span><span class="identifier">Input</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">geometry_in</span><span class="special">,</span> <span class="identifier">Output</span> <span class="special">&amp;</span> <span class="identifier">geometry_out</span><span class="special">,</span> <span class="identifier">Distance</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">distance</span><span class="special">,</span>
50            <span class="identifier">Distance</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">chord_length</span> <span class="special">=</span> <span class="special">-</span><span class="number">1</span><span class="special">)</span></pre>
51<p>
52          </p>
53<h6>
54<a name="geometry.reference.algorithms.buffer.buffer_4.h2"></a>
55            <span class="phrase"><a name="geometry.reference.algorithms.buffer.buffer_4.parameters"></a></span><a class="link" href="buffer_4.html#geometry.reference.algorithms.buffer.buffer_4.parameters">Parameters</a>
56          </h6>
57<div class="informaltable"><table class="table">
58<colgroup>
59<col>
60<col>
61<col>
62<col>
63</colgroup>
64<thead><tr>
65<th>
66                    <p>
67                      Type
68                    </p>
69                  </th>
70<th>
71                    <p>
72                      Concept
73                    </p>
74                  </th>
75<th>
76                    <p>
77                      Name
78                    </p>
79                  </th>
80<th>
81                    <p>
82                      Description
83                    </p>
84                  </th>
85</tr></thead>
86<tbody>
87<tr>
88<td>
89                    <p>
90                      Input const &amp;
91                    </p>
92                  </td>
93<td>
94                    <p>
95                      Any type fulfilling a Geometry Concept
96                    </p>
97                  </td>
98<td>
99                    <p>
100                      geometry_in
101                    </p>
102                  </td>
103<td>
104                    <p>
105                      A model of the specified concept
106                    </p>
107                  </td>
108</tr>
109<tr>
110<td>
111                    <p>
112                      Output &amp;
113                    </p>
114                  </td>
115<td>
116                    <p>
117                      Any type fulfilling a Geometry Concept
118                    </p>
119                  </td>
120<td>
121                    <p>
122                      geometry_out
123                    </p>
124                  </td>
125<td>
126                    <p>
127                      A model of the specified concept
128                    </p>
129                  </td>
130</tr>
131<tr>
132<td>
133                    <p>
134                      Distance const &amp;
135                    </p>
136                  </td>
137<td>
138                    <p>
139                      numerical type (int, double, ttmath, ...)
140                    </p>
141                  </td>
142<td>
143                    <p>
144                      distance
145                    </p>
146                  </td>
147<td>
148                    <p>
149                      The distance to be used for the buffer
150                    </p>
151                  </td>
152</tr>
153<tr>
154<td>
155                    <p>
156                      Distance const &amp;
157                    </p>
158                  </td>
159<td>
160                    <p>
161                      numerical type (int, double, ttmath, ...)
162                    </p>
163                  </td>
164<td>
165                    <p>
166                      chord_length
167                    </p>
168                  </td>
169<td>
170                    <p>
171                      (optional) The length of the chord's in the generated arcs
172                      around points or bends
173                    </p>
174                  </td>
175</tr>
176</tbody>
177</table></div>
178<h6>
179<a name="geometry.reference.algorithms.buffer.buffer_4.h3"></a>
180            <span class="phrase"><a name="geometry.reference.algorithms.buffer.buffer_4.header"></a></span><a class="link" href="buffer_4.html#geometry.reference.algorithms.buffer.buffer_4.header">Header</a>
181          </h6>
182<p>
183            Either
184          </p>
185<p>
186            <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">hpp</span><span class="special">&gt;</span></code>
187          </p>
188<p>
189            Or
190          </p>
191<p>
192            <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">algorithms</span><span class="special">/</span><span class="identifier">buffer</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
193          </p>
194<div class="note"><table border="0" summary="Note">
195<tr>
196<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../../../doc/src/images/note.png"></td>
197<th align="left">Note</th>
198</tr>
199<tr><td align="left" valign="top"><p>
200              This version without strategies enlarges a box. To buffer any geometry,
201              use <a class="link" href="buffer_7_with_strategies.html" title="buffer (with strategies)">buffer
202              (with strategies)</a>
203            </p></td></tr>
204</table></div>
205<h6>
206<a name="geometry.reference.algorithms.buffer.buffer_4.h4"></a>
207            <span class="phrase"><a name="geometry.reference.algorithms.buffer.buffer_4.behavior"></a></span><a class="link" href="buffer_4.html#geometry.reference.algorithms.buffer.buffer_4.behavior">Behavior</a>
208          </h6>
209<div class="informaltable"><table class="table">
210<colgroup>
211<col>
212<col>
213</colgroup>
214<thead><tr>
215<th>
216                    <p>
217                      Case
218                    </p>
219                  </th>
220<th>
221                    <p>
222                      Behavior
223                    </p>
224                  </th>
225</tr></thead>
226<tbody><tr>
227<td>
228                    <p>
229                      Box/Box
230                    </p>
231                  </td>
232<td>
233                    <p>
234                      Returns a new rectangular box, enlarged with the specified
235                      distance. It is allowed that "geometry_out" the same
236                      object as "geometry_in"
237                    </p>
238                  </td>
239</tr></tbody>
240</table></div>
241</div>
242<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
243<td align="left"></td>
244<td align="right"><div class="copyright-footer">Copyright © 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam
245      Wulkiewicz, Oracle and/or its affiliates<p>
246        Distributed under the Boost Software License, Version 1.0. (See accompanying
247        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>)
248      </p>
249</div></td>
250</tr></table>
251<hr>
252<div class="spirit-nav">
253<a accesskey="p" href="../buffer.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../buffer.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="buffer_7_with_strategies.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
254</div>
255</body>
256</html>
257