]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/doc/src/examples/algorithms/return_envelope.cpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
4 // Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands.
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)
11 //` Shows how to return the envelope of a ring
16 #include <boost/geometry.hpp>
17 #include <boost/geometry/geometries/box.hpp>
18 #include <boost/geometry/geometries/point_xy.hpp>
19 #include <boost/geometry/geometries/ring.hpp>
21 #include <boost/assign.hpp>
23 /*<-*/ #include "create_svg_two.hpp" /*->*/
27 using namespace boost::assign
;
29 typedef boost::geometry::model::d2::point_xy
<double> point
;
31 boost::geometry::model::ring
<point
> ring
;
33 point(4.0, -0.5), point(3.5, 1.0),
34 point(2.0, 1.5), point(3.5, 2.0),
35 point(4.0, 3.5), point(4.5, 2.0),
36 point(6.0, 1.5), point(4.5, 1.0),
39 typedef boost::geometry::model::box
<point
> box
;
43 << boost::geometry::dsv(boost::geometry::return_envelope
<box
>(ring
))
46 /*<-*/ create_svg("return_envelope.svg", ring
, boost::geometry::return_envelope
<box
>(ring
)); /*->*/
53 //[return_envelope_output
57 return_envelope:((2, -0.5), (6, 3.5))
59 [$img/algorithms/return_envelope.png]