1 | // Boost.Geometry (aka GGL, Generic Geometry Library) |
2 | // Unit Test |
3 | |
4 | // Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. |
5 | |
6 | // Use, modification and distribution is subject to the Boost Software License, |
7 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
8 | // http://www.boost.org/LICENSE_1_0.txt) |
9 | |
10 | |
11 | #ifndef GEOMETRY_TEST_TEST_GEOMETRIES_CUSTOM_SEGMENT_HPP |
12 | #define GEOMETRY_TEST_TEST_GEOMETRIES_CUSTOM_SEGMENT_HPP |
13 | |
14 | |
15 | #include <boost/geometry/geometries/register/point.hpp> |
16 | #include <boost/geometry/geometries/register/segment.hpp> |
17 | |
18 | #include <boost/geometry/core/tag.hpp> |
19 | #include <boost/geometry/core/tags.hpp> |
20 | |
21 | |
22 | namespace test |
23 | { |
24 | |
25 | struct custom_point_for_segment |
26 | { |
27 | double x, y; |
28 | }; |
29 | |
30 | |
31 | struct custom_segment |
32 | { |
33 | custom_point_for_segment one, two; |
34 | }; |
35 | |
36 | template <typename P> |
37 | struct custom_segment_of |
38 | { |
39 | P p1, p2; |
40 | }; |
41 | |
42 | struct custom_segment_4 |
43 | { |
44 | double a, b, c, d; |
45 | }; |
46 | |
47 | |
48 | } // namespace test |
49 | |
50 | |
51 | BOOST_GEOMETRY_REGISTER_POINT_2D(test::custom_point_for_segment, double, cs::cartesian, x, y) |
52 | |
53 | BOOST_GEOMETRY_REGISTER_SEGMENT(test::custom_segment, test::custom_point_for_segment, one, two) |
54 | BOOST_GEOMETRY_REGISTER_SEGMENT_TEMPLATIZED(test::custom_segment_of, p1, p2) |
55 | BOOST_GEOMETRY_REGISTER_SEGMENT_2D_4VALUES(test::custom_segment_4, test::custom_point_for_segment, a, b, c, d) |
56 | |
57 | |
58 | #endif // GEOMETRY_TEST_TEST_GEOMETRIES_CUSTOM_SEGMENT_HPP |
59 | |