]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/doc/src/examples/algorithms/expand.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 the usage of expand
16 #include <boost/geometry.hpp>
17 #include <boost/geometry/geometries/box.hpp>
18 #include <boost/geometry/geometries/point_xy.hpp>
22 typedef boost::geometry::model::d2::point_xy
<short int> point_type
;
23 typedef boost::geometry::model::box
<point_type
> box_type
;
25 using boost::geometry::expand
;
27 box_type box
= boost::geometry::make_inverse
<box_type
>(); /*< expand is usually preceded by a call to assign_inverse or make_inverse >*/
29 expand(box
, point_type(0, 0));
30 expand(box
, point_type(1, 2));
31 expand(box
, point_type(5, 4));
32 expand(box
, boost::geometry::make
<box_type
>(3, 3, 5, 5));
34 std::cout
<< boost::geometry::dsv(box
) << std::endl
;