1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
5 // Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
7 // This file was modified by Oracle on 2015, 2016, 2018, 2019.
8 // Modifications copyright (c) 2015-2019, Oracle and/or its affiliates.
10 // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
11 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
12 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
14 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
15 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
17 // Distributed under the Boost Software License, Version 1.0.
18 // (See accompanying file LICENSE_1_0.txt or copy at
19 // http://www.boost.org/LICENSE_1_0.txt)
21 #ifndef BOOST_GEOMETRY_STRATEGIES_CARTESIAN_ENVELOPE_HPP
22 #define BOOST_GEOMETRY_STRATEGIES_CARTESIAN_ENVELOPE_HPP
24 #include <boost/range/begin.hpp>
25 #include <boost/range/end.hpp>
27 #include <boost/geometry/algorithms/detail/envelope/initialize.hpp>
29 #include <boost/geometry/strategies/cartesian/envelope_box.hpp>
30 #include <boost/geometry/strategies/cartesian/envelope_segment.hpp>
31 #include <boost/geometry/strategies/cartesian/expand_box.hpp>
32 #include <boost/geometry/strategies/cartesian/expand_segment.hpp>
34 namespace boost { namespace geometry
37 namespace strategy { namespace envelope
40 template <typename CalculationType = void>
44 typedef cartesian_tag cs_tag;
46 typedef cartesian_point element_envelope_strategy_type;
47 static inline element_envelope_strategy_type get_element_envelope_strategy()
49 return element_envelope_strategy_type();
52 typedef expand::cartesian_point element_expand_strategy_type;
53 static inline element_expand_strategy_type get_element_expand_strategy()
55 return element_expand_strategy_type();
58 typedef expand::cartesian_box box_expand_strategy_type;
59 static inline box_expand_strategy_type get_box_expand_strategy()
61 return box_expand_strategy_type();
64 // Linestring, Ring, Polygon
66 template <typename Range>
67 static inline typename boost::range_iterator<Range const>::type begin(Range const& range)
69 return boost::begin(range);
72 template <typename Range>
73 static inline typename boost::range_iterator<Range const>::type end(Range const& range)
75 return boost::end(range);
78 // MultiLinestring, MultiPolygon
80 template <typename Box>
84 : m_initialized(false)
87 void apply(Box const& single_box)
96 box_expand_strategy_type::apply(m_box, single_box);
100 void result(Box & box)
108 geometry::detail::envelope::initialize<Box, 0, dimension<Box>::value>::apply(box);
119 template <typename Point1, typename Point2, typename Box>
120 static inline void apply(Point1 const& point1, Point2 const& point2,
123 cartesian_segment<CalculationType>::apply(point1, point2, box);
128 template <typename BoxIn, typename Box>
129 static inline void apply(BoxIn const& box_in, Box& box)
131 cartesian_box::apply(box_in, box);
135 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
140 template <typename Tag, typename CalculationType>
141 struct default_strategy<Tag, cartesian_tag, CalculationType>
143 typedef strategy::envelope::cartesian<CalculationType> type;
146 } // namespace services
148 #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
151 }} // namespace strategy::envelope
153 }} //namepsace boost::geometry
155 #endif // BOOST_GEOMETRY_STRATEGIES_CARTESIAN_ENVELOPE_HPP