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

/Src/Dependencies/Boost/libs/geometry/doc/src/examples/core/point_type.cpp

http://hadesmem.googlecode.com/
C++ | 44 lines | 15 code | 12 blank | 17 comment | 0 complexity | fca0233e3ef234451536d4ca802cc6c3 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//[point_type
11//` Examine the point type of a multi_polygon
12
13#include <iostream>
14#include <typeinfo>
15
16#include <boost/geometry.hpp>
17#include <boost/geometry/geometries/polygon.hpp>
18#include <boost/geometry/geometries/point_xy.hpp>
19#include <boost/geometry/multi/geometries/multi_polygon.hpp>
20
21int main()
22{
23    typedef boost::geometry::model::d2::point_xy<double> point_type;
24    typedef boost::geometry::model::polygon<point_type> polygon_type;
25    typedef boost::geometry::model::multi_polygon<polygon_type> mp_type;
26
27    typedef boost::geometry::point_type<mp_type>::type ptype;
28
29    std::cout << "point type: " << typeid(ptype).name() << std::endl;
30
31    return 0;
32}
33
34//]
35
36
37//[point_type_output
38/*`
39Output (in MSVC):
40[pre
41point type: class boost::geometry::model::d2::point_xy<double,struct boost::geometry::cs::cartesian>
42]
43*/
44//]