1
1
/* ******************************************************************************
2
2
* Author : Angus Johnson *
3
- * Date : 27 April 2024 *
3
+ * Date : 17 September 2024 *
4
4
* Website : http://www.angusj.com *
5
5
* Copyright : Angus Johnson 2010-2024 *
6
6
* Purpose : This is the main polygon clipping module *
@@ -85,7 +85,7 @@ namespace Clipper2Lib {
85
85
inline bool IsOpenEnd (const Vertex& v)
86
86
{
87
87
return (v.flags & (VertexFlags::OpenStart | VertexFlags::OpenEnd)) !=
88
- VertexFlags::None ;
88
+ VertexFlags::Empty ;
89
89
}
90
90
91
91
@@ -220,7 +220,7 @@ namespace Clipper2Lib {
220
220
221
221
inline bool IsMaxima (const Vertex& v)
222
222
{
223
- return ((v.flags & VertexFlags::LocalMax) != VertexFlags::None );
223
+ return ((v.flags & VertexFlags::LocalMax) != VertexFlags::Empty );
224
224
}
225
225
226
226
@@ -235,12 +235,12 @@ namespace Clipper2Lib {
235
235
if (e.wind_dx > 0 )
236
236
while ((result->next ->pt .y == result->pt .y ) &&
237
237
((result->flags & (VertexFlags::OpenEnd |
238
- VertexFlags::LocalMax)) == VertexFlags::None ))
238
+ VertexFlags::LocalMax)) == VertexFlags::Empty ))
239
239
result = result->next ;
240
240
else
241
241
while (result->prev ->pt .y == result->pt .y &&
242
242
((result->flags & (VertexFlags::OpenEnd |
243
- VertexFlags::LocalMax)) == VertexFlags::None ))
243
+ VertexFlags::LocalMax)) == VertexFlags::Empty ))
244
244
result = result->prev ;
245
245
if (!IsMaxima (*result)) result = nullptr ; // not a maxima
246
246
return result;
@@ -478,7 +478,7 @@ namespace Clipper2Lib {
478
478
479
479
inline bool IsJoined (const Active& e)
480
480
{
481
- return e.join_with != JoinWith::None ;
481
+ return e.join_with != JoinWith::NoJoin ;
482
482
}
483
483
484
484
inline void SetOwner (OutRec* outrec, OutRec* new_owner)
@@ -608,7 +608,7 @@ namespace Clipper2Lib {
608
608
Vertex& vert, PathType polytype, bool is_open)
609
609
{
610
610
// make sure the vertex is added only once ...
611
- if ((VertexFlags::LocalMin & vert.flags ) != VertexFlags::None ) return ;
611
+ if ((VertexFlags::LocalMin & vert.flags ) != VertexFlags::Empty ) return ;
612
612
613
613
vert.flags = (vert.flags | VertexFlags::LocalMin);
614
614
list.push_back (std::make_unique <LocalMinima>(&vert, polytype, is_open));
@@ -643,7 +643,7 @@ namespace Clipper2Lib {
643
643
}
644
644
curr_v->prev = prev_v;
645
645
curr_v->pt = pt;
646
- curr_v->flags = VertexFlags::None ;
646
+ curr_v->flags = VertexFlags::Empty ;
647
647
prev_v = curr_v++;
648
648
cnt++;
649
649
}
@@ -725,7 +725,7 @@ namespace Clipper2Lib {
725
725
void ReuseableDataContainer64::AddLocMin (Vertex& vert, PathType polytype, bool is_open)
726
726
{
727
727
// make sure the vertex is added only once ...
728
- if ((VertexFlags::LocalMin & vert.flags ) != VertexFlags::None ) return ;
728
+ if ((VertexFlags::LocalMin & vert.flags ) != VertexFlags::Empty ) return ;
729
729
730
730
vert.flags = (vert.flags | VertexFlags::LocalMin);
731
731
minima_list_.push_back (std::make_unique <LocalMinima>(&vert, polytype, is_open));
@@ -907,7 +907,7 @@ namespace Clipper2Lib {
907
907
void ClipperBase::AddLocMin (Vertex& vert, PathType polytype, bool is_open)
908
908
{
909
909
// make sure the vertex is added only once ...
910
- if ((VertexFlags::LocalMin & vert.flags ) != VertexFlags::None ) return ;
910
+ if ((VertexFlags::LocalMin & vert.flags ) != VertexFlags::Empty ) return ;
911
911
912
912
vert.flags = (vert.flags | VertexFlags::LocalMin);
913
913
minima_list_.push_back (std::make_unique <LocalMinima>(&vert, polytype, is_open));
@@ -932,7 +932,7 @@ namespace Clipper2Lib {
932
932
933
933
switch (cliptype_)
934
934
{
935
- case ClipType::None :
935
+ case ClipType::NoClip :
936
936
return false ;
937
937
case ClipType::Intersection:
938
938
switch (fillrule_)
@@ -1208,7 +1208,7 @@ namespace Clipper2Lib {
1208
1208
1209
1209
while (PopLocalMinima (bot_y, local_minima))
1210
1210
{
1211
- if ((local_minima->vertex ->flags & VertexFlags::OpenStart) != VertexFlags::None )
1211
+ if ((local_minima->vertex ->flags & VertexFlags::OpenStart) != VertexFlags::Empty )
1212
1212
{
1213
1213
left_bound = nullptr ;
1214
1214
}
@@ -1224,7 +1224,7 @@ namespace Clipper2Lib {
1224
1224
SetDx (*left_bound);
1225
1225
}
1226
1226
1227
- if ((local_minima->vertex ->flags & VertexFlags::OpenEnd) != VertexFlags::None )
1227
+ if ((local_minima->vertex ->flags & VertexFlags::OpenEnd) != VertexFlags::Empty )
1228
1228
{
1229
1229
right_bound = nullptr ;
1230
1230
}
@@ -2125,7 +2125,7 @@ namespace Clipper2Lib {
2125
2125
using_polytree_ = use_polytrees;
2126
2126
Reset ();
2127
2127
int64_t y;
2128
- if (ct == ClipType::None || !PopScanline (y)) return true ;
2128
+ if (ct == ClipType::NoClip || !PopScanline (y)) return true ;
2129
2129
2130
2130
while (succeeded_)
2131
2131
{
@@ -2789,14 +2789,14 @@ namespace Clipper2Lib {
2789
2789
{
2790
2790
if (e.join_with == JoinWith::Right)
2791
2791
{
2792
- e.join_with = JoinWith::None ;
2793
- e.next_in_ael ->join_with = JoinWith::None ;
2792
+ e.join_with = JoinWith::NoJoin ;
2793
+ e.next_in_ael ->join_with = JoinWith::NoJoin ;
2794
2794
AddLocalMinPoly (e, *e.next_in_ael , pt, true );
2795
2795
}
2796
2796
else
2797
2797
{
2798
- e.join_with = JoinWith::None ;
2799
- e.prev_in_ael ->join_with = JoinWith::None ;
2798
+ e.join_with = JoinWith::NoJoin ;
2799
+ e.prev_in_ael ->join_with = JoinWith::NoJoin ;
2800
2800
AddLocalMinPoly (*e.prev_in_ael , e, pt, true );
2801
2801
}
2802
2802
}
0 commit comments