File tree Expand file tree Collapse file tree 4 files changed +17
-37
lines changed
algorithms/detail/overlay Expand file tree Collapse file tree 4 files changed +17
-37
lines changed Original file line number Diff line number Diff line change @@ -236,7 +236,23 @@ struct traversal
236
236
segment_identifier const & current,
237
237
segment_identifier const & previous) const
238
238
{
239
- return turn.switch_source
239
+ turn_operation_type const & op0 = turn.operations [0 ];
240
+ turn_operation_type const & op1 = turn.operations [1 ];
241
+
242
+ bool const switch_source = op0.enriched .region_id != -1
243
+ && op0.enriched .region_id == op1.enriched .region_id ;
244
+
245
+ #if defined(BOOST_GEOMETRY_DEBUG_TRAVERSAL_SWITCH_DETECTOR)
246
+ if (switch_source)
247
+ {
248
+ std::cout << " Switch source at " << &turn << std::endl;
249
+ }
250
+ else
251
+ {
252
+ std::cout << " DON'T SWITCH SOURCES at " << &turn << std::endl;
253
+ }
254
+ #endif
255
+ return switch_source
240
256
? current.*Member != previous.*Member
241
257
: current.*Member == previous.*Member;
242
258
}
@@ -247,16 +263,6 @@ struct traversal
247
263
{
248
264
// For uu/ii, only switch sources if indicated
249
265
250
- #if defined(BOOST_GEOMETRY_DEBUG_TRAVERSAL_SWITCH_DETECTOR)
251
- if (turn.switch_source )
252
- {
253
- std::cout << " Switch source at " << turn_index << std::endl;
254
- }
255
- else
256
- {
257
- std::cout << " DON'T SWITCH SOURCES at " << turn_index << std::endl;
258
- }
259
- #endif
260
266
if (OverlayType == overlay_buffer
261
267
|| OverlayType == overlay_dissolve_union)
262
268
{
Original file line number Diff line number Diff line change @@ -611,29 +611,6 @@ struct traversal_switch_detector
611
611
}
612
612
}
613
613
614
- // Iterate through all uu/ii turns (non-clustered)
615
- for (std::size_t turn_index = 0 ; turn_index < m_turns.size (); ++turn_index)
616
- {
617
- turn_type& turn = m_turns[turn_index];
618
-
619
- if (turn.discarded
620
- || turn.blocked ()
621
- || turn.is_clustered ()
622
- || ! (turn.both (operation_union) || turn.both (operation_intersection)))
623
- {
624
- // Skip discarded, blocked, non-uu/ii and clustered turns
625
- continue ;
626
- }
627
-
628
-
629
- signed_size_type const region0 = get_region_id (turn.operations [0 ]);
630
- signed_size_type const region1 = get_region_id (turn.operations [1 ]);
631
-
632
- // Switch sources for same region
633
- turn.switch_source = region0 == region1;
634
- }
635
-
636
-
637
614
#if defined(BOOST_GEOMETRY_DEBUG_TRAVERSAL_SWITCH_DETECTOR)
638
615
std::cout << " SWITCH END ITERATION" << std::endl;
639
616
Original file line number Diff line number Diff line change @@ -94,7 +94,6 @@ struct turn_info
94
94
bool discarded;
95
95
96
96
bool has_colocated_both; // Colocated with a uu turn (for union) or ii (other)
97
- bool switch_source; // For u/u turns which can either switch or not
98
97
99
98
Container operations;
100
99
@@ -104,7 +103,6 @@ struct turn_info
104
103
, cluster_id(-1 )
105
104
, discarded(false )
106
105
, has_colocated_both(false )
107
- , switch_source(false )
108
106
{}
109
107
110
108
inline bool both (operation_type type) const
Original file line number Diff line number Diff line change @@ -127,7 +127,6 @@ struct dissolve_ring_or_polygon
127
127
turn.discarded = false ;
128
128
turn.cluster_id = -1 ;
129
129
turn.has_colocated_both = false ;
130
- turn.switch_source = false ;
131
130
turn.touch_only = false ;
132
131
}
133
132
You can’t perform that action at this time.
0 commit comments