]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/geometry/doc/src/examples/algorithms/unique.cpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / geometry / doc / src / examples / algorithms / unique.cpp
CommitLineData
7c673cae
FG
1// Boost.Geometry (aka GGL, Generic Geometry Library)
2// QuickBook Example
3
4// Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands.
5
6// Use, modification and distribution is subject to the Boost Software License,
7// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
8// http://www.boost.org/LICENSE_1_0.txt)
9
10//[unique
11//` Shows how to make a so-called minimal set of a polygon by removing duplicate points
12
13#include <iostream>
14
15#include <boost/geometry.hpp>
16#include <boost/geometry/geometries/polygon.hpp>
17#include <boost/geometry/geometries/adapted/boost_tuple.hpp>
18
19BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian)
20
21int main()
22{
23 boost::geometry::model::polygon<boost::tuple<double, double> > poly;
24 boost::geometry::read_wkt("POLYGON((0 0,0 0,0 5,5 5,5 5,5 5,5 0,5 0,0 0,0 0,0 0,0 0))", poly);
25 boost::geometry::unique(poly);
26 std::cout << boost::geometry::wkt(poly) << std::endl;
27
28 return 0;
29}
30
31//]
32
33
34//[unique_output
35/*`
36Output:
37[pre
38POLYGON((0 0,0 5,5 5,5 0,0 0))
39]
40*/
41//]