Skip to content

Commit 64844ce

Browse files
authored
Merge pull request #1205 from tinko92/fix/unused-access-hpp-in-overlay
Remove some access.hpp includes in overlay
2 parents 3f5c044 + b390a2c commit 64844ce

12 files changed

+22
-78
lines changed

include/boost/geometry/algorithms/detail/intersection/box_box.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
#include <boost/geometry/algorithms/detail/intersection/interface.hpp>
19-
#include <boost/geometry/algorithms/detail/overlay/intersection_box_box.hpp>
19+
#include <boost/geometry/algorithms/detail/intersection/box_box_implementation.hpp>
2020

2121

2222
namespace boost { namespace geometry

include/boost/geometry/algorithms/detail/overlay/intersection_box_box.hpp renamed to include/boost/geometry/algorithms/detail/intersection/box_box_implementation.hpp

+7-10
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@
1111
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
1212
// http://www.boost.org/LICENSE_1_0.txt)
1313

14-
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_INTERSECTION_BOX_BOX_HPP
15-
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_INTERSECTION_BOX_BOX_HPP
14+
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERSECTION_BOX_BOX_IMPLEMENTATION_HPP
15+
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERSECTION_BOX_BOX_IMPLEMENTATION_HPP
1616

1717

1818
#include <boost/geometry/core/access.hpp>
19-
#include <boost/geometry/core/coordinate_type.hpp>
2019

2120

2221
namespace boost { namespace geometry
@@ -42,18 +41,16 @@ struct intersection_box_box
4241
BoxOut& box_out,
4342
Strategy const& strategy)
4443
{
45-
typedef typename coordinate_type<BoxOut>::type ct;
46-
47-
ct max1 = get<max_corner, Dimension>(box1);
48-
ct min2 = get<min_corner, Dimension>(box2);
44+
auto max1 = get<max_corner, Dimension>(box1);
45+
auto min2 = get<min_corner, Dimension>(box2);
4946

5047
if (max1 < min2)
5148
{
5249
return false;
5350
}
5451

55-
ct max2 = get<max_corner, Dimension>(box2);
56-
ct min1 = get<min_corner, Dimension>(box1);
52+
auto max2 = get<max_corner, Dimension>(box2);
53+
auto min1 = get<min_corner, Dimension>(box1);
5754

5855
if (max2 < min1)
5956
{
@@ -93,4 +90,4 @@ struct intersection_box_box<DimensionCount, DimensionCount>
9390
}} // namespace boost::geometry
9491

9592

96-
#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_INTERSECTION_BOX_BOX_HPP
93+
#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERSECTION_BOX_BOX_IMPLEMENTATION_HPP

include/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <boost/range/end.hpp>
2121
#include <boost/range/value_type.hpp>
2222

23-
#include <boost/geometry/core/access.hpp>
2423
#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
2524
#include <boost/geometry/algorithms/detail/has_self_intersections.hpp>
2625
#if defined(BOOST_GEOMETRY_DEBUG_INTERSECTION) || defined(BOOST_GEOMETRY_OVERLAY_REPORT_WKT)

include/boost/geometry/algorithms/detail/overlay/cluster_exits.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
#include <boost/range/value_type.hpp>
2222

23-
#include <boost/geometry/core/access.hpp>
2423
#include <boost/geometry/core/assert.hpp>
2524
#include <boost/geometry/algorithms/detail/overlay/overlay_type.hpp>
2625
#include <boost/geometry/algorithms/detail/overlay/sort_by_side.hpp>

include/boost/geometry/algorithms/detail/overlay/get_turns.hpp

+9-59
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#include <boost/geometry/algorithms/detail/sections/section_functions.hpp>
4040
#include <boost/geometry/algorithms/detail/sections/sectionalize.hpp>
4141

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

672-
//bool first = true;
673-
674-
//char previous_side[2] = {0, 0};
675-
676671
signed_size_type index = 0;
677672

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

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

687-
/*if (first)
688-
{
689-
previous_side[0] = get_side<0>(box, *prev);
690-
previous_side[1] = get_side<1>(box, *prev);
691-
}
692-
693-
char current_side[2];
694-
current_side[0] = get_side<0>(box, *it);
695-
current_side[1] = get_side<1>(box, *it);
696-
697-
// There can NOT be intersections if
698-
// 1) EITHER the two points are lying on one side of the box (! 0 && the same)
699-
// 2) OR same in Y-direction
700-
// 3) OR all points are inside the box (0)
701-
if (! (
702-
(current_side[0] != 0 && current_side[0] == previous_side[0])
703-
|| (current_side[1] != 0 && current_side[1] == previous_side[1])
704-
|| (current_side[0] == 0
705-
&& current_side[1] == 0
706-
&& previous_side[0] == 0
707-
&& previous_side[1] == 0)
708-
)
709-
)*/
710-
if (true)
711-
{
712-
get_turns_with_box(seg_id, source_id2,
713-
view_unique_sub_range,
714-
box_points,
715-
intersection_strategy,
716-
robust_policy,
717-
turns,
718-
interrupt_policy);
719-
// Future performance enhancement:
720-
// return if told by the interrupt policy
721-
}
682+
get_turns_with_box(seg_id, source_id2,
683+
view_unique_sub_range,
684+
box_points,
685+
intersection_strategy,
686+
robust_policy,
687+
turns,
688+
interrupt_policy);
689+
// Future performance enhancement:
690+
// return if told by the interrupt policy
722691
}
723692
}
724693

