update boost on linux
This commit is contained in:
@@ -5,11 +5,12 @@
|
||||
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2014-2015 Samuel Debionne, Grenoble, France.
|
||||
|
||||
// This file was modified by Oracle on 2015, 2016.
|
||||
// Modifications copyright (c) 2015-2016, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2015, 2016, 2017, 2018.
|
||||
// Modifications copyright (c) 2015-2018, 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
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -18,52 +19,19 @@
|
||||
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_EXPAND_BOX_HPP
|
||||
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_EXPAND_BOX_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <algorithm>
|
||||
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/detail/envelope/box.hpp>
|
||||
#include <boost/geometry/algorithms/detail/envelope/range_of_boxes.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/detail/expand/indexed.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/dispatch/expand.hpp>
|
||||
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
// For backward compatibility
|
||||
#include <boost/geometry/strategies/cartesian/expand_box.hpp>
|
||||
#include <boost/geometry/strategies/spherical/expand_box.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
namespace detail { namespace expand
|
||||
{
|
||||
|
||||
|
||||
struct box_on_spheroid
|
||||
{
|
||||
template <typename BoxOut, typename BoxIn, typename Strategy>
|
||||
static inline void apply(BoxOut& box_out,
|
||||
BoxIn const& box_in,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
// normalize both boxes and convert box-in to be of type of box-out
|
||||
BoxOut mbrs[2];
|
||||
detail::envelope::envelope_box_on_spheroid::apply(box_in, mbrs[0], strategy);
|
||||
detail::envelope::envelope_box_on_spheroid::apply(box_out, mbrs[1], strategy);
|
||||
|
||||
// compute the envelope of the two boxes
|
||||
detail::envelope::envelope_range_of_boxes::apply(mbrs, box_out, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}} // namespace detail::expand
|
||||
#endif // DOXYGEN_NO_DETAIL
|
||||
|
||||
#ifndef DOXYGEN_NO_DISPATCH
|
||||
namespace dispatch
|
||||
{
|
||||
@@ -72,53 +40,23 @@ namespace dispatch
|
||||
// Box + box -> new box containing two input boxes
|
||||
template
|
||||
<
|
||||
typename BoxOut, typename BoxIn,
|
||||
typename StrategyLess, typename StrategyGreater,
|
||||
typename CSTagOut, typename CSTag
|
||||
typename BoxOut, typename BoxIn
|
||||
>
|
||||
struct expand
|
||||
<
|
||||
BoxOut, BoxIn,
|
||||
StrategyLess, StrategyGreater,
|
||||
box_tag, box_tag,
|
||||
CSTagOut, CSTag
|
||||
> : detail::expand::expand_indexed
|
||||
<
|
||||
0, dimension<BoxIn>::value, StrategyLess, StrategyGreater
|
||||
>
|
||||
box_tag, box_tag
|
||||
>
|
||||
{
|
||||
BOOST_MPL_ASSERT_MSG((boost::is_same<CSTagOut, CSTag>::value),
|
||||
COORDINATE_SYSTEMS_MUST_BE_THE_SAME,
|
||||
(types<CSTagOut, CSTag>()));
|
||||
template <typename Strategy>
|
||||
static inline void apply(BoxOut& box_out,
|
||||
BoxIn const& box_in,
|
||||
Strategy const& )
|
||||
{
|
||||
Strategy::apply(box_out, box_in);
|
||||
}
|
||||
};
|
||||
|
||||
template
|
||||
<
|
||||
typename BoxOut, typename BoxIn,
|
||||
typename StrategyLess, typename StrategyGreater
|
||||
>
|
||||
struct expand
|
||||
<
|
||||
BoxOut, BoxIn,
|
||||
StrategyLess, StrategyGreater,
|
||||
box_tag, box_tag,
|
||||
spherical_equatorial_tag, spherical_equatorial_tag
|
||||
> : detail::expand::box_on_spheroid
|
||||
{};
|
||||
|
||||
template
|
||||
<
|
||||
typename BoxOut, typename BoxIn,
|
||||
typename StrategyLess, typename StrategyGreater
|
||||
>
|
||||
struct expand
|
||||
<
|
||||
BoxOut, BoxIn,
|
||||
StrategyLess, StrategyGreater,
|
||||
box_tag, box_tag,
|
||||
geographic_tag, geographic_tag
|
||||
> : detail::expand::box_on_spheroid
|
||||
{};
|
||||
|
||||
|
||||
} // namespace dispatch
|
||||
|
||||
@@ -5,11 +5,12 @@
|
||||
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2014-2015 Samuel Debionne, Grenoble, France.
|
||||
|
||||
// This file was modified by Oracle on 2015, 2016.
|
||||
// Modifications copyright (c) 2015-2016, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2015, 2016, 2017, 2018.
|
||||
// Modifications copyright (c) 2015-2018, 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.
|
||||
@@ -22,15 +23,13 @@
|
||||
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_EXPAND_INDEXED_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <functional>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
#include <boost/geometry/util/select_coordinate_type.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/compare.hpp>
|
||||
#include <boost/geometry/policies/compare.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/dispatch/expand.hpp>
|
||||
|
||||
|
||||
@@ -44,36 +43,25 @@ namespace detail { namespace expand
|
||||
|
||||
template
|
||||
<
|
||||
typename StrategyLess, typename StrategyGreater,
|
||||
std::size_t Index,
|
||||
std::size_t Dimension, std::size_t DimensionCount
|
||||
>
|
||||
struct indexed_loop
|
||||
{
|
||||
template <typename Box, typename Geometry, typename Strategy>
|
||||
static inline void apply(Box& box, Geometry const& source, Strategy const& strategy)
|
||||
template <typename Box, typename Geometry>
|
||||
static inline void apply(Box& box, Geometry const& source)
|
||||
{
|
||||
typedef typename strategy::compare::detail::select_strategy
|
||||
<
|
||||
StrategyLess, 1, Box, Dimension
|
||||
>::type less_type;
|
||||
|
||||
typedef typename strategy::compare::detail::select_strategy
|
||||
<
|
||||
StrategyGreater, -1, Box, Dimension
|
||||
>::type greater_type;
|
||||
|
||||
typedef typename select_coordinate_type
|
||||
<
|
||||
Box,
|
||||
Geometry
|
||||
>::type coordinate_type;
|
||||
|
||||
less_type less;
|
||||
greater_type greater;
|
||||
|
||||
coordinate_type const coord = get<Index, Dimension>(source);
|
||||
|
||||
std::less<coordinate_type> less;
|
||||
std::greater<coordinate_type> greater;
|
||||
|
||||
if (less(coord, get<min_corner, Dimension>(box)))
|
||||
{
|
||||
set<min_corner, Dimension>(box, coord);
|
||||
@@ -86,54 +74,40 @@ struct indexed_loop
|
||||
|
||||
indexed_loop
|
||||
<
|
||||
StrategyLess, StrategyGreater,
|
||||
Index, Dimension + 1, DimensionCount
|
||||
>::apply(box, source, strategy);
|
||||
>::apply(box, source);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template
|
||||
<
|
||||
typename StrategyLess, typename StrategyGreater,
|
||||
std::size_t Index, std::size_t DimensionCount
|
||||
>
|
||||
template <std::size_t Index, std::size_t DimensionCount>
|
||||
struct indexed_loop
|
||||
<
|
||||
StrategyLess, StrategyGreater,
|
||||
Index, DimensionCount, DimensionCount
|
||||
>
|
||||
{
|
||||
template <typename Box, typename Geometry, typename Strategy>
|
||||
static inline void apply(Box&, Geometry const&, Strategy const&) {}
|
||||
template <typename Box, typename Geometry>
|
||||
static inline void apply(Box&, Geometry const&) {}
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Changes a box such that the other box is also contained by the box
|
||||
template
|
||||
<
|
||||
std::size_t Dimension, std::size_t DimensionCount,
|
||||
typename StrategyLess, typename StrategyGreater
|
||||
>
|
||||
template <std::size_t Dimension, std::size_t DimensionCount>
|
||||
struct expand_indexed
|
||||
{
|
||||
template <typename Box, typename Geometry, typename Strategy>
|
||||
static inline void apply(Box& box,
|
||||
Geometry const& geometry,
|
||||
Strategy const& strategy)
|
||||
template <typename Box, typename Geometry>
|
||||
static inline void apply(Box& box, Geometry const& geometry)
|
||||
{
|
||||
indexed_loop
|
||||
<
|
||||
StrategyLess, StrategyGreater,
|
||||
0, Dimension, DimensionCount
|
||||
>::apply(box, geometry, strategy);
|
||||
>::apply(box, geometry);
|
||||
|
||||
indexed_loop
|
||||
<
|
||||
StrategyLess, StrategyGreater,
|
||||
1, Dimension, DimensionCount
|
||||
>::apply(box, geometry, strategy);
|
||||
>::apply(box, geometry);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -5,11 +5,12 @@
|
||||
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2014-2015 Samuel Debionne, Grenoble, France.
|
||||
|
||||
// This file was modified by Oracle on 2015, 2016.
|
||||
// Modifications copyright (c) 2015-2016, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2015, 2016, 2018.
|
||||
// Modifications copyright (c) 2015-2018, 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.
|
||||
@@ -25,16 +26,17 @@
|
||||
#include <boost/variant/static_visitor.hpp>
|
||||
#include <boost/variant/variant_fwd.hpp>
|
||||
|
||||
#include <boost/geometry/core/coordinate_system.hpp>
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/check.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/dispatch/expand.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/default_strategy.hpp>
|
||||
#include <boost/geometry/strategies/expand.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/envelope.hpp>
|
||||
#include <boost/geometry/strategies/cartesian/envelope_segment.hpp>
|
||||
#include <boost/geometry/strategies/spherical/envelope_segment.hpp>
|
||||
#include <boost/geometry/strategies/geographic/envelope_segment.hpp>
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
@@ -58,14 +60,11 @@ struct expand
|
||||
Geometry const& geometry,
|
||||
default_strategy)
|
||||
{
|
||||
typedef typename point_type<Geometry>::type point_type;
|
||||
typedef typename coordinate_type<point_type>::type coordinate_type;
|
||||
|
||||
typedef typename strategy::envelope::services::default_strategy
|
||||
<
|
||||
typename cs_tag<point_type>::type,
|
||||
coordinate_type
|
||||
>::type strategy_type;
|
||||
typedef typename strategy::expand::services::default_strategy
|
||||
<
|
||||
typename tag<Geometry>::type,
|
||||
typename cs_tag<Geometry>::type
|
||||
>::type strategy_type;
|
||||
|
||||
dispatch::expand<Box, Geometry>::apply(box, geometry, strategy_type());
|
||||
}
|
||||
|
||||
@@ -5,11 +5,12 @@
|
||||
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2014-2015 Samuel Debionne, Grenoble, France.
|
||||
|
||||
// This file was modified by Oracle on 2015, 2016.
|
||||
// Modifications copyright (c) 2015-2016, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2015-2018.
|
||||
// Modifications copyright (c) 2015-2018, 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.
|
||||
@@ -21,222 +22,19 @@
|
||||
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_EXPAND_POINT_HPP
|
||||
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_EXPAND_POINT_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <algorithm>
|
||||
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
#include <boost/geometry/core/coordinate_system.hpp>
|
||||
#include <boost/geometry/core/coordinate_type.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
#include <boost/geometry/util/math.hpp>
|
||||
#include <boost/geometry/util/select_coordinate_type.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/compare.hpp>
|
||||
#include <boost/geometry/policies/compare.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/detail/normalize.hpp>
|
||||
#include <boost/geometry/algorithms/detail/envelope/transform_units.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/dispatch/expand.hpp>
|
||||
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
// For backward compatibility
|
||||
#include <boost/geometry/strategies/cartesian/expand_point.hpp>
|
||||
#include <boost/geometry/strategies/spherical/expand_point.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
namespace detail { namespace expand
|
||||
{
|
||||
|
||||
|
||||
template
|
||||
<
|
||||
typename StrategyLess, typename StrategyGreater,
|
||||
std::size_t Dimension, std::size_t DimensionCount
|
||||
>
|
||||
struct point_loop
|
||||
{
|
||||
template <typename Box, typename Point, typename Strategy>
|
||||
static inline void apply(Box& box, Point const& source, Strategy const& strategy)
|
||||
{
|
||||
typedef typename strategy::compare::detail::select_strategy
|
||||
<
|
||||
StrategyLess, 1, Point, Dimension
|
||||
>::type less_type;
|
||||
|
||||
typedef typename strategy::compare::detail::select_strategy
|
||||
<
|
||||
StrategyGreater, -1, Point, Dimension
|
||||
>::type greater_type;
|
||||
|
||||
typedef typename select_coordinate_type
|
||||
<
|
||||
Point, Box
|
||||
>::type coordinate_type;
|
||||
|
||||
less_type less;
|
||||
greater_type greater;
|
||||
|
||||
coordinate_type const coord = get<Dimension>(source);
|
||||
|
||||
if (less(coord, get<min_corner, Dimension>(box)))
|
||||
{
|
||||
set<min_corner, Dimension>(box, coord);
|
||||
}
|
||||
|
||||
if (greater(coord, get<max_corner, Dimension>(box)))
|
||||
{
|
||||
set<max_corner, Dimension>(box, coord);
|
||||
}
|
||||
|
||||
point_loop
|
||||
<
|
||||
StrategyLess, StrategyGreater, Dimension + 1, DimensionCount
|
||||
>::apply(box, source, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template
|
||||
<
|
||||
typename StrategyLess,
|
||||
typename StrategyGreater,
|
||||
std::size_t DimensionCount
|
||||
>
|
||||
struct point_loop
|
||||
<
|
||||
StrategyLess, StrategyGreater, DimensionCount, DimensionCount
|
||||
>
|
||||
{
|
||||
template <typename Box, typename Point, typename Strategy>
|
||||
static inline void apply(Box&, Point const&, Strategy const&) {}
|
||||
};
|
||||
|
||||
|
||||
// implementation for the spherical equatorial and geographic coordinate systems
|
||||
template
|
||||
<
|
||||
typename StrategyLess,
|
||||
typename StrategyGreater,
|
||||
std::size_t DimensionCount
|
||||
>
|
||||
struct point_loop_on_spheroid
|
||||
{
|
||||
template <typename Box, typename Point, typename Strategy>
|
||||
static inline void apply(Box& box,
|
||||
Point const& point,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
typedef typename point_type<Box>::type box_point_type;
|
||||
typedef typename coordinate_type<Box>::type box_coordinate_type;
|
||||
|
||||
typedef math::detail::constants_on_spheroid
|
||||
<
|
||||
box_coordinate_type,
|
||||
typename coordinate_system<Box>::type::units
|
||||
> constants;
|
||||
|
||||
// normalize input point and input box
|
||||
Point p_normalized = detail::return_normalized<Point>(point);
|
||||
detail::normalize(box, box);
|
||||
|
||||
// transform input point to be of the same type as the box point
|
||||
box_point_type box_point;
|
||||
detail::envelope::transform_units(p_normalized, box_point);
|
||||
|
||||
box_coordinate_type p_lon = geometry::get<0>(box_point);
|
||||
box_coordinate_type p_lat = geometry::get<1>(box_point);
|
||||
|
||||
typename coordinate_type<Box>::type
|
||||
b_lon_min = geometry::get<min_corner, 0>(box),
|
||||
b_lat_min = geometry::get<min_corner, 1>(box),
|
||||
b_lon_max = geometry::get<max_corner, 0>(box),
|
||||
b_lat_max = geometry::get<max_corner, 1>(box);
|
||||
|
||||
if (math::equals(math::abs(p_lat), constants::max_latitude()))
|
||||
{
|
||||
// the point of expansion is the either the north or the
|
||||
// south pole; the only important coordinate here is the
|
||||
// pole's latitude, as the longitude can be anything;
|
||||
// we, thus, take into account the point's latitude only and return
|
||||
geometry::set<min_corner, 1>(box, (std::min)(p_lat, b_lat_min));
|
||||
geometry::set<max_corner, 1>(box, (std::max)(p_lat, b_lat_max));
|
||||
return;
|
||||
}
|
||||
|
||||
if (math::equals(b_lat_min, b_lat_max)
|
||||
&& math::equals(math::abs(b_lat_min), constants::max_latitude()))
|
||||
{
|
||||
// the box degenerates to either the north or the south pole;
|
||||
// the only important coordinate here is the pole's latitude,
|
||||
// as the longitude can be anything;
|
||||
// we thus take into account the box's latitude only and return
|
||||
geometry::set<min_corner, 0>(box, p_lon);
|
||||
geometry::set<min_corner, 1>(box, (std::min)(p_lat, b_lat_min));
|
||||
geometry::set<max_corner, 0>(box, p_lon);
|
||||
geometry::set<max_corner, 1>(box, (std::max)(p_lat, b_lat_max));
|
||||
return;
|
||||
}
|
||||
|
||||
// update latitudes
|
||||
b_lat_min = (std::min)(b_lat_min, p_lat);
|
||||
b_lat_max = (std::max)(b_lat_max, p_lat);
|
||||
|
||||
// update longitudes
|
||||
if (math::smaller(p_lon, b_lon_min))
|
||||
{
|
||||
box_coordinate_type p_lon_shifted = p_lon + constants::period();
|
||||
|
||||
if (math::larger(p_lon_shifted, b_lon_max))
|
||||
{
|
||||
// here we could check using: ! math::larger(.., ..)
|
||||
if (math::smaller(b_lon_min - p_lon, p_lon_shifted - b_lon_max))
|
||||
{
|
||||
b_lon_min = p_lon;
|
||||
}
|
||||
else
|
||||
{
|
||||
b_lon_max = p_lon_shifted;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (math::larger(p_lon, b_lon_max))
|
||||
{
|
||||
// in this case, and since p_lon is normalized in the range
|
||||
// (-180, 180], we must have that b_lon_max <= 180
|
||||
if (b_lon_min < 0
|
||||
&& math::larger(p_lon - b_lon_max,
|
||||
constants::period() - p_lon + b_lon_min))
|
||||
{
|
||||
b_lon_min = p_lon;
|
||||
b_lon_max += constants::period();
|
||||
}
|
||||
else
|
||||
{
|
||||
b_lon_max = p_lon;
|
||||
}
|
||||
}
|
||||
|
||||
geometry::set<min_corner, 0>(box, b_lon_min);
|
||||
geometry::set<min_corner, 1>(box, b_lat_min);
|
||||
geometry::set<max_corner, 0>(box, b_lon_max);
|
||||
geometry::set<max_corner, 1>(box, b_lat_max);
|
||||
|
||||
point_loop
|
||||
<
|
||||
StrategyLess, StrategyGreater, 2, DimensionCount
|
||||
>::apply(box, point, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}} // namespace detail::expand
|
||||
#endif // DOXYGEN_NO_DETAIL
|
||||
|
||||
#ifndef DOXYGEN_NO_DISPATCH
|
||||
namespace dispatch
|
||||
{
|
||||
@@ -245,59 +43,23 @@ namespace dispatch
|
||||
// Box + point -> new box containing also point
|
||||
template
|
||||
<
|
||||
typename BoxOut, typename Point,
|
||||
typename StrategyLess, typename StrategyGreater,
|
||||
typename CSTagOut, typename CSTag
|
||||
typename BoxOut, typename Point
|
||||
>
|
||||
struct expand
|
||||
<
|
||||
BoxOut, Point,
|
||||
StrategyLess, StrategyGreater,
|
||||
box_tag, point_tag,
|
||||
CSTagOut, CSTag
|
||||
> : detail::expand::point_loop
|
||||
<
|
||||
StrategyLess, StrategyGreater, 0, dimension<Point>::value
|
||||
>
|
||||
box_tag, point_tag
|
||||
>
|
||||
{
|
||||
BOOST_MPL_ASSERT_MSG((boost::is_same<CSTagOut, CSTag>::value),
|
||||
COORDINATE_SYSTEMS_MUST_BE_THE_SAME,
|
||||
(types<CSTagOut, CSTag>()));
|
||||
template <typename Strategy>
|
||||
static inline void apply(BoxOut& box,
|
||||
Point const& point,
|
||||
Strategy const& )
|
||||
{
|
||||
Strategy::apply(box, point);
|
||||
}
|
||||
};
|
||||
|
||||
template
|
||||
<
|
||||
typename BoxOut, typename Point,
|
||||
typename StrategyLess, typename StrategyGreater
|
||||
>
|
||||
struct expand
|
||||
<
|
||||
BoxOut, Point,
|
||||
StrategyLess, StrategyGreater,
|
||||
box_tag, point_tag,
|
||||
spherical_equatorial_tag, spherical_equatorial_tag
|
||||
> : detail::expand::point_loop_on_spheroid
|
||||
<
|
||||
StrategyLess, StrategyGreater, dimension<Point>::value
|
||||
>
|
||||
{};
|
||||
|
||||
template
|
||||
<
|
||||
typename BoxOut, typename Point,
|
||||
typename StrategyLess, typename StrategyGreater
|
||||
>
|
||||
struct expand
|
||||
<
|
||||
BoxOut, Point,
|
||||
StrategyLess, StrategyGreater,
|
||||
box_tag, point_tag,
|
||||
geographic_tag, geographic_tag
|
||||
> : detail::expand::point_loop_on_spheroid
|
||||
<
|
||||
StrategyLess, StrategyGreater, dimension<Point>::value
|
||||
>
|
||||
{};
|
||||
|
||||
|
||||
} // namespace dispatch
|
||||
|
||||
@@ -5,11 +5,12 @@
|
||||
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2014-2015 Samuel Debionne, Grenoble, France.
|
||||
|
||||
// This file was modified by Oracle on 2015, 2016.
|
||||
// Modifications copyright (c) 2015-2016, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2015, 2016, 2017, 2018.
|
||||
// Modifications copyright (c) 2015-2018, 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
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -18,111 +19,46 @@
|
||||
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_EXPAND_SEGMENT_HPP
|
||||
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_EXPAND_SEGMENT_HPP
|
||||
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/detail/envelope/box.hpp>
|
||||
#include <boost/geometry/algorithms/detail/envelope/range_of_boxes.hpp>
|
||||
#include <boost/geometry/algorithms/detail/envelope/segment.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/detail/expand/indexed.hpp>
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/dispatch/expand.hpp>
|
||||
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
// For backward compatibility
|
||||
#include <boost/geometry/strategies/cartesian/expand_segment.hpp>
|
||||
#include <boost/geometry/strategies/geographic/expand_segment.hpp>
|
||||
#include <boost/geometry/strategies/spherical/expand_segment.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
namespace detail { namespace expand
|
||||
{
|
||||
|
||||
struct 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
|
||||
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(p[0], p[1], mbrs[0], strategy);
|
||||
|
||||
// normalize the box
|
||||
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, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}} // namespace detail::expand
|
||||
#endif // DOXYGEN_NO_DETAIL
|
||||
|
||||
#ifndef DOXYGEN_NO_DISPATCH
|
||||
namespace dispatch
|
||||
{
|
||||
|
||||
template
|
||||
<
|
||||
typename Box, typename Segment,
|
||||
typename StrategyLess, typename StrategyGreater,
|
||||
typename CSTagOut, typename CSTag
|
||||
typename Box, typename Segment
|
||||
>
|
||||
struct expand
|
||||
<
|
||||
Box, Segment,
|
||||
StrategyLess, StrategyGreater,
|
||||
box_tag, segment_tag,
|
||||
CSTagOut, CSTag
|
||||
> : detail::expand::expand_indexed
|
||||
<
|
||||
0, dimension<Segment>::value, StrategyLess, StrategyGreater
|
||||
>
|
||||
box_tag, segment_tag
|
||||
>
|
||||
{
|
||||
BOOST_MPL_ASSERT_MSG((boost::is_same<CSTagOut, CSTag>::value),
|
||||
COORDINATE_SYSTEMS_MUST_BE_THE_SAME,
|
||||
(types<CSTagOut, CSTag>()));
|
||||
template <typename Strategy>
|
||||
static inline void apply(Box& box,
|
||||
Segment const& segment,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
boost::ignore_unused(strategy);
|
||||
strategy.apply(box, segment);
|
||||
}
|
||||
};
|
||||
|
||||
template
|
||||
<
|
||||
typename Box, typename Segment,
|
||||
typename StrategyLess, typename StrategyGreater
|
||||
>
|
||||
struct expand
|
||||
<
|
||||
Box, Segment,
|
||||
StrategyLess, StrategyGreater,
|
||||
box_tag, segment_tag,
|
||||
spherical_equatorial_tag, spherical_equatorial_tag
|
||||
> : 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
|
||||
|
||||
Reference in New Issue
Block a user