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

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

http://hadesmem.googlecode.com/
C++ | 49 lines | 18 code | 11 blank | 20 comment | 0 complexity | 5b3e6f2873d106deccd4ab45e8daee2c 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//[interior_type
11//`Shows how to use the interior_type metafunction
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/ring.hpp>
19#include <boost/geometry/geometries/adapted/boost_array.hpp>
20
21BOOST_GEOMETRY_REGISTER_BOOST_ARRAY_CS(cs::cartesian)
22
23int main()
24{
25    // Define a polygon storing points in a deque and storing interior rings
26    // in a list (note that std::list is not supported by most algorithms 
27    // because not supporting a random access iterator)
28    typedef boost::geometry::model::polygon
29        <
30            boost::array<short, 3>, 
31            true, true,
32            std::deque, std::list
33        > polygon;
34
35    std::cout << typeid(boost::geometry::interior_type<polygon>::type).name() << std::endl;
36
37    return 0;
38}
39
40//]
41
42//[interior_type_output
43/*`
44Output (using MSVC) is a long story (part manually replaced with ellipsis):
45[pre
46class std::list<class boost::geometry::model::ring<class boost::array<short,3>,1,1,class std::deque,class std::allocator>,class std::allocator<...> > >
47]
48*/
49//]