/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. // 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. //[point_type
  8. //` Examine the point type of a multi_polygon
  9. #include <iostream>
  10. #include <typeinfo>
  11. #include <boost/geometry.hpp>
  12. #include <boost/geometry/geometries/polygon.hpp>
  13. #include <boost/geometry/geometries/point_xy.hpp>
  14. #include <boost/geometry/multi/geometries/multi_polygon.hpp>
  15. int main()
  16. {
  17. typedef boost::geometry::model::d2::point_xy<double> point_type;
  18. typedef boost::geometry::model::polygon<point_type> polygon_type;
  19. typedef boost::geometry::model::multi_polygon<polygon_type> mp_type;
  20. typedef boost::geometry::point_type<mp_type>::type ptype;
  21. std::cout << "point type: " << typeid(ptype).name() << std::endl;
  22. return 0;
  23. }
  24. //]
  25. //[point_type_output
  26. /*`
  27. Output (in MSVC):
  28. [pre
  29. point type: class boost::geometry::model::d2::point_xy<double,struct boost::geometry::cs::cartesian>
  30. ]
  31. */
  32. //]