PageRenderTime 21ms CodeModel.GetById 17ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/libs/geometry/doc/src/examples/geometries/register/multi_point.cpp

http://hadesmem.googlecode.com/
C++ | 46 lines | 15 code | 12 blank | 19 comment | 0 complexity | deabd12f78f20c383fb980d37380c20a MD5 | raw file
 1// Boost.Geometry (aka GGL, Generic Geometry Library)
 2// QuickBook Example
 3
 4// Copyright (c) 2011 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/multi/geometries/register/multi_point.hpp>
17
18typedef boost::tuple<float, float> point_type;
19
20BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian)
21BOOST_GEOMETRY_REGISTER_MULTI_POINT(std::deque< ::point_type >)
22
23int 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/*`
41Output:
42[pre
43WKT: MULTIPOINT((1 1),(3 2))
44]
45*/
46//]