• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>make_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="../make.html" title="make">
9<link rel="prev" href="make_3_3_coordinate_values.html" title="make (3 coordinate values)">
10<link rel="next" href="make_zero.html" title="make_zero">
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="make_3_3_coordinate_values.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../make.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="make_zero.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.make.make_inverse"></a><a class="link" href="make_inverse.html" title="make_inverse">make_inverse</a>
28</h5></div></div></div>
29<p>
30            <a class="indexterm" name="idm45635692023584"></a>
31Construct a box with inverse infinite coordinates.
32          </p>
33<h6>
34<a name="geometry.reference.algorithms.make.make_inverse.h0"></a>
35            <span class="phrase"><a name="geometry.reference.algorithms.make.make_inverse.description"></a></span><a class="link" href="make_inverse.html#geometry.reference.algorithms.make.make_inverse.description">Description</a>
36          </h6>
37<p>
38            The make_inverse function initializes a 2D or 3D box with large coordinates,
39            the min corner is very large, the max corner is very small. This is useful
40            e.g. in combination with the expand function, to determine the bounding
41            box of a series of geometries.
42          </p>
43<h6>
44<a name="geometry.reference.algorithms.make.make_inverse.h1"></a>
45            <span class="phrase"><a name="geometry.reference.algorithms.make.make_inverse.synopsis"></a></span><a class="link" href="make_inverse.html#geometry.reference.algorithms.make.make_inverse.synopsis">Synopsis</a>
46          </h6>
47<p>
48</p>
49<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Geometry</span><span class="special">&gt;</span>
50<span class="identifier">Geometry</span> <span class="identifier">make_inverse</span><span class="special">()</span></pre>
51<p>
52          </p>
53<h6>
54<a name="geometry.reference.algorithms.make.make_inverse.h2"></a>
55            <span class="phrase"><a name="geometry.reference.algorithms.make.make_inverse.parameters"></a></span><a class="link" href="make_inverse.html#geometry.reference.algorithms.make.make_inverse.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><tr>
87<td>
88                    <p>
89                      Geometry
90                    </p>
91                  </td>
92<td>
93                    <p>
94                      Any type fulfilling a Geometry Concept
95                    </p>
96                  </td>
97<td>
98                    <p>
99                      -
100                    </p>
101                  </td>
102<td>
103                    <p>
104                      Must be specified
105                    </p>
106                  </td>
107</tr></tbody>
108</table></div>
109<h6>
110<a name="geometry.reference.algorithms.make.make_inverse.h3"></a>
111            <span class="phrase"><a name="geometry.reference.algorithms.make.make_inverse.returns"></a></span><a class="link" href="make_inverse.html#geometry.reference.algorithms.make.make_inverse.returns">Returns</a>
112          </h6>
113<p>
114            The constructed geometry, here: a box
115          </p>
116<h6>
117<a name="geometry.reference.algorithms.make.make_inverse.h4"></a>
118            <span class="phrase"><a name="geometry.reference.algorithms.make.make_inverse.header"></a></span><a class="link" href="make_inverse.html#geometry.reference.algorithms.make.make_inverse.header">Header</a>
119          </h6>
120<p>
121            Either
122          </p>
123<p>
124            <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>
125          </p>
126<p>
127            Or
128          </p>
129<p>
130            <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">make</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
131          </p>
132<h6>
133<a name="geometry.reference.algorithms.make.make_inverse.h5"></a>
134            <span class="phrase"><a name="geometry.reference.algorithms.make.make_inverse.example"></a></span><a class="link" href="make_inverse.html#geometry.reference.algorithms.make.make_inverse.example">Example</a>
135          </h6>
136<p>
137            Usage of make_inverse and expand to conveniently determine bounding box
138            of several objects
139          </p>
140<p>
141</p>
142<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iostream</span><span class="special">&gt;</span>
143
144<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>
145<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">box</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
146<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>
147
148<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>
149
150<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
151<span class="special">{</span>
152
153    <span class="keyword">typedef</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>
154    <span class="keyword">typedef</span> <span class="identifier">model</span><span class="special">::</span><span class="identifier">box</span><span class="special">&lt;</span><span class="identifier">point</span><span class="special">&gt;</span> <span class="identifier">box</span><span class="special">;</span>
155
156    <span class="identifier">box</span> <span class="identifier">all</span> <span class="special">=</span> <span class="identifier">make_inverse</span><span class="special">&lt;</span><span class="identifier">box</span><span class="special">&gt;();</span>
157    <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">dsv</span><span class="special">(</span><span class="identifier">all</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
158    <span class="identifier">expand</span><span class="special">(</span><span class="identifier">all</span><span class="special">,</span> <span class="identifier">make</span><span class="special">&lt;</span><span class="identifier">box</span><span class="special">&gt;(</span><span class="number">0</span><span class="special">,</span> <span class="number">0</span><span class="special">,</span> <span class="number">3</span><span class="special">,</span> <span class="number">4</span><span class="special">));</span>
159    <span class="identifier">expand</span><span class="special">(</span><span class="identifier">all</span><span class="special">,</span> <span class="identifier">make</span><span class="special">&lt;</span><span class="identifier">box</span><span class="special">&gt;(</span><span class="number">2</span><span class="special">,</span> <span class="number">2</span><span class="special">,</span> <span class="number">5</span><span class="special">,</span> <span class="number">6</span><span class="special">));</span>
160    <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">dsv</span><span class="special">(</span><span class="identifier">all</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
161
162    <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
163<span class="special">}</span>
164</pre>
165<p>
166          </p>
167<p>
168            Output:
169          </p>
170<pre class="programlisting">((1.79769e+308, 1.79769e+308), (-1.79769e+308, -1.79769e+308))
171((0, 0), (5, 6))
172</pre>
173<h6>
174<a name="geometry.reference.algorithms.make.make_inverse.h6"></a>
175            <span class="phrase"><a name="geometry.reference.algorithms.make.make_inverse.see_also"></a></span><a class="link" href="make_inverse.html#geometry.reference.algorithms.make.make_inverse.see_also">See
176            also</a>
177          </h6>
178<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
179                <a class="link" href="../assign/assign_inverse.html" title="assign_inverse">assign_inverse</a>
180              </li></ul></div>
181</div>
182<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
183<td align="left"></td>
184<td align="right"><div class="copyright-footer">Copyright © 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam
185      Wulkiewicz, Oracle and/or its affiliates<p>
186        Distributed under the Boost Software License, Version 1.0. (See accompanying
187        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>)
188      </p>
189</div></td>
190</tr></table>
191<hr>
192<div class="spirit-nav">
193<a accesskey="p" href="make_3_3_coordinate_values.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../make.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="make_zero.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
194</div>
195</body>
196</html>
197