• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>assign_values (3 coordinate values)</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_values_3_2_coordinate_values.html" title="assign_values (2 coordinate values)">
10<link rel="next" href="assign_values_5_4_coordinate_values.html" title="assign_values (4 coordinate values)">
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_values_3_2_coordinate_values.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_values_5_4_coordinate_values.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_values_4_3_coordinate_values"></a><a class="link" href="assign_values_4_3_coordinate_values.html" title="assign_values (3 coordinate values)">assign_values
28          (3 coordinate values)</a>
29</h5></div></div></div>
30<p>
31            <a class="indexterm" name="idm45635706925328"></a>
32Assign three values to a geometry (usually a 3D point)
33          </p>
34<h6>
35<a name="geometry.reference.algorithms.assign.assign_values_4_3_coordinate_values.h0"></a>
36            <span class="phrase"><a name="geometry.reference.algorithms.assign.assign_values_4_3_coordinate_values.synopsis"></a></span><a class="link" href="assign_values_4_3_coordinate_values.html#geometry.reference.algorithms.assign.assign_values_4_3_coordinate_values.synopsis">Synopsis</a>
37          </h6>
38<p>
39</p>
40<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">,</span> <span class="keyword">typename</span> <span class="identifier">Type</span><span class="special">&gt;</span>
41<span class="keyword">void</span> <span class="identifier">assign_values</span><span class="special">(</span><span class="identifier">Geometry</span> <span class="special">&amp;</span> <span class="identifier">geometry</span><span class="special">,</span> <span class="identifier">Type</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">c1</span><span class="special">,</span> <span class="identifier">Type</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">c2</span><span class="special">,</span>
42                   <span class="identifier">Type</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">c3</span><span class="special">)</span></pre>
43<p>
44          </p>
45<h6>
46<a name="geometry.reference.algorithms.assign.assign_values_4_3_coordinate_values.h1"></a>
47            <span class="phrase"><a name="geometry.reference.algorithms.assign.assign_values_4_3_coordinate_values.parameters"></a></span><a class="link" href="assign_values_4_3_coordinate_values.html#geometry.reference.algorithms.assign.assign_values_4_3_coordinate_values.parameters">Parameters</a>
48          </h6>
49<div class="informaltable"><table class="table">
50<colgroup>
51<col>
52<col>
53<col>
54<col>
55</colgroup>
56<thead><tr>
57<th>
58                    <p>
59                      Type
60                    </p>
61                  </th>
62<th>
63                    <p>
64                      Concept
65                    </p>
66                  </th>
67<th>
68                    <p>
69                      Name
70                    </p>
71                  </th>
72<th>
73                    <p>
74                      Description
75                    </p>
76                  </th>
77</tr></thead>
78<tbody>
79<tr>
80<td>
81                    <p>
82                      Geometry &amp;
83                    </p>
84                  </td>
85<td>
86                    <p>
87                      Any type fulfilling a Geometry Concept
88                    </p>
89                  </td>
90<td>
91                    <p>
92                      geometry
93                    </p>
94                  </td>
95<td>
96                    <p>
97                      A model of the specified concept
98                    </p>
99                  </td>
100</tr>
101<tr>
102<td>
103                    <p>
104                      Type const &amp;
105                    </p>
106                  </td>
107<td>
108                    <p>
109                      numerical type (int, double, ttmath, ...) to specify the coordinates
110                    </p>
111                  </td>
112<td>
113                    <p>
114                      c1
115                    </p>
116                  </td>
117<td>
118                    <p>
119                      First coordinate (usually x-coordinate)
120                    </p>
121                  </td>
122</tr>
123<tr>
124<td>
125                    <p>
126                      Type const &amp;
127                    </p>
128                  </td>
129<td>
130                    <p>
131                      numerical type (int, double, ttmath, ...) to specify the coordinates
132                    </p>
133                  </td>
134<td>
135                    <p>
136                      c2
137                    </p>
138                  </td>
139<td>
140                    <p>
141                      Second coordinate (usually y-coordinate)
142                    </p>
143                  </td>
144</tr>
145<tr>
146<td>
147                    <p>
148                      Type const &amp;
149                    </p>
150                  </td>
151<td>
152                    <p>
153                      numerical type (int, double, ttmath, ...) to specify the coordinates
154                    </p>
155                  </td>
156<td>
157                    <p>
158                      c3
159                    </p>
160                  </td>
161<td>
162                    <p>
163                      Third coordinate (usually z-coordinate)
164                    </p>
165                  </td>
166</tr>
167</tbody>
168</table></div>
169<h6>
170<a name="geometry.reference.algorithms.assign.assign_values_4_3_coordinate_values.h2"></a>
171            <span class="phrase"><a name="geometry.reference.algorithms.assign.assign_values_4_3_coordinate_values.header"></a></span><a class="link" href="assign_values_4_3_coordinate_values.html#geometry.reference.algorithms.assign.assign_values_4_3_coordinate_values.header">Header</a>
172          </h6>
173<p>
174            Either
175          </p>
176<p>
177            <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>
178          </p>
179<p>
180            Or
181          </p>
182<p>
183            <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">assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
184          </p>
185<h6>
186<a name="geometry.reference.algorithms.assign.assign_values_4_3_coordinate_values.h3"></a>
187            <span class="phrase"><a name="geometry.reference.algorithms.assign.assign_values_4_3_coordinate_values.example"></a></span><a class="link" href="assign_values_4_3_coordinate_values.html#geometry.reference.algorithms.assign.assign_values_4_3_coordinate_values.example">Example</a>
188          </h6>
189<p>
190            Use assign to set three coordinates of a 3D point
191          </p>
192<p>
193</p>
194<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iostream</span><span class="special">&gt;</span>
195<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iomanip</span><span class="special">&gt;</span>
196
197<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>
198<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</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
199
200<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
201<span class="special">{</span>
202    <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">point</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">,</span> <span class="number">3</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">cs</span><span class="special">::</span><span class="identifier">cartesian</span><span class="special">&gt;</span> <span class="identifier">p</span><span class="special">;</span>
203    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">assign_values</span><span class="special">(</span><span class="identifier">p</span><span class="special">,</span> <span class="number">1.2345</span><span class="special">,</span> <span class="number">2.3456</span><span class="special">,</span> <span class="number">3.4567</span><span class="special">);</span>
204
205    <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</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">p</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>
206
207    <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
208<span class="special">}</span>
209</pre>
210<p>
211          </p>
212<p>
213            Output:
214          </p>
215<pre class="programlisting">(1.2345, 2.3456, 3.4567)
216</pre>
217<h6>
218<a name="geometry.reference.algorithms.assign.assign_values_4_3_coordinate_values.h4"></a>
219            <span class="phrase"><a name="geometry.reference.algorithms.assign.assign_values_4_3_coordinate_values.see_also"></a></span><a class="link" href="assign_values_4_3_coordinate_values.html#geometry.reference.algorithms.assign.assign_values_4_3_coordinate_values.see_also">See
220            also</a>
221          </h6>
222<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
223                <a class="link" href="../make/make_3_3_coordinate_values.html" title="make (3 coordinate values)">make</a>
224              </li></ul></div>
225</div>
226<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
227<td align="left"></td>
228<td align="right"><div class="copyright-footer">Copyright © 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam
229      Wulkiewicz, Oracle and/or its affiliates<p>
230        Distributed under the Boost Software License, Version 1.0. (See accompanying
231        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>)
232      </p>
233</div></td>
234</tr></table>
235<hr>
236<div class="spirit-nav">
237<a accesskey="p" href="assign_values_3_2_coordinate_values.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_values_5_4_coordinate_values.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
238</div>
239</body>
240</html>
241