1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>assign_inverse</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="../assign.html" title="assign"> 9<link rel="prev" href="assign.html" title="assign"> 10<link rel="next" href="assign_points.html" title="assign_points"> 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="assign.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../assign.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="assign_points.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.assign.assign_inverse"></a><a class="link" href="assign_inverse.html" title="assign_inverse">assign_inverse</a> 28</h5></div></div></div> 29<p> 30 <a class="indexterm" name="idm45635707502368"></a> 31assign to a box inverse infinite 32 </p> 33<h6> 34<a name="geometry.reference.algorithms.assign.assign_inverse.h0"></a> 35 <span class="phrase"><a name="geometry.reference.algorithms.assign.assign_inverse.description"></a></span><a class="link" href="assign_inverse.html#geometry.reference.algorithms.assign.assign_inverse.description">Description</a> 36 </h6> 37<p> 38 The assign_inverse function initialize a 2D or 3D box with large coordinates, 39 the min corner is very large, the max corner is very small. This is a 40 convenient starting point to collect the minimum bounding box of a geometry. 41 </p> 42<h6> 43<a name="geometry.reference.algorithms.assign.assign_inverse.h1"></a> 44 <span class="phrase"><a name="geometry.reference.algorithms.assign.assign_inverse.synopsis"></a></span><a class="link" href="assign_inverse.html#geometry.reference.algorithms.assign.assign_inverse.synopsis">Synopsis</a> 45 </h6> 46<p> 47</p> 48<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Geometry</span><span class="special">></span> 49<span class="keyword">void</span> <span class="identifier">assign_inverse</span><span class="special">(</span><span class="identifier">Geometry</span> <span class="special">&</span> <span class="identifier">geometry</span><span class="special">)</span></pre> 50<p> 51 </p> 52<h6> 53<a name="geometry.reference.algorithms.assign.assign_inverse.h2"></a> 54 <span class="phrase"><a name="geometry.reference.algorithms.assign.assign_inverse.parameters"></a></span><a class="link" href="assign_inverse.html#geometry.reference.algorithms.assign.assign_inverse.parameters">Parameters</a> 55 </h6> 56<div class="informaltable"><table class="table"> 57<colgroup> 58<col> 59<col> 60<col> 61<col> 62</colgroup> 63<thead><tr> 64<th> 65 <p> 66 Type 67 </p> 68 </th> 69<th> 70 <p> 71 Concept 72 </p> 73 </th> 74<th> 75 <p> 76 Name 77 </p> 78 </th> 79<th> 80 <p> 81 Description 82 </p> 83 </th> 84</tr></thead> 85<tbody><tr> 86<td> 87 <p> 88 Geometry & 89 </p> 90 </td> 91<td> 92 <p> 93 Any type fulfilling a Geometry Concept 94 </p> 95 </td> 96<td> 97 <p> 98 geometry 99 </p> 100 </td> 101<td> 102 <p> 103 A model of the specified concept 104 </p> 105 </td> 106</tr></tbody> 107</table></div> 108<h6> 109<a name="geometry.reference.algorithms.assign.assign_inverse.h3"></a> 110 <span class="phrase"><a name="geometry.reference.algorithms.assign.assign_inverse.header"></a></span><a class="link" href="assign_inverse.html#geometry.reference.algorithms.assign.assign_inverse.header">Header</a> 111 </h6> 112<p> 113 Either 114 </p> 115<p> 116 <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> 117 </p> 118<p> 119 Or 120 </p> 121<p> 122 <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">assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code> 123 </p> 124<h6> 125<a name="geometry.reference.algorithms.assign.assign_inverse.h4"></a> 126 <span class="phrase"><a name="geometry.reference.algorithms.assign.assign_inverse.example"></a></span><a class="link" href="assign_inverse.html#geometry.reference.algorithms.assign.assign_inverse.example">Example</a> 127 </h6> 128<p> 129 Usage of assign_inverse and expand to conveniently determine bounding 130 3D box of two points 131 </p> 132<p> 133</p> 134<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span> 135 136<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> 137<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> 138<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</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 139 140<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">;</span> 141 142<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> 143<span class="special">{</span> 144 <span class="keyword">typedef</span> <span class="identifier">model</span><span class="special">::</span><span class="identifier">point</span><span class="special"><</span><span class="keyword">float</span><span class="special">,</span> <span class="number">3</span><span class="special">,</span> <span class="identifier">cs</span><span class="special">::</span><span class="identifier">cartesian</span><span class="special">></span> <span class="identifier">point</span><span class="special">;</span> 145 <span class="keyword">typedef</span> <span class="identifier">model</span><span class="special">::</span><span class="identifier">box</span><span class="special"><</span><span class="identifier">point</span><span class="special">></span> <span class="identifier">box</span><span class="special">;</span> 146 147 <span class="identifier">box</span> <span class="identifier">all</span><span class="special">;</span> 148 <span class="identifier">assign_inverse</span><span class="special">(</span><span class="identifier">all</span><span class="special">);</span> 149 <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">dsv</span><span class="special">(</span><span class="identifier">all</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> 150 <span class="identifier">expand</span><span class="special">(</span><span class="identifier">all</span><span class="special">,</span> <span class="identifier">point</span><span class="special">(</span><span class="number">0</span><span class="special">,</span> <span class="number">0</span><span class="special">,</span> <span class="number">0</span><span class="special">));</span> 151 <span class="identifier">expand</span><span class="special">(</span><span class="identifier">all</span><span class="special">,</span> <span class="identifier">point</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">2</span><span class="special">,</span> <span class="number">3</span><span class="special">));</span> 152 <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">dsv</span><span class="special">(</span><span class="identifier">all</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> 153 154 <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span> 155<span class="special">}</span> 156</pre> 157<p> 158 </p> 159<p> 160 Output: 161 </p> 162<pre class="programlisting">((3.40282e+038, 3.40282e+038, 3.40282e+038), (-3.40282e+038, -3.40282e+038, -3.40282e+038)) 163((0, 0, 0), (1, 2, 3))</pre> 164<h6> 165<a name="geometry.reference.algorithms.assign.assign_inverse.h5"></a> 166 <span class="phrase"><a name="geometry.reference.algorithms.assign.assign_inverse.see_also"></a></span><a class="link" href="assign_inverse.html#geometry.reference.algorithms.assign.assign_inverse.see_also">See 167 also</a> 168 </h6> 169<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> 170 <a class="link" href="../make/make_inverse.html" title="make_inverse">make_inverse</a> 171 </li></ul></div> 172</div> 173<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 174<td align="left"></td> 175<td align="right"><div class="copyright-footer">Copyright © 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam 176 Wulkiewicz, Oracle and/or its affiliates<p> 177 Distributed under the Boost Software License, Version 1.0. (See accompanying 178 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>) 179 </p> 180</div></td> 181</tr></table> 182<hr> 183<div class="spirit-nav"> 184<a accesskey="p" href="assign.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../assign.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="assign_points.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 185</div> 186</body> 187</html> 188