• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>coordinate_system</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="../core.html" title="Core Metafunctions">
9<link rel="prev" href="closure.html" title="closure">
10<link rel="next" href="coordinate_type.html" title="coordinate_type">
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="closure.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../core.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="coordinate_type.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="section">
26<div class="titlepage"><div><div><h4 class="title">
27<a name="geometry.reference.core.coordinate_system"></a><a class="link" href="coordinate_system.html" title="coordinate_system">coordinate_system</a>
28</h4></div></div></div>
29<p>
30          <a class="indexterm" name="idm45635684334576"></a>
31Metafunction defining <span class="bold"><strong>type</strong></span> as the coordinate
32          system (cartesian, spherical, etc) of the point type making up the specified
33          geometry type.
34        </p>
35<h6>
36<a name="geometry.reference.core.coordinate_system.h0"></a>
37          <span class="phrase"><a name="geometry.reference.core.coordinate_system.synopsis"></a></span><a class="link" href="coordinate_system.html#geometry.reference.core.coordinate_system.synopsis">Synopsis</a>
38        </h6>
39<p>
40</p>
41<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>
42<span class="keyword">struct</span> <span class="identifier">coordinate_system</span>
43<span class="special">{</span>
44  <span class="comment">// ...</span>
45<span class="special">};</span>
46</pre>
47<p>
48        </p>
49<h6>
50<a name="geometry.reference.core.coordinate_system.h1"></a>
51          <span class="phrase"><a name="geometry.reference.core.coordinate_system.template_parameter_s_"></a></span><a class="link" href="coordinate_system.html#geometry.reference.core.coordinate_system.template_parameter_s_">Template
52          parameter(s)</a>
53        </h6>
54<div class="informaltable"><table class="table">
55<colgroup>
56<col>
57<col>
58</colgroup>
59<thead><tr>
60<th>
61                  <p>
62                    Parameter
63                  </p>
64                </th>
65<th>
66                  <p>
67                    Description
68                  </p>
69                </th>
70</tr></thead>
71<tbody><tr>
72<td>
73                  <p>
74                    typename Geometry
75                  </p>
76                </td>
77<td>
78                  <p>
79                    Any type fulfilling a Geometry Concept
80                  </p>
81                </td>
82</tr></tbody>
83</table></div>
84<h6>
85<a name="geometry.reference.core.coordinate_system.h2"></a>
86          <span class="phrase"><a name="geometry.reference.core.coordinate_system.header"></a></span><a class="link" href="coordinate_system.html#geometry.reference.core.coordinate_system.header">Header</a>
87        </h6>
88<p>
89          Either
90        </p>
91<p>
92          <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>
93        </p>
94<p>
95          Or
96        </p>
97<p>
98          <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">core</span><span class="special">/</span><span class="identifier">coordinate_system</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
99        </p>
100<h6>
101<a name="geometry.reference.core.coordinate_system.h3"></a>
102          <span class="phrase"><a name="geometry.reference.core.coordinate_system.complexity"></a></span><a class="link" href="coordinate_system.html#geometry.reference.core.coordinate_system.complexity">Complexity</a>
103        </h6>
104<p>
105          Compile time
106        </p>
107<h6>
108<a name="geometry.reference.core.coordinate_system.h4"></a>
109          <span class="phrase"><a name="geometry.reference.core.coordinate_system.example"></a></span><a class="link" href="coordinate_system.html#geometry.reference.core.coordinate_system.example">Example</a>
110        </h6>
111<p>
112          Examine the coordinate system of a point
113        </p>
114<p>
115</p>
116<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iostream</span><span class="special">&gt;</span>
117<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">typeinfo</span><span class="special">&gt;</span>
118
119<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>
120<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">polygon</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
121<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>
122
123<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
124<span class="special">{</span>
125    <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">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="identifier">point_type</span><span class="special">;</span>
126    <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">polygon</span><span class="special">&lt;</span><span class="identifier">point_type</span><span class="special">&gt;</span> <span class="identifier">polygon_type</span><span class="special">;</span>
127
128    <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">coordinate_system</span><span class="special">&lt;</span><span class="identifier">polygon_type</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">system</span><span class="special">;</span>
129
130    <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"system: "</span> <span class="special">&lt;&lt;</span> <span class="keyword">typeid</span><span class="special">(</span><span class="identifier">system</span><span class="special">).</span><span class="identifier">name</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>
131
132    <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
133<span class="special">}</span>
134</pre>
135<p>
136        </p>
137<p>
138          Output (using MSVC):
139        </p>
140<pre class="programlisting">system: struct boost::geometry::cs::cartesian
141</pre>
142</div>
143<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
144<td align="left"></td>
145<td align="right"><div class="copyright-footer">Copyright © 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam
146      Wulkiewicz, Oracle and/or its affiliates<p>
147        Distributed under the Boost Software License, Version 1.0. (See accompanying
148        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>)
149      </p>
150</div></td>
151</tr></table>
152<hr>
153<div class="spirit-nav">
154<a accesskey="p" href="closure.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../core.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="coordinate_type.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
155</div>
156</body>
157</html>
158