summaryrefslogtreecommitdiff
path: root/libs/geometry/test/point_concept/well_formed_non_cartesian_point.cpp
blob: e6817adb307e8c0b86e9831b09a96e09649f7359 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Unit Test

// Copyright (c) 2014, Oracle and/or its affiliates.

// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle

// Licensed under the Boost Software License version 1.0.
// http://www.boost.org/users/license.html

#include <test_geometries/custom_lon_lat_point.hpp>

#include <boost/geometry/core/cs.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>


namespace bg = boost::geometry;


template <typename CoordinateSystem>
inline void test_coordinate_system()
{
    typedef bg::model::point<double, 2, CoordinateSystem> bg_double_point;
    typedef bg::model::point<int, 2, CoordinateSystem> bg_int_point;

    typedef rw_lon_lat_point<double, CoordinateSystem> rw_double_point;
    typedef ro_lon_lat_point<double, CoordinateSystem> ro_double_point;

    typedef rw_lon_lat_point<int, CoordinateSystem> rw_int_point;
    typedef ro_lon_lat_point<int, CoordinateSystem> ro_int_point;

    bg::concept::check<bg_int_point>();
    bg::concept::check<bg_int_point const>();

    bg::concept::check<bg_double_point>();
    bg::concept::check<bg_double_point const>();

    bg::concept::check<rw_int_point>();
    bg::concept::check<rw_int_point const>();
    bg::concept::check<ro_int_point const>();

    bg::concept::check<rw_double_point>();
    bg::concept::check<rw_double_point const>();
    bg::concept::check<ro_double_point const>();
}


int main()
{
    test_coordinate_system<bg::cs::geographic<bg::degree> >();
    test_coordinate_system<bg::cs::geographic<bg::radian> >();

    test_coordinate_system<bg::cs::spherical<bg::degree> >();
    test_coordinate_system<bg::cs::spherical<bg::radian> >();

    test_coordinate_system<bg::cs::spherical_equatorial<bg::degree> >();
    test_coordinate_system<bg::cs::spherical_equatorial<bg::radian> >();

    test_coordinate_system<bg::cs::polar<bg::degree> >();
    test_coordinate_system<bg::cs::polar<bg::radian> >();

    return 0;
}