// Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2008-2015 Bruno Lalande, Paris, France. // Copyright (c) 2009-2015 Mateusz Loskot, London, UK. // This file was modified by Oracle on 2015, 2016, 2017. // Modifications copyright (c) 2015-2017, Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. // Distributed under 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_ALGORITHMS_DETAIL_ENVELOPE_INTERFACE_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_ENVELOPE_INTERFACE_HPP #include #include #include #include #include #include #include #include #include #include namespace boost { namespace geometry { namespace resolve_strategy { template struct envelope { template static inline void apply(Geometry const& geometry, Box& box, Strategy const& strategy) { dispatch::envelope::apply(geometry, box, strategy); } template static inline void apply(Geometry const& geometry, Box& box, default_strategy) { typedef typename point_type::type point_type; typedef typename coordinate_type::type coordinate_type; typedef typename strategy::envelope::services::default_strategy < typename cs_tag::type, coordinate_type >::type strategy_type; dispatch::envelope::apply(geometry, box, strategy_type()); } }; } // namespace resolve_strategy namespace resolve_variant { template struct envelope { template static inline void apply(Geometry const& geometry, Box& box, Strategy const& strategy) { concepts::check(); concepts::check(); resolve_strategy::envelope::apply(geometry, box, strategy); } }; template struct envelope > { template struct visitor: boost::static_visitor { Box& m_box; Strategy const& m_strategy; visitor(Box& box, Strategy const& strategy) : m_box(box) , m_strategy(strategy) {} template void operator()(Geometry const& geometry) const { envelope::apply(geometry, m_box, m_strategy); } }; template static inline void apply(boost::variant const& geometry, Box& box, Strategy const& strategy) { boost::apply_visitor(visitor(box, strategy), geometry); } }; } // namespace resolve_variant /*! \brief \brief_calc{envelope (with strategy)} \ingroup envelope \details \details_calc{envelope,\det_envelope}. \tparam Geometry \tparam_geometry \tparam Box \tparam_box \tparam Strategy \tparam_strategy{Envelope} \param geometry \param_geometry \param mbr \param_box \param_set{envelope} \param strategy \param_strategy{envelope} \qbk{distinguish,with strategy} \qbk{[include reference/algorithms/envelope.qbk]} \qbk{ [heading Example] [envelope] [envelope_output] } */ template inline void envelope(Geometry const& geometry, Box& mbr, Strategy const& strategy) { resolve_variant::envelope::apply(geometry, mbr, strategy); } /*! \brief \brief_calc{envelope} \ingroup envelope \details \details_calc{envelope,\det_envelope}. \tparam Geometry \tparam_geometry \tparam Box \tparam_box \param geometry \param_geometry \param mbr \param_box \param_set{envelope} \qbk{[include reference/algorithms/envelope.qbk]} \qbk{ [heading Example] [envelope] [envelope_output] } */ template inline void envelope(Geometry const& geometry, Box& mbr) { resolve_variant::envelope::apply(geometry, mbr, default_strategy()); } /*! \brief \brief_calc{envelope} \ingroup envelope \details \details_calc{return_envelope,\det_envelope}. \details_return{envelope} \tparam Box \tparam_box \tparam Geometry \tparam_geometry \tparam Strategy \tparam_strategy{Envelope} \param geometry \param_geometry \param strategy \param_strategy{envelope} \return \return_calc{envelope} \qbk{distinguish,with strategy} \qbk{[include reference/algorithms/envelope.qbk]} \qbk{ [heading Example] [return_envelope] [return_envelope_output] } */ template inline Box return_envelope(Geometry const& geometry, Strategy const& strategy) { Box mbr; resolve_variant::envelope::apply(geometry, mbr, strategy); return mbr; } /*! \brief \brief_calc{envelope} \ingroup envelope \details \details_calc{return_envelope,\det_envelope}. \details_return{envelope} \tparam Box \tparam_box \tparam Geometry \tparam_geometry \param geometry \param_geometry \return \return_calc{envelope} \qbk{[include reference/algorithms/envelope.qbk]} \qbk{ [heading Example] [return_envelope] [return_envelope_output] } */ template inline Box return_envelope(Geometry const& geometry) { Box mbr; resolve_variant::envelope::apply(geometry, mbr, default_strategy()); return mbr; } }} // namespace boost::geometry #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_ENVELOPE_INTERFACE_HPP