summaryrefslogtreecommitdiff
path: root/boost/geometry/algorithms/detail/expand/segment.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/geometry/algorithms/detail/expand/segment.hpp')
-rw-r--r--boost/geometry/algorithms/detail/expand/segment.hpp42
1 files changed, 30 insertions, 12 deletions
diff --git a/boost/geometry/algorithms/detail/expand/segment.hpp b/boost/geometry/algorithms/detail/expand/segment.hpp
index 041c1e175f..0570e944d4 100644
--- a/boost/geometry/algorithms/detail/expand/segment.hpp
+++ b/boost/geometry/algorithms/detail/expand/segment.hpp
@@ -5,9 +5,10 @@
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
// Copyright (c) 2014-2015 Samuel Debionne, Grenoble, France.
-// This file was modified by Oracle on 2015.
-// Modifications copyright (c) 2015, Oracle and/or its affiliates.
+// This file was modified by Oracle on 2015, 2016.
+// Modifications copyright (c) 2015-2016, 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
// Distributed under the Boost Software License, Version 1.0.
@@ -39,25 +40,29 @@ namespace boost { namespace geometry
namespace detail { namespace expand
{
-
-struct segment_on_sphere
+struct segment
{
- template <typename Box, typename Segment>
- static inline void apply(Box& box, Segment const& segment)
+ template <typename Box, typename Segment, typename Strategy>
+ static inline void apply(Box& box,
+ Segment const& segment,
+ Strategy const& strategy)
{
Box mbrs[2];
// compute the envelope of the segment
- detail::envelope::envelope_segment_on_sphere
+ typename point_type<Segment>::type p[2];
+ detail::assign_point_from_index<0>(segment, p[0]);
+ detail::assign_point_from_index<1>(segment, p[1]);
+ detail::envelope::envelope_segment
<
dimension<Segment>::value
- >::apply(segment, mbrs[0]);
+ >::apply(p[0], p[1], mbrs[0], strategy);
// normalize the box
- detail::envelope::envelope_box_on_spheroid::apply(box, mbrs[1]);
+ detail::envelope::envelope_box_on_spheroid::apply(box, mbrs[1], strategy);
// compute the envelope of the two boxes
- detail::envelope::envelope_range_of_boxes::apply(mbrs, box);
+ detail::envelope::envelope_range_of_boxes::apply(mbrs, box, strategy);
}
};
@@ -69,7 +74,6 @@ struct segment_on_sphere
namespace dispatch
{
-
template
<
typename Box, typename Segment,
@@ -103,13 +107,27 @@ struct expand
StrategyLess, StrategyGreater,
box_tag, segment_tag,
spherical_equatorial_tag, spherical_equatorial_tag
- > : detail::expand::segment_on_sphere
+ > : detail::expand::segment
{};
+template
+<
+ typename Box, typename Segment,
+ typename StrategyLess, typename StrategyGreater
+>
+struct expand
+ <
+ Box, Segment,
+ StrategyLess, StrategyGreater,
+ box_tag, segment_tag,
+ geographic_tag, geographic_tag
+ > : detail::expand::segment
+{};
} // namespace dispatch
#endif // DOXYGEN_NO_DISPATCH
}} // namespace boost::geometry
+
#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_EXPAND_SEGMENT_HPP