• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>point_order</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="interior_type.html" title="interior_type">
10<link rel="next" href="point_type.html" title="point_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="interior_type.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="point_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.point_order"></a><a class="link" href="point_order.html" title="point_order">point_order</a>
28</h4></div></div></div>
29<p>
30          <a class="indexterm" name="idm45635683724208"></a>
31Metafunction defining <span class="bold"><strong>value</strong></span> as the point
32          order (clockwise, counterclockwise) of the specified geometry type.
33        </p>
34<h6>
35<a name="geometry.reference.core.point_order.h0"></a>
36          <span class="phrase"><a name="geometry.reference.core.point_order.synopsis"></a></span><a class="link" href="point_order.html#geometry.reference.core.point_order.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">&gt;</span>
41<span class="keyword">struct</span> <span class="identifier">point_order</span>
42<span class="special">{</span>
43  <span class="comment">// ...</span>
44<span class="special">};</span>
45</pre>
46<p>
47        </p>
48<h6>
49<a name="geometry.reference.core.point_order.h1"></a>
50          <span class="phrase"><a name="geometry.reference.core.point_order.template_parameter_s_"></a></span><a class="link" href="point_order.html#geometry.reference.core.point_order.template_parameter_s_">Template
51          parameter(s)</a>
52        </h6>
53<div class="informaltable"><table class="table">
54<colgroup>
55<col>
56<col>
57</colgroup>
58<thead><tr>
59<th>
60                  <p>
61                    Parameter
62                  </p>
63                </th>
64<th>
65                  <p>
66                    Description
67                  </p>
68                </th>
69</tr></thead>
70<tbody><tr>
71<td>
72                  <p>
73                    typename Geometry
74                  </p>
75                </td>
76<td>
77                  <p>
78                    Any type fulfilling a Geometry Concept
79                  </p>
80                </td>
81</tr></tbody>
82</table></div>
83<h6>
84<a name="geometry.reference.core.point_order.h2"></a>
85          <span class="phrase"><a name="geometry.reference.core.point_order.header"></a></span><a class="link" href="point_order.html#geometry.reference.core.point_order.header">Header</a>
86        </h6>
87<p>
88          Either
89        </p>
90<p>
91          <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>
92        </p>
93<p>
94          Or
95        </p>
96<p>
97          <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">point_order</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
98        </p>
99<div class="note"><table border="0" summary="Note">
100<tr>
101<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../../doc/src/images/note.png"></td>
102<th align="left">Note</th>
103</tr>
104<tr><td align="left" valign="top"><p>
105            The point order is defined for any geometry type, but only has a real
106            meaning for areal geometry types (ring, polygon, multi_polygon)
107          </p></td></tr>
108</table></div>
109<h6>
110<a name="geometry.reference.core.point_order.h3"></a>
111          <span class="phrase"><a name="geometry.reference.core.point_order.complexity"></a></span><a class="link" href="point_order.html#geometry.reference.core.point_order.complexity">Complexity</a>
112        </h6>
113<p>
114          Compile time
115        </p>
116<h6>
117<a name="geometry.reference.core.point_order.h4"></a>
118          <span class="phrase"><a name="geometry.reference.core.point_order.example"></a></span><a class="link" href="point_order.html#geometry.reference.core.point_order.example">Example</a>
119        </h6>
120<p>
121          Examine the expected point order of a polygon type
122        </p>
123<p>
124</p>
125<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iostream</span><span class="special">&gt;</span>
126
127<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>
128<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>
129<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>
130
131<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
132<span class="special">{</span>
133    <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>
134    <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">,</span> <span class="keyword">false</span><span class="special">&gt;</span> <span class="identifier">polygon_type</span><span class="special">;</span>
135
136    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">order_selector</span> <span class="identifier">order</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">point_order</span><span class="special">&lt;</span><span class="identifier">polygon_type</span><span class="special">&gt;::</span><span class="identifier">value</span><span class="special">;</span>
137
138    <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"order: "</span> <span class="special">&lt;&lt;</span> <span class="identifier">order</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span>
139        <span class="special">&lt;&lt;</span> <span class="string">"(clockwise = "</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">clockwise</span>
140        <span class="special">&lt;&lt;</span> <span class="string">", counterclockwise = "</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">counterclockwise</span>
141        <span class="special">&lt;&lt;</span> <span class="string">") "</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>
142
143    <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
144<span class="special">}</span>
145</pre>
146<p>
147        </p>
148<p>
149          Output:
150        </p>
151<pre class="programlisting">order: 2
152(clockwise = 1, counterclockwise = 2)
153</pre>
154<h6>
155<a name="geometry.reference.core.point_order.h5"></a>
156          <span class="phrase"><a name="geometry.reference.core.point_order.see_also"></a></span><a class="link" href="point_order.html#geometry.reference.core.point_order.see_also">See
157          also</a>
158        </h6>
159<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
160              <a class="link" href="../enumerations/order_selector.html" title="order_selector">The
161              order_selector enumeration</a>
162            </li></ul></div>
163</div>
164<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
165<td align="left"></td>
166<td align="right"><div class="copyright-footer">Copyright © 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam
167      Wulkiewicz, Oracle and/or its affiliates<p>
168        Distributed under the Boost Software License, Version 1.0. (See accompanying
169        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>)
170      </p>
171</div></td>
172</tr></table>
173<hr>
174<div class="spirit-nav">
175<a accesskey="p" href="interior_type.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="point_type.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
176</div>
177</body>
178</html>
179