• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>Boost.Range reversed</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="../boost_range.html" title="Boost.Range">
9<link rel="prev" href="filtered.html" title="Boost.Range filtered">
10<link rel="next" href="sliced.html" title="Boost.Range sliced">
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="filtered.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost_range.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="sliced.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.adapted.boost_range.reversed"></a><a class="link" href="reversed.html" title="Boost.Range reversed">Boost.Range
28          reversed</a>
29</h5></div></div></div>
30<p>
31            Boost.Range reversed range adaptor is adapted to Boost.Geometry
32          </p>
33<h6>
34<a name="geometry.reference.adapted.boost_range.reversed.h0"></a>
35            <span class="phrase"><a name="geometry.reference.adapted.boost_range.reversed.description"></a></span><a class="link" href="reversed.html#geometry.reference.adapted.boost_range.reversed.description">Description</a>
36          </h6>
37<p>
38            Boost.Range reversed range adaptor reverses a range.
39          </p>
40<h6>
41<a name="geometry.reference.adapted.boost_range.reversed.h1"></a>
42            <span class="phrase"><a name="geometry.reference.adapted.boost_range.reversed.model_of"></a></span><a class="link" href="reversed.html#geometry.reference.adapted.boost_range.reversed.model_of">Model
43            of</a>
44          </h6>
45<p>
46            The Boost.Range reversed range adaptor takes over the model of the original
47            geometry, which might be:
48          </p>
49<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
50<li class="listitem">
51                a linestring
52              </li>
53<li class="listitem">
54                a ring
55              </li>
56<li class="listitem">
57                a multi_point
58              </li>
59<li class="listitem">
60                a multi_linestring
61              </li>
62<li class="listitem">
63                a multi_polygon
64              </li>
65</ul></div>
66<h6>
67<a name="geometry.reference.adapted.boost_range.reversed.h2"></a>
68            <span class="phrase"><a name="geometry.reference.adapted.boost_range.reversed.header"></a></span><a class="link" href="reversed.html#geometry.reference.adapted.boost_range.reversed.header">Header</a>
69          </h6>
70<p>
71            <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">geometries</span><span class="special">/</span><span class="identifier">adapted</span><span class="special">/</span><span class="identifier">boost_range</span><span class="special">/</span><span class="identifier">reversed</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
72          </p>
73<p>
74            The standard header <code class="computeroutput"><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">.</span><span class="identifier">hpp</span></code>
75            does not include this header.
76          </p>
77<h6>
78<a name="geometry.reference.adapted.boost_range.reversed.h3"></a>
79            <span class="phrase"><a name="geometry.reference.adapted.boost_range.reversed.example"></a></span><a class="link" href="reversed.html#geometry.reference.adapted.boost_range.reversed.example">Example</a>
80          </h6>
81<p>
82            Shows how to use a Boost.Geometry linestring, reversed by Boost.Range
83            adaptor
84          </p>
85<p>
86</p>
87<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iostream</span><span class="special">&gt;</span>
88
89<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>
90<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">linestring</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
91<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>
92<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">adapted</span><span class="special">/</span><span class="identifier">boost_range</span><span class="special">/</span><span class="identifier">reversed</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
93
94<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
95<span class="special">{</span>
96    <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">int</span><span class="special">&gt;</span> <span class="identifier">xy</span><span class="special">;</span>
97    <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">linestring</span><span class="special">&lt;</span><span class="identifier">xy</span><span class="special">&gt;</span> <span class="identifier">line</span><span class="special">;</span>
98    <span class="identifier">line</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">xy</span><span class="special">(</span><span class="number">0</span><span class="special">,</span> <span class="number">0</span><span class="special">));</span>
99    <span class="identifier">line</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">xy</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">1</span><span class="special">));</span>
100
101    <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span>
102        <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">line</span> <span class="special">|</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">adaptors</span><span class="special">::</span><span class="identifier">reversed</span><span class="special">)</span>
103        <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
104
105    <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
106<span class="special">}</span>
107</pre>
108<p>
109          </p>
110<p>
111            Output:
112          </p>
113<pre class="programlisting">((1, 1), (0, 0))
114</pre>
115</div>
116<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
117<td align="left"></td>
118<td align="right"><div class="copyright-footer">Copyright © 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam
119      Wulkiewicz, Oracle and/or its affiliates<p>
120        Distributed under the Boost Software License, Version 1.0. (See accompanying
121        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>)
122      </p>
123</div></td>
124</tr></table>
125<hr>
126<div class="spirit-nav">
127<a accesskey="p" href="filtered.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost_range.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="sliced.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
128</div>
129</body>
130</html>
131