/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. // Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands.
  4. // Use, modification and distribution is subject to the Boost Software License,
  5. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. //[interior_type
  8. //`Shows how to use the interior_type metafunction
  9. #include <iostream>
  10. #include <typeinfo>
  11. #include <boost/geometry.hpp>
  12. #include <boost/geometry/geometries/polygon.hpp>
  13. #include <boost/geometry/geometries/ring.hpp>
  14. #include <boost/geometry/geometries/adapted/boost_array.hpp>
  15. BOOST_GEOMETRY_REGISTER_BOOST_ARRAY_CS(cs::cartesian)
  16. int main()
  17. {
  18. // Define a polygon storing points in a deque and storing interior rings
  19. // in a list (note that std::list is not supported by most algorithms
  20. // because not supporting a random access iterator)
  21. typedef boost::geometry::model::polygon
  22. <
  23. boost::array<short, 3>,
  24. true, true,
  25. std::deque, std::list
  26. > polygon;
  27. std::cout << typeid(boost::geometry::interior_type<polygon>::type).name() << std::endl;
  28. return 0;
  29. }
  30. //]
  31. //[interior_type_output
  32. /*`
  33. Output (using MSVC) is a long story (part manually replaced with ellipsis):
  34. [pre
  35. class std::list<class boost::geometry::model::ring<class boost::array<short,3>,1,1,class std::deque,class std::allocator>,class std::allocator<...> > >
  36. ]
  37. */
  38. //]