]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/doc/src/examples/geometries/register/multi_point.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / geometry / doc / src / examples / geometries / register / multi_point.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
11 //` Show the use of the macro BOOST_GEOMETRY_REGISTER_MULTI_POINT
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 typedef boost::tuple<float, float> point_type;
19
20 BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian)
21 BOOST_GEOMETRY_REGISTER_MULTI_POINT(std::deque< ::point_type >)
22
23 int main()
24 {
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));
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_output
40 /*`
41 Output:
42 [pre
43 WKT: MULTIPOINT((1 1),(3 2))
44 ]
45 */
46 //]