]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/doc/src/examples/geometries/register/multi_point_templated.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / geometry / doc / src / examples / geometries / register / multi_point_templated.cpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2 // QuickBook Example
3
4 // Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands.
5
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)
9
10 //[register_multi_point_templated
11 //` Show the use of the macro BOOST_GEOMETRY_REGISTER_MULTI_POINT_TEMPLATED
12
13 #include <iostream>
14 #include <boost/geometry.hpp>
15 #include <boost/geometry/geometries/adapted/boost_tuple.hpp>
16 #include <boost/geometry/geometries/register/multi_point.hpp>
17
18
19 BOOST_GEOMETRY_REGISTER_MULTI_POINT_TEMPLATED(std::deque)
20
21 BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian)
22
23 int main()
24 {
25 // Normal usage of std::
26 std::deque<boost::tuple<float, float> > multi_point;
27 multi_point.push_back(boost::tuple<float, float>(1, 1));
28 multi_point.push_back(boost::tuple<float, float>(3, 2));
29
30 // Usage of Boost.Geometry
31 std::cout << "WKT: " << boost::geometry::wkt(multi_point) << std::endl;
32
33 return 0;
34 }
35
36 //]
37
38
39 //[register_multi_point_templated_output
40 /*`
41 Output:
42 [pre
43 WKT: MULTIPOINT((1 1),(3 2))
44 ]
45 */
46 //]