1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2015-2017, Oracle and/or its affiliates.
5 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
6 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
8 // Licensed under the Boost Software License version 1.0.
9 // http://www.boost.org/users/license.html
11 #ifndef BOOST_GEOMETRY_GEOMETRIES_HELPER_GEOMETRY_HPP
12 #define BOOST_GEOMETRY_GEOMETRIES_HELPER_GEOMETRY_HPP
14 #include <boost/mpl/assert.hpp>
16 #include <boost/geometry/core/cs.hpp>
17 #include <boost/geometry/core/coordinate_dimension.hpp>
18 #include <boost/geometry/core/coordinate_type.hpp>
19 #include <boost/geometry/core/point_type.hpp>
20 #include <boost/geometry/core/tag.hpp>
21 #include <boost/geometry/core/tags.hpp>
23 #include <boost/geometry/geometries/box.hpp>
24 #include <boost/geometry/geometries/point.hpp>
26 #include <boost/geometry/algorithms/not_implemented.hpp>
29 namespace boost { namespace geometry
32 namespace detail { namespace helper_geometries
38 typename NewCoordinateType,
40 typename CS_Tag = typename cs_tag<Point>::type
47 dimension<Point>::value,
48 typename cs_tag_to_coordinate_system<NewUnits, CS_Tag>::type
53 }} // detail::helper_geometries
56 namespace detail_dispatch
63 typename NewCoordinateType,
65 typename Tag = typename tag<Geometry>::type>
66 struct helper_geometry : not_implemented<Geometry>
70 template <typename Point, typename NewCoordinateType, typename NewUnits>
71 struct helper_geometry<Point, NewCoordinateType, NewUnits, point_tag>
73 typedef typename detail::helper_geometries::helper_point
75 Point, NewCoordinateType, NewUnits
80 template <typename Box, typename NewCoordinateType, typename NewUnits>
81 struct helper_geometry<Box, NewCoordinateType, NewUnits, box_tag>
85 typename helper_geometry
87 typename point_type<Box>::type, NewCoordinateType, NewUnits
96 // Meta-function that provides a new helper geometry of the same kind as
97 // the input geometry and the same coordinate system type,
98 // but with a possibly different coordinate type and coordinate system units
102 typename NewCoordinateType = typename coordinate_type<Geometry>::type,
103 typename NewUnits = typename detail::cs_angular_units<Geometry>::type
105 struct helper_geometry
107 typedef typename detail_dispatch::helper_geometry
109 Geometry, NewCoordinateType, NewUnits
114 }} // namespace boost::geometry
116 #endif // BOOST_GEOMETRY_GEOMETRIES_HELPER_GEOMETRY_HPP