/Src/Dependencies/Boost/libs/geometry/test/geometries/boost_array_as_point.cpp

http://hadesmem.googlecode.com/ · C++ · 36 lines · 20 code · 9 blank · 7 comment · 0 complexity · 9696719700e16965f1d014bb79f3a33c MD5 · raw file

  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Unit Test
  3. // Copyright Alfredo Correa 2010
  4. // Copyright (c) 2010 Barend Gehrels, Amsterdam, the Netherlands.
  5. // Use, modification and distribution is subject to the Boost Software License,
  6. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. #include <geometry_test_common.hpp>
  9. #include<boost/geometry/geometry.hpp>
  10. #include<boost/geometry/geometries/adapted/boost_array.hpp>
  11. #include<boost/geometry/geometries/adapted/c_array.hpp>
  12. #include<boost/geometry/geometries/adapted/boost_tuple.hpp>
  13. #include<iostream>
  14. BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian)
  15. BOOST_GEOMETRY_REGISTER_BOOST_ARRAY_CS(cs::cartesian)
  16. BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian)
  17. int test_main(int, char* [])
  18. {
  19. bg::model::point<double, 3, bg::cs::cartesian> p1(1,2,3);
  20. double p2[3] = {4,5,6};
  21. boost::tuple<double, double, double> p3(7,8,9);
  22. boost::array<double, 3> p4 = {{10,11,12}};
  23. std::clog << bg::distance(p1, p2) << std::endl;
  24. std::clog << bg::distance(p2, p3) << std::endl;
  25. std::clog << bg::distance(p3, p4) << std::endl;
  26. return 0;
  27. }