// 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 #ifndef BOOST_GEOMETRY_TEST_TEST_GEOMETRIES_CUSTOM_LON_LAT_POINT_HPP #define BOOST_GEOMETRY_TEST_TEST_GEOMETRIES_CUSTOM_LON_LAT_POINT_HPP #include #include #include #include #include #include #include // read/write longitude/latitude point template struct rw_lon_lat_point { CoordinateType longitude, latitude; }; namespace boost { namespace geometry { namespace traits { template struct tag > { typedef point_tag type; }; template struct coordinate_type > { typedef CoordinateType type; }; template struct coordinate_system > { typedef CoordinateSystem type; }; template struct dimension > : boost::mpl::int_<2> {}; template < typename CoordinateType, typename CoordinateSystem, std::size_t Dimension > struct access, Dimension> { static inline CoordinateType get(rw_lon_lat_point const& p) { return (Dimension == 0) ? p.longitude : p.latitude; } static inline void set(rw_lon_lat_point& p, CoordinateType const& value) { ( Dimension == 0 ? p.longitude : p.latitude ) = value; } }; }}} // namespace boost::geometry::traits // read-only longitude/latitude point template struct ro_lon_lat_point { CoordinateType longitude, latitude; }; namespace boost { namespace geometry { namespace traits { template struct tag > { typedef point_tag type; }; template struct coordinate_type > { typedef CoordinateType type; }; template struct coordinate_system > { typedef CoordinateSystem type; }; template struct dimension > : boost::mpl::int_<2> {}; template < typename CoordinateType, typename CoordinateSystem, std::size_t Dimension > struct access, Dimension> { static inline CoordinateType get(ro_lon_lat_point const& p) { return (Dimension == 0) ? p.longitude : p.latitude; } }; }}} // namespace boost::geometry::traits #endif // BOOST_GEOMETRY_TEST_TEST_GEOMETRIES_CUSTOM_LON_LAT_POINT_HPP