]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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 | //[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/geometries/multi_polygon.hpp> | |
20 | ||
21 | int 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 | /*` | |
39 | Output (in MSVC): | |
40 | [pre | |
41 | point type: class boost::geometry::model::d2::point_xy<double,struct boost::geometry::cs::cartesian> | |
42 | ] | |
43 | */ | |
44 | //] |