]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/doc/src/examples/algorithms/assign_box_corners.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 four point can be assigned from a 2D box
15 #include <boost/geometry.hpp>
16 #include <boost/geometry/geometries/box.hpp>
17 #include <boost/geometry/geometries/point_xy.hpp>
19 using namespace boost::geometry
;
23 typedef model::d2::point_xy
<double> point
;
24 typedef model::box
<point
> box
;
27 assign_values(b
, 2, 2, 5, 5);
30 assign_box_corners(b
, ll
, lr
, ul
, ur
);
32 std::cout
<< "box: " << dsv(b
) << std::endl
<< std::endl
;
34 std::cout
<< dsv(ul
) << " --- " << dsv(ur
) << std::endl
;
35 for (int i
= 0; i
< 3; i
++)
37 std::cout
<< " | |" << std::endl
;
39 std::cout
<< dsv(ll
) << " --- " << dsv(lr
) << std::endl
;
47 //[assign_box_corners_output