PageRenderTime 21ms CodeModel.GetById 13ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

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