/usr/include/boost/geometry/algorithms/detail
Edit: /usr/include/boost/geometry/algorithms/detail/single_geometry.hpp (2840B)
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2013, 2014.
// Modifications copyright (c) 2013-2014, Oracle and/or its affiliates.
// 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)
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_SINGLE_GEOMETRY_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_SINGLE_GEOMETRY_HPP
#include
#include
#include
#include
#include
namespace boost { namespace geometry {
#ifndef DOXYGEN_NO_DISPATCH
namespace detail_dispatch {
// Returns single geometry by Id
// for single geometries returns the geometry itself
template ::type
>::value
>
struct single_geometry
{
typedef Geometry & return_type;
template
static inline return_type apply(Geometry & g, Id const& ) { return g; }
};
// for multi geometries returns one of the stored single geometries
template
struct single_geometry
{
typedef typename boost::range_reference::type return_type;
template
static inline return_type apply(Geometry & g, Id const& id)
{
BOOST_GEOMETRY_ASSERT(id.multi_index >= 0);
typedef typename boost::range_size::type size_type;
return range::at(g, static_cast(id.multi_index));
}
};
} // namespace detail_dispatch
#endif // DOXYGEN_NO_DISPATCH
#ifndef DOXYGEN_NO_DETAIL
namespace detail {
template
struct single_geometry_return_type
{
typedef typename detail_dispatch::single_geometry::return_type type;
};
template
inline
typename single_geometry_return_type::type
single_geometry(Geometry & geometry, Id const& id)
{
return detail_dispatch::single_geometry::apply(geometry, id);
}
template
inline
typename single_geometry_return_type::type
single_geometry(Geometry const& geometry, Id const& id)
{
return detail_dispatch::single_geometry::apply(geometry, id);
}
} // namespace detail
#endif // DOXYGEN_NO_DETAIL
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_SINGLE_GEOMETRY_HPP