]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/doc/src/examples/geometries/adapted/boost_polygon_box.cpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
4 // Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands.
5 // Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
7 // Use, modification and distribution is subject to the Boost Software License,
8 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
12 //`Shows how to use Boost.Polygon rectangle_data within Boost.Geometry
15 #include <boost/geometry.hpp>
16 #include <boost/geometry/geometries/adapted/boost_polygon.hpp>
20 typedef boost::polygon::rectangle_data
<int> rect
;
22 rect b
= boost::polygon::construct
<rect
>(1, 2, 3, 4);
24 std::cout
<< "Area (using Boost.Geometry): "
25 << boost::geometry::area(b
) << std::endl
;
26 std::cout
<< "Area (using Boost.Polygon): "
27 << boost::polygon::area(b
) << std::endl
;
34 //[boost_polygon_box_output
38 Area (using Boost.Geometry): 4
39 Area (using Boost.Polygon): 4