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
22namespace test
23{
24
25struct custom_point_for_segment
26{
27 double x, y;
28};
29
30
31struct custom_segment
32{
33 custom_point_for_segment one, two;
34};
35
36template <typename P>
37struct custom_segment_of
38{
39 P p1, p2;
40};
41
42struct custom_segment_4
43{
44 double a, b, c, d;
45};
46
47
48} // namespace test
49
50
51BOOST_GEOMETRY_REGISTER_POINT_2D(test::custom_point_for_segment, double, cs::cartesian, x, y)
52
53BOOST_GEOMETRY_REGISTER_SEGMENT(test::custom_segment, test::custom_point_for_segment, one, two)
54BOOST_GEOMETRY_REGISTER_SEGMENT_TEMPLATIZED(test::custom_segment_of, p1, p2)
55BOOST_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

source code of boost/libs/geometry/test/test_geometries/custom_segment.hpp