725694
private:
726-
template<std::size_t Index, typename Point>
727-
static inline int get_side(Box const& box, Point const& point)
728-
{
729-
// Inside -> 0
730-
// Outside -> -1 (left/below) or 1 (right/above)
731-
// On border -> -2 (left/lower) or 2 (right/upper)
732-
// The only purpose of the value is to not be the same,
733-
// and to denote if it is inside (0)
734-
735-
typename coordinate_type<Point>::type const& c = get<Index>(point);
736-
typename coordinate_type<Box>::type const& left = get<min_corner, Index>(box);
737-
typename coordinate_type<Box>::type const& right = get<max_corner, Index>(box);
738-
739-
if (geometry::math::equals(c, left)) return -2;
740-
else if (geometry::math::equals(c, right)) return 2;
741-
else if (c < left) return -1;
742-
else if (c > right) return 1;
743-
else return 0;
744-
}
745695

746696
template
747697
<

include/boost/geometry/algorithms/detail/overlay/range_in_geometry.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414

1515
#include <boost/geometry/algorithms/detail/covered_by/implementation.hpp>
16-
#include <boost/geometry/core/access.hpp>
1716
#include <boost/geometry/core/tags.hpp>
1817
#include <boost/geometry/iterators/point_iterator.hpp>
1918

include/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <boost/geometry/algorithms/detail/overlay/get_turns.hpp>
2525
#include <boost/geometry/algorithms/detail/sections/section_box_policies.hpp>
2626

27-
#include <boost/geometry/core/access.hpp>
2827
#include <boost/geometry/core/coordinate_dimension.hpp>
2928
#include <boost/geometry/core/point_order.hpp>
3029
#include <boost/geometry/core/tags.hpp>

include/boost/geometry/algorithms/detail/overlay/traversal.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <boost/geometry/algorithms/detail/overlay/is_self_turn.hpp>
2727
#include <boost/geometry/algorithms/detail/overlay/sort_by_side.hpp>
2828
#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
29-
#include <boost/geometry/core/access.hpp>
3029
#include <boost/geometry/core/assert.hpp>
3130
#include <boost/geometry/util/condition.hpp>
3231

include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
2424
#include <boost/geometry/algorithms/detail/overlay/traversal.hpp>
2525
#include <boost/geometry/algorithms/num_points.hpp>
26-
#include <boost/geometry/core/access.hpp>
2726
#include <boost/geometry/core/assert.hpp>
2827
#include <boost/geometry/core/closure.hpp>
2928

include/boost/geometry/algorithms/detail/overlay/traversal_switch_detector.hpp

+4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@
2121
#include <boost/geometry/algorithms/detail/overlay/cluster_info.hpp>
2222
#include <boost/geometry/algorithms/detail/overlay/is_self_turn.hpp>
2323
#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
24+
25+
#if defined(BOOST_GEOMETRY_DEBUG_TRAVERSAL_SWITCH_DETECTOR)
2426
#include <boost/geometry/core/access.hpp>
27+
#endif
28+
2529
#include <boost/geometry/util/condition.hpp>
2630

2731
#include <cstddef>

include/boost/geometry/algorithms/detail/sections/range_by_section.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <boost/range/size.hpp>
2222
#include <boost/range/value_type.hpp>
2323

24-
#include <boost/geometry/core/access.hpp>
2524
#include <boost/geometry/core/assert.hpp>
2625
#include <boost/geometry/core/closure.hpp>
2726
#include <boost/geometry/core/exterior_ring.hpp>

include/boost/geometry/index/detail/algorithms/intersection_content.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_INTERSECTION_CONTENT_HPP
1717

1818
#include <boost/geometry/algorithms/detail/disjoint/box_box.hpp>
19-
#include <boost/geometry/algorithms/detail/overlay/intersection_box_box.hpp>
19+
#include <boost/geometry/algorithms/detail/intersection/box_box_implementation.hpp>
2020

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

0 commit comments

Comments
 (0)