// Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. // Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland // 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 BOOST_GEOMETRY_VIEWS_DETAIL_INDEXED_POINT_VIEW_HPP #define BOOST_GEOMETRY_VIEWS_DETAIL_INDEXED_POINT_VIEW_HPP #include #include #include #include #include #include namespace boost { namespace geometry { namespace detail { template class indexed_point_view { indexed_point_view & operator=(indexed_point_view const&); public: typedef typename geometry::point_type::type point_type; typedef typename geometry::coordinate_type::type coordinate_type; indexed_point_view(Geometry & geometry) : m_geometry(geometry) {} template inline coordinate_type get() const { return geometry::get(m_geometry); } template inline void set(coordinate_type const& value) { geometry::set(m_geometry, value); } private: Geometry & m_geometry; }; } #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS namespace traits { template struct tag< detail::indexed_point_view > { typedef point_tag type; }; template struct coordinate_type< detail::indexed_point_view > { typedef typename geometry::coordinate_type::type type; }; template struct coordinate_system< detail::indexed_point_view > { typedef typename geometry::coordinate_system::type type; }; template struct dimension< detail::indexed_point_view > : geometry::dimension {}; template struct access< detail::indexed_point_view, Dimension > { typedef typename geometry::coordinate_type::type coordinate_type; static inline coordinate_type get( detail::indexed_point_view const& p) { return p.template get(); } static inline void set( detail::indexed_point_view & p, coordinate_type const& value) { p.template set(value); } }; } // namespace traits #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS }} // namespace boost::geometry #endif // BOOST_GEOMETRY_VIEWS_DETAIL_INDEXED_POINT_VIEW_HPP