1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>expand (with strategy)</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="../expand.html" title="expand"> 9<link rel="prev" href="../expand.html" title="expand"> 10<link rel="next" href="expand_2.html" title="expand"> 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="../expand.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../expand.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="expand_2.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.expand.expand_3_with_strategy"></a><a class="link" href="expand_3_with_strategy.html" title="expand (with strategy)">expand 28 (with strategy)</a> 29</h5></div></div></div> 30<p> 31 <a class="indexterm" name="idm45635696823392"></a> 32Expands (with strategy) 33 </p> 34<h6> 35<a name="geometry.reference.algorithms.expand.expand_3_with_strategy.h0"></a> 36 <span class="phrase"><a name="geometry.reference.algorithms.expand.expand_3_with_strategy.synopsis"></a></span><a class="link" href="expand_3_with_strategy.html#geometry.reference.algorithms.expand.expand_3_with_strategy.synopsis">Synopsis</a> 37 </h6> 38<p> 39</p> 40<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Box</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Geometry</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Strategy</span><span class="special">></span> 41<span class="keyword">void</span> <span class="identifier">expand</span><span class="special">(</span><span class="identifier">Box</span> <span class="special">&</span> <span class="identifier">box</span><span class="special">,</span> <span class="identifier">Geometry</span> <span class="keyword">const</span> <span class="special">&</span> <span class="identifier">geometry</span><span class="special">,</span> <span class="identifier">Strategy</span> <span class="keyword">const</span> <span class="special">&</span> <span class="identifier">strategy</span><span class="special">)</span></pre> 42<p> 43 </p> 44<h6> 45<a name="geometry.reference.algorithms.expand.expand_3_with_strategy.h1"></a> 46 <span class="phrase"><a name="geometry.reference.algorithms.expand.expand_3_with_strategy.parameters"></a></span><a class="link" href="expand_3_with_strategy.html#geometry.reference.algorithms.expand.expand_3_with_strategy.parameters">Parameters</a> 47 </h6> 48<div class="informaltable"><table class="table"> 49<colgroup> 50<col> 51<col> 52<col> 53<col> 54</colgroup> 55<thead><tr> 56<th> 57 <p> 58 Type 59 </p> 60 </th> 61<th> 62 <p> 63 Concept 64 </p> 65 </th> 66<th> 67 <p> 68 Name 69 </p> 70 </th> 71<th> 72 <p> 73 Description 74 </p> 75 </th> 76</tr></thead> 77<tbody> 78<tr> 79<td> 80 <p> 81 Box & 82 </p> 83 </td> 84<td> 85 <p> 86 type of the box 87 </p> 88 </td> 89<td> 90 <p> 91 box 92 </p> 93 </td> 94<td> 95 <p> 96 box to be expanded using another geometry, mutable 97 </p> 98 </td> 99</tr> 100<tr> 101<td> 102 <p> 103 Geometry const & 104 </p> 105 </td> 106<td> 107 <p> 108 Any type fulfilling a Geometry Concept 109 </p> 110 </td> 111<td> 112 <p> 113 geometry 114 </p> 115 </td> 116<td> 117 <p> 118 A model of the specified concept geometry which envelope (bounding 119 box) 120 </p> 121 </td> 122</tr> 123<tr> 124<td> 125 <p> 126 Strategy const & 127 </p> 128 </td> 129<td> 130 <p> 131 Any type fulfilling a expand Strategy Concept 132 </p> 133 </td> 134<td> 135 <p> 136 strategy 137 </p> 138 </td> 139<td> 140 <p> 141 The strategy which will be used for expand calculations will 142 be added to the box 143 </p> 144 </td> 145</tr> 146</tbody> 147</table></div> 148<h6> 149<a name="geometry.reference.algorithms.expand.expand_3_with_strategy.h2"></a> 150 <span class="phrase"><a name="geometry.reference.algorithms.expand.expand_3_with_strategy.header"></a></span><a class="link" href="expand_3_with_strategy.html#geometry.reference.algorithms.expand.expand_3_with_strategy.header">Header</a> 151 </h6> 152<p> 153 Either 154 </p> 155<p> 156 <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">hpp</span><span class="special">></span></code> 157 </p> 158<p> 159 Or 160 </p> 161<p> 162 <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">algorithms</span><span class="special">/</span><span class="identifier">expand</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code> 163 </p> 164<h6> 165<a name="geometry.reference.algorithms.expand.expand_3_with_strategy.h3"></a> 166 <span class="phrase"><a name="geometry.reference.algorithms.expand.expand_3_with_strategy.conformance"></a></span><a class="link" href="expand_3_with_strategy.html#geometry.reference.algorithms.expand.expand_3_with_strategy.conformance">Conformance</a> 167 </h6> 168<p> 169 The function expand is not defined by OGC. 170 </p> 171<h6> 172<a name="geometry.reference.algorithms.expand.expand_3_with_strategy.h4"></a> 173 <span class="phrase"><a name="geometry.reference.algorithms.expand.expand_3_with_strategy.behavior"></a></span><a class="link" href="expand_3_with_strategy.html#geometry.reference.algorithms.expand.expand_3_with_strategy.behavior">Behavior</a> 174 </h6> 175<div class="informaltable"><table class="table"> 176<colgroup> 177<col> 178<col> 179</colgroup> 180<thead><tr> 181<th> 182 <p> 183 Case 184 </p> 185 </th> 186<th> 187 <p> 188 Behavior 189 </p> 190 </th> 191</tr></thead> 192<tbody> 193<tr> 194<td> 195 <p> 196 Box / Point 197 </p> 198 </td> 199<td> 200 <p> 201 Box is expanded to include the specified Point 202 </p> 203 </td> 204</tr> 205<tr> 206<td> 207 <p> 208 Box / Box 209 </p> 210 </td> 211<td> 212 <p> 213 Box is expanded to include the specified Box 214 </p> 215 </td> 216</tr> 217<tr> 218<td> 219 <p> 220 Box / Other geometries 221 </p> 222 </td> 223<td> 224 <p> 225 Not yet supported in this version 226 </p> 227 </td> 228</tr> 229</tbody> 230</table></div> 231<div class="note"><table border="0" summary="Note"> 232<tr> 233<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../../../doc/src/images/note.png"></td> 234<th align="left">Note</th> 235</tr> 236<tr><td align="left" valign="top"><p> 237 To use expand with another geometry type then specified, use expand(make_envelope<box_type>(geometry) 238 </p></td></tr> 239</table></div> 240<h6> 241<a name="geometry.reference.algorithms.expand.expand_3_with_strategy.h5"></a> 242 <span class="phrase"><a name="geometry.reference.algorithms.expand.expand_3_with_strategy.complexity"></a></span><a class="link" href="expand_3_with_strategy.html#geometry.reference.algorithms.expand.expand_3_with_strategy.complexity">Complexity</a> 243 </h6> 244<p> 245 Linear 246 </p> 247<h6> 248<a name="geometry.reference.algorithms.expand.expand_3_with_strategy.h6"></a> 249 <span class="phrase"><a name="geometry.reference.algorithms.expand.expand_3_with_strategy.example"></a></span><a class="link" href="expand_3_with_strategy.html#geometry.reference.algorithms.expand.expand_3_with_strategy.example">Example</a> 250 </h6> 251<p> 252 Shows the usage of expand 253 </p> 254<p> 255</p> 256<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span> 257<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">list</span><span class="special">></span> 258 259<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> 260<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">box</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 261<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> 262 263<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> 264<span class="special">{</span> 265 <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">short</span> <span class="keyword">int</span><span class="special">></span> <span class="identifier">point_type</span><span class="special">;</span> 266 <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">box</span><span class="special"><</span><span class="identifier">point_type</span><span class="special">></span> <span class="identifier">box_type</span><span class="special">;</span> 267 268 <span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">expand</span><span class="special">;</span> 269 270 <span class="identifier">box_type</span> <span class="identifier">box</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">make_inverse</span><span class="special"><</span><span class="identifier">box_type</span><span class="special">>();</span> <a class="co" name="geometry.reference.algorithms.expand.expand_3_with_strategy.c0" href="expand_3_with_strategy.html#geometry.reference.algorithms.expand.expand_3_with_strategy.c1"><img src="../../../../../../../../doc/src/images/callouts/1.png" alt="1" border="0"></a> 271 272 <span class="identifier">expand</span><span class="special">(</span><span class="identifier">box</span><span class="special">,</span> <span class="identifier">point_type</span><span class="special">(</span><span class="number">0</span><span class="special">,</span> <span class="number">0</span><span class="special">));</span> 273 <span class="identifier">expand</span><span class="special">(</span><span class="identifier">box</span><span class="special">,</span> <span class="identifier">point_type</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">2</span><span class="special">));</span> 274 <span class="identifier">expand</span><span class="special">(</span><span class="identifier">box</span><span class="special">,</span> <span class="identifier">point_type</span><span class="special">(</span><span class="number">5</span><span class="special">,</span> <span class="number">4</span><span class="special">));</span> 275 <span class="identifier">expand</span><span class="special">(</span><span class="identifier">box</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">make</span><span class="special"><</span><span class="identifier">box_type</span><span class="special">>(</span><span class="number">3</span><span class="special">,</span> <span class="number">3</span><span class="special">,</span> <span class="number">5</span><span class="special">,</span> <span class="number">5</span><span class="special">));</span> 276 277 <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</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">dsv</span><span class="special">(</span><span class="identifier">box</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> 278 279 <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span> 280<span class="special">}</span> 281</pre> 282<p> 283 </p> 284<div class="calloutlist"><table border="0" summary="Callout list"><tr> 285<td width="5%" valign="top" align="left"><p><a name="geometry.reference.algorithms.expand.expand_3_with_strategy.c1"></a><a href="#geometry.reference.algorithms.expand.expand_3_with_strategy.c0"><img src="../../../../../../../../doc/src/images/callouts/1.png" alt="1" border="0"></a> </p></td> 286<td valign="top" align="left"><p> 287 expand is usually preceded by a call to assign_inverse or make_inverse 288 </p></td> 289</tr></table></div> 290<p> 291 Output: 292 </p> 293<pre class="programlisting">((0, 0), (5, 5)) 294</pre> 295</div> 296<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 297<td align="left"></td> 298<td align="right"><div class="copyright-footer">Copyright © 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam 299 Wulkiewicz, Oracle and/or its affiliates<p> 300 Distributed under the Boost Software License, Version 1.0. (See accompanying 301 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>) 302 </p> 303</div></td> 304</tr></table> 305<hr> 306<div class="spirit-nav"> 307<a accesskey="p" href="../expand.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../expand.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="expand_2.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 308</div> 309</body> 310</html> 311