Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:35:05

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
0004 // Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
0005 // Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
0006 
0007 // This file was modified by Oracle on 2015-2020.
0008 // Modifications copyright (c) 2015-2020, Oracle and/or its affiliates.
0009 
0010 // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
0011 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
0012 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0013 
0014 // Distributed under the Boost Software License, Version 1.0.
0015 // (See accompanying file LICENSE_1_0.txt or copy at
0016 // http://www.boost.org/LICENSE_1_0.txt)
0017 
0018 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_ENVELOPE_SEGMENT_HPP
0019 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_ENVELOPE_SEGMENT_HPP
0020 
0021 #include <cstddef>
0022 
0023 #include <boost/geometry/core/tags.hpp>
0024 
0025 #include <boost/geometry/algorithms/detail/assign_indexed_point.hpp>
0026 #include <boost/geometry/algorithms/dispatch/envelope.hpp>
0027 
0028 // TEMP
0029 #include <boost/geometry/strategies/detail.hpp>
0030 
0031 namespace boost { namespace geometry
0032 {
0033 
0034 #ifndef DOXYGEN_NO_DETAIL
0035 namespace detail { namespace envelope
0036 {
0037 
0038 // TEMP
0039 template
0040 <
0041     typename Strategy,
0042     bool IsUmbrella = strategies::detail::is_umbrella_strategy<Strategy>::value
0043 >
0044 struct envelope_segment_call_strategy
0045 {
0046     template <typename Point, typename Segment, typename Box>
0047     static inline void apply(Point const& p1, Point const& p2,
0048                              Segment const& segment, Box& mbr,
0049                              Strategy const& strategy)
0050     {
0051         strategy.envelope(segment, mbr).apply(p1, p2, mbr);
0052     }
0053 };
0054 
0055 template <typename Strategy>
0056 struct envelope_segment_call_strategy<Strategy, false>
0057 {
0058     template <typename Point, typename Segment, typename Box>
0059     static inline void apply(Point const& p1, Point const& p2,
0060                              Segment const&, Box& mbr,
0061                              Strategy const& strategy)
0062     {
0063         strategy.apply(p1, p2, mbr);
0064     }
0065 };
0066 
0067 struct envelope_segment
0068 {
0069     template <typename Segment, typename Box, typename Strategy>
0070     static inline void apply(Segment const& segment, Box& mbr,
0071                              Strategy const& strategy)
0072     {
0073         typename point_type<Segment>::type p[2];
0074         detail::assign_point_from_index<0>(segment, p[0]);
0075         detail::assign_point_from_index<1>(segment, p[1]);
0076 
0077         // TEMP - expand calls this and Umbrella strategies are not yet supported there
0078         envelope_segment_call_strategy<Strategy>::apply(p[0], p[1], segment, mbr, strategy);
0079     }
0080 };
0081 
0082 }} // namespace detail::envelope
0083 #endif // DOXYGEN_NO_DETAIL
0084 
0085 
0086 #ifndef DOXYGEN_NO_DISPATCH
0087 namespace dispatch
0088 {
0089 
0090 
0091 template <typename Segment>
0092 struct envelope<Segment, segment_tag>
0093 {
0094     template <typename Box, typename Strategy>
0095     static inline void apply(Segment const& segment,
0096                              Box& mbr,
0097                              Strategy const& strategy)
0098     {
0099         detail::envelope::envelope_segment
0100             /*<
0101                dimension<Segment>::value
0102             >*/::apply(segment, mbr, strategy);
0103     }
0104 };
0105 
0106 } // namespace dispatch
0107 #endif // DOXYGEN_NO_DISPATCH
0108 
0109 }} // namespace boost::geometry
0110 
0111 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_ENVELOPE_SEGMENT_HPP