]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/geometry/doc/src/examples/core/point_order.cpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / geometry / doc / src / examples / core / point_order.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//[point_order
11//` Examine the expected point order of a polygon type
12
13#include <iostream>
14
15#include <boost/geometry.hpp>
16#include <boost/geometry/geometries/polygon.hpp>
17#include <boost/geometry/geometries/point_xy.hpp>
18
19int main()
20{
21 typedef boost::geometry::model::d2::point_xy<double> point_type;
22 typedef boost::geometry::model::polygon<point_type, false> polygon_type;
23
24 boost::geometry::order_selector order = boost::geometry::point_order<polygon_type>::value;
25
26 std::cout << "order: " << order << std::endl
27 << "(clockwise = " << boost::geometry::clockwise
28 << ", counterclockwise = " << boost::geometry::counterclockwise
29 << ") "<< std::endl;
30
31 return 0;
32}
33
34//]
35
36
37//[point_order_output
38/*`
39Output:
40[pre
41order: 2
42(clockwise = 1, counterclockwise = 2)
43]
44*/
45//]