]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/doc/src/examples/geometries/register/multi_linestring.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_linestring
11 //` Show the use of the macro BOOST_GEOMETRY_REGISTER_MULTI_LINESTRING
15 #include <boost/geometry.hpp>
16 #include <boost/geometry/geometries/linestring.hpp>
17 #include <boost/geometry/geometries/adapted/boost_tuple.hpp>
18 #include <boost/geometry/geometries/register/multi_linestring.hpp>
20 typedef boost::geometry::model::linestring
22 boost::tuple
<float, float>
25 BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian
)
26 BOOST_GEOMETRY_REGISTER_MULTI_LINESTRING(std::deque
<linestring_type
>)
30 // Normal usage of std::
31 std::deque
<linestring_type
> lines(2);
32 boost::geometry::read_wkt("LINESTRING(0 0,1 1)", lines
[0]);
33 boost::geometry::read_wkt("LINESTRING(2 2,3 3)", lines
[1]);
35 // Usage of Boost.Geometry
36 std::cout
<< "LENGTH: " << boost::geometry::length(lines
) << std::endl
;
44 //[register_multi_linestring_output