]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/doc/src/examples/geometries/register/multi_point.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)
10 //[register_multi_point
11 //` Show the use of the macro BOOST_GEOMETRY_REGISTER_MULTI_POINT
14 #include <boost/geometry.hpp>
15 #include <boost/geometry/geometries/adapted/boost_tuple.hpp>
16 #include <boost/geometry/geometries/register/multi_point.hpp>
18 typedef boost::tuple
<float, float> point_type
;
20 BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian
)
21 BOOST_GEOMETRY_REGISTER_MULTI_POINT(std::deque
< ::point_type
>)
25 // Normal usage of std::
26 std::deque
<point_type
> multi_point
;
27 multi_point
.push_back(point_type(1, 1));
28 multi_point
.push_back(point_type(3, 2));
30 // Usage of Boost.Geometry
31 std::cout
<< "WKT: " << boost::geometry::wkt(multi_point
) << std::endl
;
39 //[register_multi_point_output
43 WKT: MULTIPOINT((1 1),(3 2))