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

http://hadesmem.googlecode.com/ · C++ · 42 lines · 12 code · 13 blank · 17 comment · 0 complexity · ee7f5e7cbf130ce6729b47c7e09107aa 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. //[set_point
  8. //` Set the coordinate of a point
  9. #include <iostream>
  10. #include <boost/geometry.hpp>
  11. #include <boost/geometry/geometries/point_xy.hpp>
  12. namespace bg = boost::geometry;
  13. int main()
  14. {
  15. bg::model::d2::point_xy<double> point;
  16. bg::set<0>(point, 1);
  17. bg::set<1>(point, 2);
  18. std::cout << "Location: " << bg::dsv(point) << std::endl;
  19. return 0;
  20. }
  21. //]
  22. //[set_point_output
  23. /*`
  24. Output:
  25. [pre
  26. Location: (1, 2)
  27. ]
  28. */
  29. //]