Chris@102: // Boost.Geometry (aka GGL, Generic Geometry Library) Chris@102: Chris@102: // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. Chris@102: // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. Chris@102: // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. Chris@102: // Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland Chris@102: Chris@102: // Use, modification and distribution is subject to the Boost Software License, Chris@102: // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@102: // http://www.boost.org/LICENSE_1_0.txt) Chris@102: Chris@102: #ifndef BOOST_GEOMETRY_VIEWS_DETAIL_INDEXED_POINT_VIEW_HPP Chris@102: #define BOOST_GEOMETRY_VIEWS_DETAIL_INDEXED_POINT_VIEW_HPP Chris@102: Chris@102: #include Chris@102: Chris@102: #include Chris@102: #include Chris@102: #include Chris@102: #include Chris@102: #include Chris@102: Chris@102: namespace boost { namespace geometry Chris@102: { Chris@102: Chris@102: namespace detail Chris@102: { Chris@102: Chris@102: template Chris@102: class indexed_point_view Chris@102: { Chris@102: indexed_point_view & operator=(indexed_point_view const&); Chris@102: Chris@102: public: Chris@102: typedef typename geometry::point_type::type point_type; Chris@102: typedef typename geometry::coordinate_type::type coordinate_type; Chris@102: Chris@102: indexed_point_view(Geometry & geometry) Chris@102: : m_geometry(geometry) Chris@102: {} Chris@102: Chris@102: template Chris@102: inline coordinate_type get() const Chris@102: { Chris@102: return geometry::get(m_geometry); Chris@102: } Chris@102: Chris@102: template Chris@102: inline void set(coordinate_type const& value) Chris@102: { Chris@102: geometry::set(m_geometry, value); Chris@102: } Chris@102: Chris@102: private: Chris@102: Geometry & m_geometry; Chris@102: }; Chris@102: Chris@102: } Chris@102: Chris@102: #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS Chris@102: namespace traits Chris@102: { Chris@102: Chris@102: template Chris@102: struct tag< detail::indexed_point_view > Chris@102: { Chris@102: typedef point_tag type; Chris@102: }; Chris@102: Chris@102: template Chris@102: struct coordinate_type< detail::indexed_point_view > Chris@102: { Chris@102: typedef typename geometry::coordinate_type::type type; Chris@102: }; Chris@102: Chris@102: template Chris@102: struct coordinate_system< detail::indexed_point_view > Chris@102: { Chris@102: typedef typename geometry::coordinate_system::type type; Chris@102: }; Chris@102: Chris@102: template Chris@102: struct dimension< detail::indexed_point_view > Chris@102: : geometry::dimension Chris@102: {}; Chris@102: Chris@102: template Chris@102: struct access< detail::indexed_point_view, Dimension > Chris@102: { Chris@102: typedef typename geometry::coordinate_type::type coordinate_type; Chris@102: Chris@102: static inline coordinate_type get( Chris@102: detail::indexed_point_view const& p) Chris@102: { Chris@102: return p.template get(); Chris@102: } Chris@102: Chris@102: static inline void set( Chris@102: detail::indexed_point_view & p, Chris@102: coordinate_type const& value) Chris@102: { Chris@102: p.template set(value); Chris@102: } Chris@102: }; Chris@102: Chris@102: } // namespace traits Chris@102: #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS Chris@102: Chris@102: }} // namespace boost::geometry Chris@102: Chris@102: Chris@102: #endif // BOOST_GEOMETRY_VIEWS_DETAIL_INDEXED_POINT_VIEW_HPP