// Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test // Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef GEOMETRY_TEST_TEST_GEOMETRIES_ALL_CUSTOM_POLYGON_HPP #define GEOMETRY_TEST_TEST_GEOMETRIES_ALL_CUSTOM_POLYGON_HPP #include #include #include #include #include #include #include template class all_custom_polygon { public : typedef all_custom_ring

custom_ring_type; typedef all_custom_container custom_int_type; custom_ring_type& custom_ext() { return m_ext; } custom_int_type& custom_int() { return m_int; } custom_ring_type const& custom_ext() const { return m_ext; } custom_int_type const& custom_int() const { return m_int; } private : custom_ring_type m_ext; custom_int_type m_int; }; namespace boost { namespace geometry { namespace traits { template struct tag > { typedef polygon_tag type; }; template struct ring_const_type > { typedef typename all_custom_polygon::custom_ring_type const& type; }; template struct ring_mutable_type > { typedef typename all_custom_polygon::custom_ring_type& type; }; template struct interior_const_type > { typedef typename all_custom_polygon::custom_int_type const& type; }; template struct interior_mutable_type > { typedef typename all_custom_polygon::custom_int_type& type; }; template struct exterior_ring > { typedef all_custom_polygon polygon_type; typedef typename polygon_type::custom_ring_type ring_type; static inline ring_type& get(polygon_type& p) { return p.custom_ext(); } static inline ring_type const& get(polygon_type const& p) { return p.custom_ext(); } }; template struct interior_rings > { typedef all_custom_polygon polygon_type; typedef typename polygon_type::custom_int_type int_type; static inline int_type& get(polygon_type& p) { return p.custom_int(); } static inline int_type const& get(polygon_type const& p) { return p.custom_int(); } }; } // namespace traits }} // namespace boost::geometry #endif // GEOMETRY_TEST_TEST_GEOMETRIES_ALL_CUSTOM_POLYGON_HPP