Skip to content

Commit

Permalink
Merge pull request #1205 from tinko92/fix/unused-access-hpp-in-overlay
Browse files Browse the repository at this point in the history
Remove some access.hpp includes in overlay
  • Loading branch information
vissarion authored Dec 1, 2023
2 parents 3f5c044 + b390a2c commit 64844ce
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


#include <boost/geometry/algorithms/detail/intersection/interface.hpp>
#include <boost/geometry/algorithms/detail/overlay/intersection_box_box.hpp>
#include <boost/geometry/algorithms/detail/intersection/box_box_implementation.hpp>


namespace boost { namespace geometry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
// 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_OVERLAY_INTERSECTION_BOX_BOX_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_INTERSECTION_BOX_BOX_HPP
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERSECTION_BOX_BOX_IMPLEMENTATION_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERSECTION_BOX_BOX_IMPLEMENTATION_HPP


#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/coordinate_type.hpp>


namespace boost { namespace geometry
Expand All @@ -42,18 +41,16 @@ struct intersection_box_box
BoxOut& box_out,
Strategy const& strategy)
{
typedef typename coordinate_type<BoxOut>::type ct;

ct max1 = get<max_corner, Dimension>(box1);
ct min2 = get<min_corner, Dimension>(box2);
auto max1 = get<max_corner, Dimension>(box1);
auto min2 = get<min_corner, Dimension>(box2);

if (max1 < min2)
{
return false;
}

ct max2 = get<max_corner, Dimension>(box2);
ct min1 = get<min_corner, Dimension>(box1);
auto max2 = get<max_corner, Dimension>(box2);
auto min1 = get<min_corner, Dimension>(box1);

if (max2 < min1)
{
Expand Down Expand Up @@ -93,4 +90,4 @@ struct intersection_box_box<DimensionCount, DimensionCount>
}} // namespace boost::geometry


#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_INTERSECTION_BOX_BOX_HPP
#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERSECTION_BOX_BOX_IMPLEMENTATION_HPP
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <boost/range/end.hpp>
#include <boost/range/value_type.hpp>

#include <boost/geometry/core/access.hpp>
#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
#include <boost/geometry/algorithms/detail/has_self_intersections.hpp>
#if defined(BOOST_GEOMETRY_DEBUG_INTERSECTION) || defined(BOOST_GEOMETRY_OVERLAY_REPORT_WKT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

#include <boost/range/value_type.hpp>

#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/assert.hpp>
#include <boost/geometry/algorithms/detail/overlay/overlay_type.hpp>
#include <boost/geometry/algorithms/detail/overlay/sort_by_side.hpp>
Expand Down
68 changes: 9 additions & 59 deletions include/boost/geometry/algorithms/detail/overlay/get_turns.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include <boost/geometry/algorithms/detail/sections/section_functions.hpp>
#include <boost/geometry/algorithms/detail/sections/sectionalize.hpp>

#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/assert.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
Expand Down Expand Up @@ -669,10 +668,6 @@ struct get_turns_cs
// into account (not in the iterator, nor in the retrieve policy)
iterator_type it = boost::begin(view);

//bool first = true;

//char previous_side[2] = {0, 0};

signed_size_type index = 0;

for (iterator_type prev = it++;
Expand All @@ -684,64 +679,19 @@ struct get_turns_cs

unique_sub_range_from_view_policy view_unique_sub_range(view, *prev, *it, it);

/*if (first)
{
previous_side[0] = get_side<0>(box, *prev);
previous_side[1] = get_side<1>(box, *prev);
}
char current_side[2];
current_side[0] = get_side<0>(box, *it);
current_side[1] = get_side<1>(box, *it);
// There can NOT be intersections if
// 1) EITHER the two points are lying on one side of the box (! 0 && the same)
// 2) OR same in Y-direction
// 3) OR all points are inside the box (0)
if (! (
(current_side[0] != 0 && current_side[0] == previous_side[0])
|| (current_side[1] != 0 && current_side[1] == previous_side[1])
|| (current_side[0] == 0
&& current_side[1] == 0
&& previous_side[0] == 0
&& previous_side[1] == 0)
)
)*/
if (true)
{
get_turns_with_box(seg_id, source_id2,
view_unique_sub_range,
box_points,
intersection_strategy,
robust_policy,
turns,
interrupt_policy);
// Future performance enhancement:
// return if told by the interrupt policy
}
get_turns_with_box(seg_id, source_id2,
view_unique_sub_range,
box_points,
intersection_strategy,
robust_policy,
turns,
interrupt_policy);
// Future performance enhancement:
// return if told by the interrupt policy
}
}

private:
template<std::size_t Index, typename Point>
static inline int get_side(Box const& box, Point const& point)
{
// Inside -> 0
// Outside -> -1 (left/below) or 1 (right/above)
// On border -> -2 (left/lower) or 2 (right/upper)
// The only purpose of the value is to not be the same,
// and to denote if it is inside (0)

typename coordinate_type<Point>::type const& c = get<Index>(point);
typename coordinate_type<Box>::type const& left = get<min_corner, Index>(box);
typename coordinate_type<Box>::type const& right = get<max_corner, Index>(box);

if (geometry::math::equals(c, left)) return -2;
else if (geometry::math::equals(c, right)) return 2;
else if (c < left) return -1;
else if (c > right) return 1;
else return 0;
}

template
<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@


#include <boost/geometry/algorithms/detail/covered_by/implementation.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/iterators/point_iterator.hpp>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <boost/geometry/algorithms/detail/overlay/get_turns.hpp>
#include <boost/geometry/algorithms/detail/sections/section_box_policies.hpp>

#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
#include <boost/geometry/core/point_order.hpp>
#include <boost/geometry/core/tags.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <boost/geometry/algorithms/detail/overlay/is_self_turn.hpp>
#include <boost/geometry/algorithms/detail/overlay/sort_by_side.hpp>
#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/assert.hpp>
#include <boost/geometry/util/condition.hpp>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
#include <boost/geometry/algorithms/detail/overlay/traversal.hpp>
#include <boost/geometry/algorithms/num_points.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/assert.hpp>
#include <boost/geometry/core/closure.hpp>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
#include <boost/geometry/algorithms/detail/overlay/cluster_info.hpp>
#include <boost/geometry/algorithms/detail/overlay/is_self_turn.hpp>
#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>

#if defined(BOOST_GEOMETRY_DEBUG_TRAVERSAL_SWITCH_DETECTOR)
#include <boost/geometry/core/access.hpp>
#endif

#include <boost/geometry/util/condition.hpp>

#include <cstddef>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <boost/range/size.hpp>
#include <boost/range/value_type.hpp>

#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/assert.hpp>
#include <boost/geometry/core/closure.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_INTERSECTION_CONTENT_HPP

#include <boost/geometry/algorithms/detail/disjoint/box_box.hpp>
#include <boost/geometry/algorithms/detail/overlay/intersection_box_box.hpp>
#include <boost/geometry/algorithms/detail/intersection/box_box_implementation.hpp>

#include <boost/geometry/index/detail/algorithms/content.hpp>

Expand Down

0 comments on commit 64844ce

Please sign in to comment.