summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-05-19 09:05:52 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-05-31 10:15:18 -0700
commit58a9ca80423a0430804b0cbf3b25a550086f4f29 (patch)
treefcd5b56e6f28cb78b72984661043dbf006dc2eb3
parentf2427c8066ff633edf011fae370e1f4d3a771880 (diff)
downloadqtlocation-mapboxgl-58a9ca80423a0430804b0cbf3b25a550086f4f29.tar.gz
[core] Run fix_members.sh on clipper code
https://github.com/mapnik/clipper/blob/r496-mapnik/cpp/fix_members.sh
-rw-r--r--src/clipper/clipper.cpp828
-rw-r--r--src/clipper/clipper.hpp20
-rwxr-xr-xsrc/clipper/fix_members.sh24
3 files changed, 448 insertions, 424 deletions
diff --git a/src/clipper/clipper.cpp b/src/clipper/clipper.cpp
index 0a99b5f350..5f4ac4d481 100644
--- a/src/clipper/clipper.cpp
+++ b/src/clipper/clipper.cpp
@@ -91,7 +91,7 @@ struct IntersectNode {
};
struct LocalMinimum {
- cInt Y;
+ cInt y;
TEdge *LeftBound;
TEdge *RightBound;
};
@@ -127,7 +127,7 @@ struct LocMinSorter
{
inline bool operator()(const LocalMinimum& locMin1, const LocalMinimum& locMin2)
{
- return locMin2.Y < locMin1.Y;
+ return locMin2.y < locMin1.y;
}
};
@@ -397,7 +397,7 @@ double Area(const Path &poly)
double a = 0;
for (int i = 0, j = size -1; i < size; ++i)
{
- a += ((double)poly[j].X + poly[i].X) * ((double)poly[j].Y - poly[i].Y);
+ a += ((double)poly[j].x + poly[i].x) * ((double)poly[j].y - poly[i].y);
j = i;
}
return -a * 0.5;
@@ -410,7 +410,7 @@ double Area(const OutPt *op)
if (!op) return 0;
double a = 0;
do {
- a += (double)(op->Prev->Pt.X + op->Pt.X) * (double)(op->Prev->Pt.Y - op->Pt.Y);
+ a += (double)(op->Prev->Pt.x + op->Pt.x) * (double)(op->Prev->Pt.y - op->Pt.y);
op = op->Next;
} while (op != startOp);
return a * 0.5;
@@ -448,31 +448,31 @@ int PointInPolygon(const IntPoint &pt, const Path &path)
for(size_t i = 1; i <= cnt; ++i)
{
IntPoint ipNext = (i == cnt ? path[0] : path[i]);
- if (ipNext.Y == pt.Y)
+ if (ipNext.y == pt.y)
{
- if ((ipNext.X == pt.X) || (ip.Y == pt.Y &&
- ((ipNext.X > pt.X) == (ip.X < pt.X)))) return -1;
+ if ((ipNext.x == pt.x) || (ip.y == pt.y &&
+ ((ipNext.x > pt.x) == (ip.x < pt.x)))) return -1;
}
- if ((ip.Y < pt.Y) != (ipNext.Y < pt.Y))
+ if ((ip.y < pt.y) != (ipNext.y < pt.y))
{
- if (ip.X >= pt.X)
+ if (ip.x >= pt.x)
{
- if (ipNext.X > pt.X) result = 1 - result;
+ if (ipNext.x > pt.x) result = 1 - result;
else
{
- double d = (double)(ip.X - pt.X) * (ipNext.Y - pt.Y) -
- (double)(ipNext.X - pt.X) * (ip.Y - pt.Y);
+ double d = (double)(ip.x - pt.x) * (ipNext.y - pt.y) -
+ (double)(ipNext.x - pt.x) * (ip.y - pt.y);
if (!d) return -1;
- if ((d > 0) == (ipNext.Y > ip.Y)) result = 1 - result;
+ if ((d > 0) == (ipNext.y > ip.y)) result = 1 - result;
}
} else
{
- if (ipNext.X > pt.X)
+ if (ipNext.x > pt.x)
{
- double d = (double)(ip.X - pt.X) * (ipNext.Y - pt.Y) -
- (double)(ipNext.X - pt.X) * (ip.Y - pt.Y);
+ double d = (double)(ip.x - pt.x) * (ipNext.y - pt.y) -
+ (double)(ipNext.x - pt.x) * (ip.y - pt.y);
if (!d) return -1;
- if ((d > 0) == (ipNext.Y > ip.Y)) result = 1 - result;
+ if ((d > 0) == (ipNext.y > ip.y)) result = 1 - result;
}
}
}
@@ -489,31 +489,31 @@ int PointInPolygon (const IntPoint &pt, OutPt *op)
OutPt* startOp = op;
for(;;)
{
- if (op->Next->Pt.Y == pt.Y)
+ if (op->Next->Pt.y == pt.y)
{
- if ((op->Next->Pt.X == pt.X) || (op->Pt.Y == pt.Y &&
- ((op->Next->Pt.X > pt.X) == (op->Pt.X < pt.X)))) return -1;
+ if ((op->Next->Pt.x == pt.x) || (op->Pt.y == pt.y &&
+ ((op->Next->Pt.x > pt.x) == (op->Pt.x < pt.x)))) return -1;
}
- if ((op->Pt.Y < pt.Y) != (op->Next->Pt.Y < pt.Y))
+ if ((op->Pt.y < pt.y) != (op->Next->Pt.y < pt.y))
{
- if (op->Pt.X >= pt.X)
+ if (op->Pt.x >= pt.x)
{
- if (op->Next->Pt.X > pt.X) result = 1 - result;
+ if (op->Next->Pt.x > pt.x) result = 1 - result;
else
{
- double d = (double)(op->Pt.X - pt.X) * (op->Next->Pt.Y - pt.Y) -
- (double)(op->Next->Pt.X - pt.X) * (op->Pt.Y - pt.Y);
+ double d = (double)(op->Pt.x - pt.x) * (op->Next->Pt.y - pt.y) -
+ (double)(op->Next->Pt.x - pt.x) * (op->Pt.y - pt.y);
if (!d) return -1;
- if ((d > 0) == (op->Next->Pt.Y > op->Pt.Y)) result = 1 - result;
+ if ((d > 0) == (op->Next->Pt.y > op->Pt.y)) result = 1 - result;
}
} else
{
- if (op->Next->Pt.X > pt.X)
+ if (op->Next->Pt.x > pt.x)
{
- double d = (double)(op->Pt.X - pt.X) * (op->Next->Pt.Y - pt.Y) -
- (double)(op->Next->Pt.X - pt.X) * (op->Pt.Y - pt.Y);
+ double d = (double)(op->Pt.x - pt.x) * (op->Next->Pt.y - pt.y) -
+ (double)(op->Next->Pt.x - pt.x) * (op->Pt.y - pt.y);
if (!d) return -1;
- if ((d > 0) == (op->Next->Pt.Y > op->Pt.Y)) result = 1 - result;
+ if ((d > 0) == (op->Next->Pt.y > op->Pt.y)) result = 1 - result;
}
}
}
@@ -543,12 +543,12 @@ bool SlopesEqual(const TEdge &e1, const TEdge &e2, bool UseFullInt64Range)
{
#ifndef use_int32
if (UseFullInt64Range)
- return Int128Mul(e1.Top.Y - e1.Bot.Y, e2.Top.X - e2.Bot.X) ==
- Int128Mul(e1.Top.X - e1.Bot.X, e2.Top.Y - e2.Bot.Y);
+ return Int128Mul(e1.Top.y - e1.Bot.y, e2.Top.x - e2.Bot.x) ==
+ Int128Mul(e1.Top.x - e1.Bot.x, e2.Top.y - e2.Bot.y);
else
#endif
- return (e1.Top.Y - e1.Bot.Y) * (e2.Top.X - e2.Bot.X) ==
- (e1.Top.X - e1.Bot.X) * (e2.Top.Y - e2.Bot.Y);
+ return (e1.Top.y - e1.Bot.y) * (e2.Top.x - e2.Bot.x) ==
+ (e1.Top.x - e1.Bot.x) * (e2.Top.y - e2.Bot.y);
}
//------------------------------------------------------------------------------
@@ -557,10 +557,10 @@ bool SlopesEqual(const IntPoint pt1, const IntPoint pt2,
{
#ifndef use_int32
if (UseFullInt64Range)
- return Int128Mul(pt1.Y-pt2.Y, pt2.X-pt3.X) == Int128Mul(pt1.X-pt2.X, pt2.Y-pt3.Y);
+ return Int128Mul(pt1.y-pt2.y, pt2.x-pt3.x) == Int128Mul(pt1.x-pt2.x, pt2.y-pt3.y);
else
#endif
- return (pt1.Y-pt2.Y)*(pt2.X-pt3.X) == (pt1.X-pt2.X)*(pt2.Y-pt3.Y);
+ return (pt1.y-pt2.y)*(pt2.x-pt3.x) == (pt1.x-pt2.x)*(pt2.y-pt3.y);
}
//------------------------------------------------------------------------------
@@ -569,10 +569,10 @@ bool SlopesEqual(const IntPoint pt1, const IntPoint pt2,
{
#ifndef use_int32
if (UseFullInt64Range)
- return Int128Mul(pt1.Y-pt2.Y, pt3.X-pt4.X) == Int128Mul(pt1.X-pt2.X, pt3.Y-pt4.Y);
+ return Int128Mul(pt1.y-pt2.y, pt3.x-pt4.x) == Int128Mul(pt1.x-pt2.x, pt3.y-pt4.y);
else
#endif
- return (pt1.Y-pt2.Y)*(pt3.X-pt4.X) == (pt1.X-pt2.X)*(pt3.Y-pt4.Y);
+ return (pt1.y-pt2.y)*(pt3.x-pt4.x) == (pt1.x-pt2.x)*(pt3.y-pt4.y);
}
//------------------------------------------------------------------------------
@@ -584,16 +584,16 @@ inline bool IsHorizontal(TEdge &e)
inline double GetDx(const IntPoint pt1, const IntPoint pt2)
{
- return (pt1.Y == pt2.Y) ?
- HORIZONTAL : (double)(pt2.X - pt1.X) / (pt2.Y - pt1.Y);
+ return (pt1.y == pt2.y) ?
+ HORIZONTAL : (double)(pt2.x - pt1.x) / (pt2.y - pt1.y);
}
//---------------------------------------------------------------------------
inline void SetDx(TEdge &e)
{
- cInt dy = (e.Top.Y - e.Bot.Y);
+ cInt dy = (e.Top.y - e.Bot.y);
if (dy == 0) e.Dx = HORIZONTAL;
- else e.Dx = (double)(e.Top.X - e.Bot.X) / dy;
+ else e.Dx = (double)(e.Top.x - e.Bot.x) / dy;
}
//---------------------------------------------------------------------------
@@ -615,8 +615,8 @@ inline void SwapPolyIndexes(TEdge &Edge1, TEdge &Edge2)
inline cInt TopX(TEdge &edge, const cInt currentY)
{
- return ( currentY == edge.Top.Y ) ?
- edge.Top.X : edge.Bot.X + Round(edge.Dx *(currentY - edge.Bot.Y));
+ return ( currentY == edge.Top.y ) ?
+ edge.Top.x : edge.Bot.x + Round(edge.Dx *(currentY - edge.Bot.y));
}
//------------------------------------------------------------------------------
@@ -629,288 +629,288 @@ void IntersectPoint(TEdge &Edge1, TEdge &Edge2, IntPoint &ip)
double b1, b2;
if (Edge1.Dx == Edge2.Dx)
{
- ip.Y = Edge1.Curr.Y;
- ip.X = TopX(Edge1, ip.Y);
+ ip.y = Edge1.Curr.y;
+ ip.x = TopX(Edge1, ip.y);
return;
}
else if (Edge1.Dx == 0.0)
{
- ip.X = Edge1.Bot.X;
+ ip.x = Edge1.Bot.x;
if (IsHorizontal(Edge2))
- ip.Y = Edge2.Bot.Y;
+ ip.y = Edge2.Bot.y;
else
{
- b2 = Edge2.Bot.Y - (Edge2.Bot.X / Edge2.Dx);
- if (Edge2.Bot.X == Edge1.Bot.X) ip.Y = Round(ip.X / Edge2.Dx + b2);
- else if (Edge2.Bot.X < Edge1.Bot.X) ip.Y = Round((ip.X - 0.5) / Edge2.Dx + b2);
- else ip.Y = Round((ip.X + 0.5) / Edge2.Dx + b2);
+ b2 = Edge2.Bot.y - (Edge2.Bot.x / Edge2.Dx);
+ if (Edge2.Bot.x == Edge1.Bot.x) ip.y = Round(ip.x / Edge2.Dx + b2);
+ else if (Edge2.Bot.x < Edge1.Bot.x) ip.y = Round((ip.x - 0.5) / Edge2.Dx + b2);
+ else ip.y = Round((ip.x + 0.5) / Edge2.Dx + b2);
}
}
else if (Edge2.Dx == 0.0)
{
- ip.X = Edge2.Bot.X;
+ ip.x = Edge2.Bot.x;
if (IsHorizontal(Edge1))
- ip.Y = Edge1.Bot.Y;
+ ip.y = Edge1.Bot.y;
else
{
- b1 = Edge1.Bot.Y - (Edge1.Bot.X / Edge1.Dx);
- if (Edge1.Bot.X == Edge2.Bot.X) ip.Y = Round(ip.X / Edge1.Dx + b1);
- else if (Edge1.Bot.X < Edge2.Bot.X) ip.Y = Round((ip.X - 0.5) / Edge1.Dx + b1);
- else ip.Y = Round((ip.X + 0.5) / Edge1.Dx + b1);
+ b1 = Edge1.Bot.y - (Edge1.Bot.x / Edge1.Dx);
+ if (Edge1.Bot.x == Edge2.Bot.x) ip.y = Round(ip.x / Edge1.Dx + b1);
+ else if (Edge1.Bot.x < Edge2.Bot.x) ip.y = Round((ip.x - 0.5) / Edge1.Dx + b1);
+ else ip.y = Round((ip.x + 0.5) / Edge1.Dx + b1);
}
}
else
{
- b1 = Edge1.Bot.X - Edge1.Bot.Y * Edge1.Dx;
- b2 = Edge2.Bot.X - Edge2.Bot.Y * Edge2.Dx;
+ b1 = Edge1.Bot.x - Edge1.Bot.y * Edge1.Dx;
+ b2 = Edge2.Bot.x - Edge2.Bot.y * Edge2.Dx;
double q = (b2-b1) / (Edge1.Dx - Edge2.Dx);
- ip.Y = Round(q);
+ ip.y = Round(q);
if (std::fabs(Edge1.Dx) < std::fabs(Edge2.Dx))
- ip.X = Round(Edge1.Dx * q + b1);
+ ip.x = Round(Edge1.Dx * q + b1);
else
- ip.X = Round(Edge2.Dx * q + b2);
+ ip.x = Round(Edge2.Dx * q + b2);
// the idea is simply to looking closer
// towards the origins of the lines (Edge1.Bot and Edge2.Bot)
// until we do not find pixels that both lines travel through
bool keep_searching = false;
- double by1 = Edge1.Bot.Y - (Edge1.Bot.X / Edge1.Dx);
- double by2 = Edge2.Bot.Y - (Edge2.Bot.X / Edge2.Dx);
- double bx1 = Edge1.Bot.X - (Edge1.Bot.Y * Edge1.Dx);
- double bx2 = Edge2.Bot.X - (Edge2.Bot.Y * Edge2.Dx);
+ double by1 = Edge1.Bot.y - (Edge1.Bot.x / Edge1.Dx);
+ double by2 = Edge2.Bot.y - (Edge2.Bot.x / Edge2.Dx);
+ double bx1 = Edge1.Bot.x - (Edge1.Bot.y * Edge1.Dx);
+ double bx2 = Edge2.Bot.x - (Edge2.Bot.y * Edge2.Dx);
do
{
keep_searching = false;
- cInt y1 = ip.Y;
- cInt y2 = ip.Y;
- if (Edge1.Bot.X > ip.X)
+ cInt y1 = ip.y;
+ cInt y2 = ip.y;
+ if (Edge1.Bot.x > ip.x)
{
- if (Edge1.Bot.Y >= ip.Y)
+ if (Edge1.Bot.y >= ip.y)
{
- y1 = std::floor(((ip.X + 0.5) / Edge1.Dx + by1) + 0.5);
+ y1 = std::floor(((ip.x + 0.5) / Edge1.Dx + by1) + 0.5);
}
else
{
- y1 = std::ceil(((ip.X + 0.5) / Edge1.Dx + by1) - 0.5);
+ y1 = std::ceil(((ip.x + 0.5) / Edge1.Dx + by1) - 0.5);
}
}
- else if (Edge1.Bot.X < ip.X)
+ else if (Edge1.Bot.x < ip.x)
{
- if (Edge1.Bot.Y >= ip.Y)
+ if (Edge1.Bot.y >= ip.y)
{
- y1 = std::floor(((ip.X - 0.5) / Edge1.Dx + by1) + 0.5);
+ y1 = std::floor(((ip.x - 0.5) / Edge1.Dx + by1) + 0.5);
}
else
{
- y1 = std::ceil(((ip.X - 0.5) / Edge1.Dx + by1) - 0.5);
+ y1 = std::ceil(((ip.x - 0.5) / Edge1.Dx + by1) - 0.5);
}
}
- else if (Edge1.Bot.Y > ip.Y)
+ else if (Edge1.Bot.y > ip.y)
{
- if (Edge2.Bot.Y >= Edge1.Bot.Y)
+ if (Edge2.Bot.y >= Edge1.Bot.y)
{
- y1 = Edge1.Bot.Y;
+ y1 = Edge1.Bot.y;
}
else
{
- y1 = Edge2.Bot.Y;
+ y1 = Edge2.Bot.y;
}
}
- else if (Edge1.Bot.Y < ip.Y)
+ else if (Edge1.Bot.y < ip.y)
{
- if (Edge2.Bot.Y <= Edge1.Bot.Y)
+ if (Edge2.Bot.y <= Edge1.Bot.y)
{
- y1 = Edge1.Bot.Y;
+ y1 = Edge1.Bot.y;
}
else
{
- y1 = Edge2.Bot.Y;
+ y1 = Edge2.Bot.y;
}
}
- if (ip.Y >= Edge1.Bot.Y && y1 < Edge1.Bot.Y) y1 = Edge1.Bot.Y;
- else if (ip.Y <= Edge1.Bot.Y && y1 > Edge1.Bot.Y) y1 = Edge1.Bot.Y;
- if (Edge2.Bot.X > ip.X)
+ if (ip.y >= Edge1.Bot.y && y1 < Edge1.Bot.y) y1 = Edge1.Bot.y;
+ else if (ip.y <= Edge1.Bot.y && y1 > Edge1.Bot.y) y1 = Edge1.Bot.y;
+ if (Edge2.Bot.x > ip.x)
{
- if (Edge2.Bot.Y >= ip.Y)
+ if (Edge2.Bot.y >= ip.y)
{
- y2 = std::floor(((ip.X + 0.5) / Edge2.Dx + by2) + 0.5);
+ y2 = std::floor(((ip.x + 0.5) / Edge2.Dx + by2) + 0.5);
}
else
{
- y2 = std::ceil(((ip.X + 0.5) / Edge2.Dx + by2) - 0.5);
+ y2 = std::ceil(((ip.x + 0.5) / Edge2.Dx + by2) - 0.5);
}
}
- else if (Edge2.Bot.X < ip.X)
+ else if (Edge2.Bot.x < ip.x)
{
- if (Edge2.Bot.Y >= ip.Y)
+ if (Edge2.Bot.y >= ip.y)
{
- y2 = std::floor(((ip.X - 0.5) / Edge2.Dx + by2) + 0.5);
+ y2 = std::floor(((ip.x - 0.5) / Edge2.Dx + by2) + 0.5);
}
else
{
- y2 = std::ceil(((ip.X - 0.5) / Edge2.Dx + by2) - 0.5);
+ y2 = std::ceil(((ip.x - 0.5) / Edge2.Dx + by2) - 0.5);
}
}
- else if (Edge2.Bot.Y > ip.Y)
+ else if (Edge2.Bot.y > ip.y)
{
- if (Edge1.Bot.Y >= Edge2.Bot.Y)
+ if (Edge1.Bot.y >= Edge2.Bot.y)
{
- y2 = Edge2.Bot.Y;
+ y2 = Edge2.Bot.y;
}
else
{
- y2 = Edge1.Bot.Y;
+ y2 = Edge1.Bot.y;
}
}
- else if (Edge2.Bot.Y < ip.Y)
+ else if (Edge2.Bot.y < ip.y)
{
- if (Edge1.Bot.Y <= Edge2.Bot.Y)
+ if (Edge1.Bot.y <= Edge2.Bot.y)
{
- y2 = Edge2.Bot.Y;
+ y2 = Edge2.Bot.y;
}
else
{
- y2 = Edge1.Bot.Y;
+ y2 = Edge1.Bot.y;
}
}
- if (ip.Y >= Edge2.Bot.Y && y2 < Edge2.Bot.Y) y2 = Edge2.Bot.Y;
- else if (ip.Y <= Edge2.Bot.Y && y2 > Edge2.Bot.Y) y2 = Edge2.Bot.Y;
- cInt x1 = ip.X;
- cInt x2 = ip.X;
- if (Edge1.Bot.Y > ip.Y)
+ if (ip.y >= Edge2.Bot.y && y2 < Edge2.Bot.y) y2 = Edge2.Bot.y;
+ else if (ip.y <= Edge2.Bot.y && y2 > Edge2.Bot.y) y2 = Edge2.Bot.y;
+ cInt x1 = ip.x;
+ cInt x2 = ip.x;
+ if (Edge1.Bot.y > ip.y)
{
- if (Edge1.Bot.X >= ip.X)
+ if (Edge1.Bot.x >= ip.x)
{
- x1 = std::floor(((ip.Y + 0.5) * Edge1.Dx + bx1) + 0.5);
+ x1 = std::floor(((ip.y + 0.5) * Edge1.Dx + bx1) + 0.5);
}
else
{
- x1 = std::ceil(((ip.Y + 0.5) * Edge1.Dx + bx1) - 0.5);
+ x1 = std::ceil(((ip.y + 0.5) * Edge1.Dx + bx1) - 0.5);
}
}
- else if (Edge1.Bot.Y < ip.Y)
+ else if (Edge1.Bot.y < ip.y)
{
- if (Edge1.Bot.X >= ip.X)
+ if (Edge1.Bot.x >= ip.x)
{
- x1 = std::floor(((ip.Y - 0.5) * Edge1.Dx + bx1) + 0.5);
+ x1 = std::floor(((ip.y - 0.5) * Edge1.Dx + bx1) + 0.5);
}
else
{
- x1 = std::ceil(((ip.Y - 0.5) * Edge1.Dx + bx1) - 0.5);
+ x1 = std::ceil(((ip.y - 0.5) * Edge1.Dx + bx1) - 0.5);
}
}
- else if (Edge1.Bot.X > ip.X)
+ else if (Edge1.Bot.x > ip.x)
{
- if (Edge2.Bot.X >= Edge1.Bot.X)
+ if (Edge2.Bot.x >= Edge1.Bot.x)
{
- x1 = Edge1.Bot.X;
+ x1 = Edge1.Bot.x;
}
else
{
- x1 = Edge2.Bot.X;
+ x1 = Edge2.Bot.x;
}
}
- else if (Edge1.Bot.X < ip.X)
+ else if (Edge1.Bot.x < ip.x)
{
- if (Edge2.Bot.X <= Edge1.Bot.X)
+ if (Edge2.Bot.x <= Edge1.Bot.x)
{
- x1 = Edge1.Bot.X;
+ x1 = Edge1.Bot.x;
}
else
{
- x1 = Edge2.Bot.X;
+ x1 = Edge2.Bot.x;
}
}
- if (ip.X >= Edge1.Bot.X && x1 < Edge1.Bot.X) x1 = Edge1.Bot.X;
- else if (ip.X <= Edge1.Bot.X && x1 > Edge1.Bot.X) x1 = Edge1.Bot.X;
- if (Edge2.Bot.Y > ip.Y)
+ if (ip.x >= Edge1.Bot.x && x1 < Edge1.Bot.x) x1 = Edge1.Bot.x;
+ else if (ip.x <= Edge1.Bot.x && x1 > Edge1.Bot.x) x1 = Edge1.Bot.x;
+ if (Edge2.Bot.y > ip.y)
{
- if (Edge2.Bot.X >= ip.X)
+ if (Edge2.Bot.x >= ip.x)
{
- x2 = std::floor(((ip.Y + 0.5) * Edge2.Dx + bx2) + 0.5);
+ x2 = std::floor(((ip.y + 0.5) * Edge2.Dx + bx2) + 0.5);
}
else
{
- x2 = std::ceil(((ip.Y + 0.5) * Edge2.Dx + bx2) - 0.5);
+ x2 = std::ceil(((ip.y + 0.5) * Edge2.Dx + bx2) - 0.5);
}
}
- else if (Edge2.Bot.Y < ip.Y)
+ else if (Edge2.Bot.y < ip.y)
{
- if (Edge2.Bot.X >= ip.X)
+ if (Edge2.Bot.x >= ip.x)
{
- x2 = std::floor(((ip.Y - 0.5) * Edge2.Dx + bx2) + 0.5);
+ x2 = std::floor(((ip.y - 0.5) * Edge2.Dx + bx2) + 0.5);
}
else
{
- x2 = std::ceil(((ip.Y - 0.5) * Edge2.Dx + bx2) - 0.5);
+ x2 = std::ceil(((ip.y - 0.5) * Edge2.Dx + bx2) - 0.5);
}
}
- else if (Edge2.Bot.X > ip.X)
+ else if (Edge2.Bot.x > ip.x)
{
- if (Edge1.Bot.X >= Edge2.Bot.X)
+ if (Edge1.Bot.x >= Edge2.Bot.x)
{
- x2 = Edge2.Bot.X;
+ x2 = Edge2.Bot.x;
}
else
{
- x2 = Edge1.Bot.X;
+ x2 = Edge1.Bot.x;
}
}
- else if (Edge2.Bot.X < ip.X)
+ else if (Edge2.Bot.x < ip.x)
{
- if (Edge1.Bot.X <= Edge2.Bot.X)
+ if (Edge1.Bot.x <= Edge2.Bot.x)
{
- x2 = Edge2.Bot.X;
+ x2 = Edge2.Bot.x;
}
else
{
- x2 = Edge1.Bot.X;
+ x2 = Edge1.Bot.x;
}
}
- if (ip.X >= Edge2.Bot.X && x2 < Edge2.Bot.X) x2 = Edge2.Bot.X;
- else if (ip.X <= Edge2.Bot.X && x2 > Edge2.Bot.X) x2 = Edge2.Bot.X;
- if (y1 > ip.Y && y2 > ip.Y)
+ if (ip.x >= Edge2.Bot.x && x2 < Edge2.Bot.x) x2 = Edge2.Bot.x;
+ else if (ip.x <= Edge2.Bot.x && x2 > Edge2.Bot.x) x2 = Edge2.Bot.x;
+ if (y1 > ip.y && y2 > ip.y)
{
- ip.Y = std::min(y1,y2);
+ ip.y = std::min(y1,y2);
keep_searching = true;
}
- else if (y1 < ip.Y && y2 < ip.Y)
+ else if (y1 < ip.y && y2 < ip.y)
{
- ip.Y = std::max(y1,y2);
+ ip.y = std::max(y1,y2);
keep_searching = true;
}
- if (x1 > ip.X && x2 > ip.X)
+ if (x1 > ip.x && x2 > ip.x)
{
- ip.X = std::min(x1,x2);
+ ip.x = std::min(x1,x2);
keep_searching = true;
}
- else if (x1 < ip.X && x2 < ip.X)
+ else if (x1 < ip.x && x2 < ip.x)
{
- ip.X = std::max(x1,x2);
+ ip.x = std::max(x1,x2);
keep_searching = true;
}
}
while (keep_searching);
}
- if (ip.Y < Edge1.Top.Y || ip.Y < Edge2.Top.Y)
+ if (ip.y < Edge1.Top.y || ip.y < Edge2.Top.y)
{
- if (Edge1.Top.Y > Edge2.Top.Y)
- ip.Y = Edge1.Top.Y;
+ if (Edge1.Top.y > Edge2.Top.y)
+ ip.y = Edge1.Top.y;
else
- ip.Y = Edge2.Top.Y;
+ ip.y = Edge2.Top.y;
if (std::fabs(Edge1.Dx) < std::fabs(Edge2.Dx))
- ip.X = TopX(Edge1, ip.Y);
+ ip.x = TopX(Edge1, ip.y);
else
- ip.X = TopX(Edge2, ip.Y);
+ ip.x = TopX(Edge2, ip.y);
}
- //finally, don't allow 'ip' to be BELOW curr.Y (ie bottom of scanbeam) ...
- if (ip.Y > Edge1.Curr.Y)
+ //finally, don't allow 'ip' to be BELOW curr.y (ie bottom of scanbeam) ...
+ if (ip.y > Edge1.Curr.y)
{
- ip.Y = Edge1.Curr.Y;
+ ip.y = Edge1.Curr.y;
//use the more vertical edge to derive X ...
if (std::fabs(Edge1.Dx) > std::fabs(Edge2.Dx))
- ip.X = TopX(Edge2, ip.Y); else
- ip.X = TopX(Edge1, ip.Y);
+ ip.x = TopX(Edge2, ip.y); else
+ ip.x = TopX(Edge1, ip.y);
}
}
//------------------------------------------------------------------------------
@@ -954,7 +954,7 @@ inline void InitEdge(TEdge* e, TEdge* eNext, TEdge* ePrev, const IntPoint& Pt)
void InitEdge2(TEdge& e, PolyType Pt)
{
- if (e.Curr.Y >= e.Next->Curr.Y)
+ if (e.Curr.y >= e.Next->Curr.y)
{
e.Bot = e.Curr;
e.Top = e.Next->Curr;
@@ -984,7 +984,7 @@ inline void ReverseHorizontal(TEdge &e)
//swap horizontal edges' Top and Bottom x's so they follow the natural
//progression of the bounds - ie so their xbots will align with the
//adjoining lower edge. [Helpful in the ProcessHorizontal() method.]
- std::swap(e.Top.X, e.Bot.X);
+ std::swap(e.Top.x, e.Bot.x);
#ifdef use_xyz
std::swap(e.Top.Z, e.Bot.Z);
#endif
@@ -1003,20 +1003,20 @@ bool GetOverlapSegment(IntPoint pt1a, IntPoint pt1b, IntPoint pt2a,
IntPoint pt2b, IntPoint &pt1, IntPoint &pt2)
{
//precondition: segments are Collinear.
- if (Abs(pt1a.X - pt1b.X) > Abs(pt1a.Y - pt1b.Y))
+ if (Abs(pt1a.x - pt1b.x) > Abs(pt1a.y - pt1b.y))
{
- if (pt1a.X > pt1b.X) SwapPoints(pt1a, pt1b);
- if (pt2a.X > pt2b.X) SwapPoints(pt2a, pt2b);
- if (pt1a.X > pt2a.X) pt1 = pt1a; else pt1 = pt2a;
- if (pt1b.X < pt2b.X) pt2 = pt1b; else pt2 = pt2b;
- return pt1.X < pt2.X;
+ if (pt1a.x > pt1b.x) SwapPoints(pt1a, pt1b);
+ if (pt2a.x > pt2b.x) SwapPoints(pt2a, pt2b);
+ if (pt1a.x > pt2a.x) pt1 = pt1a; else pt1 = pt2a;
+ if (pt1b.x < pt2b.x) pt2 = pt1b; else pt2 = pt2b;
+ return pt1.x < pt2.x;
} else
{
- if (pt1a.Y < pt1b.Y) SwapPoints(pt1a, pt1b);
- if (pt2a.Y < pt2b.Y) SwapPoints(pt2a, pt2b);
- if (pt1a.Y < pt2a.Y) pt1 = pt1a; else pt1 = pt2a;
- if (pt1b.Y > pt2b.Y) pt2 = pt1b; else pt2 = pt2b;
- return pt1.Y > pt2.Y;
+ if (pt1a.y < pt1b.y) SwapPoints(pt1a, pt1b);
+ if (pt2a.y < pt2b.y) SwapPoints(pt2a, pt2b);
+ if (pt1a.y < pt2a.y) pt1 = pt1a; else pt1 = pt2a;
+ if (pt1b.y > pt2b.y) pt2 = pt1b; else pt2 = pt2b;
+ return pt1.y > pt2.y;
}
}
//------------------------------------------------------------------------------
@@ -1051,14 +1051,14 @@ OutPt* GetBottomPt(OutPt *pp)
OutPt* p = pp->Next;
while (p != pp)
{
- if (p->Pt.Y > pp->Pt.Y)
+ if (p->Pt.y > pp->Pt.y)
{
pp = p;
dups = 0;
}
- else if (p->Pt.Y == pp->Pt.Y && p->Pt.X <= pp->Pt.X)
+ else if (p->Pt.y == pp->Pt.y && p->Pt.x <= pp->Pt.x)
{
- if (p->Pt.X < pp->Pt.X)
+ if (p->Pt.x < pp->Pt.x)
{
dups = 0;
pp = p;
@@ -1088,10 +1088,10 @@ bool Pt2IsBetweenPt1AndPt3(const IntPoint pt1,
{
if ((pt1 == pt3) || (pt1 == pt2) || (pt3 == pt2))
return false;
- else if (pt1.X != pt3.X)
- return (pt2.X > pt1.X) == (pt2.X < pt3.X);
+ else if (pt1.x != pt3.x)
+ return (pt2.x > pt1.x) == (pt2.x < pt3.x);
else
- return (pt2.Y > pt1.Y) == (pt2.Y < pt3.Y);
+ return (pt2.y > pt1.y) == (pt2.y < pt3.y);
}
//------------------------------------------------------------------------------
@@ -1123,15 +1123,15 @@ void RangeTest(const IntPoint& Pt, bool& useFullRange)
{
if (useFullRange)
{
- if (Pt.X > hiRange || Pt.Y > hiRange || -Pt.X > hiRange || -Pt.Y > hiRange)
+ if (Pt.x > hiRange || Pt.y > hiRange || -Pt.x > hiRange || -Pt.y > hiRange)
{
std::stringstream s;
s << "Coordinate outside allowed range: ";
- s << std::fixed << Pt.X << " " << Pt.Y << " " << -Pt.X << " " << -Pt.Y;
+ s << std::fixed << Pt.x << " " << Pt.y << " " << -Pt.x << " " << -Pt.y;
throw clipperException(s.str().c_str());
}
}
- else if (Pt.X > loRange|| Pt.Y > loRange || -Pt.X > loRange || -Pt.Y > loRange)
+ else if (Pt.x > loRange|| Pt.y > loRange || -Pt.x > loRange || -Pt.y > loRange)
{
useFullRange = true;
RangeTest(Pt, useFullRange);
@@ -1148,8 +1148,8 @@ TEdge* FindNextLocMin(TEdge* E)
while (IsHorizontal(*E->Prev)) E = E->Prev;
TEdge* E2 = E;
while (IsHorizontal(*E)) E = E->Next;
- if (E->Top.Y == E->Prev->Bot.Y) continue; //ie just an intermediate horz.
- if (E2->Prev->Bot.X < E->Bot.X) E = E2;
+ if (E->Top.y == E->Prev->Bot.y) continue; //ie just an intermediate horz.
+ if (E2->Prev->Bot.x < E->Bot.x) E = E2;
break;
}
return E;
@@ -1167,14 +1167,14 @@ TEdge* ClipperBase::ProcessBound(TEdge* E, bool NextIsForward)
//create another LocMin and call ProcessBound once more
if (NextIsForward)
{
- while (E->Top.Y == E->Next->Bot.Y) E = E->Next;
+ while (E->Top.y == E->Next->Bot.y) E = E->Next;
//don't include top horizontals when parsing a bound a second time,
//they will be contained in the opposite bound ...
while (E != Result && IsHorizontal(*E)) E = E->Prev;
}
else
{
- while (E->Top.Y == E->Prev->Bot.Y) E = E->Prev;
+ while (E->Top.y == E->Prev->Bot.y) E = E->Prev;
while (E != Result && IsHorizontal(*E)) E = E->Next;
}
@@ -1191,7 +1191,7 @@ TEdge* ClipperBase::ProcessBound(TEdge* E, bool NextIsForward)
else
E = Result->Prev;
MinimaList::value_type locMin;
- locMin.Y = E->Bot.Y;
+ locMin.y = E->Bot.y;
locMin.LeftBound = 0;
locMin.RightBound = E;
E->WindDelta = 0;
@@ -1214,17 +1214,17 @@ TEdge* ClipperBase::ProcessBound(TEdge* E, bool NextIsForward)
EStart = E->Next;
if (IsHorizontal(*EStart)) //ie an adjoining horizontal skip edge
{
- if (EStart->Bot.X != E->Bot.X && EStart->Top.X != E->Bot.X)
+ if (EStart->Bot.x != E->Bot.x && EStart->Top.x != E->Bot.x)
ReverseHorizontal(*E);
}
- else if (EStart->Bot.X != E->Bot.X)
+ else if (EStart->Bot.x != E->Bot.x)
ReverseHorizontal(*E);
}
EStart = E;
if (NextIsForward)
{
- while (Result->Top.Y == Result->Next->Bot.Y && Result->Next->OutIdx != Skip)
+ while (Result->Top.y == Result->Next->Bot.y && Result->Next->OutIdx != Skip)
Result = Result->Next;
if (IsHorizontal(*Result) && Result->Next->OutIdx != Skip)
{
@@ -1233,38 +1233,38 @@ TEdge* ClipperBase::ProcessBound(TEdge* E, bool NextIsForward)
//unless a Skip edge is encountered when that becomes the top divide
Horz = Result;
while (IsHorizontal(*Horz->Prev)) Horz = Horz->Prev;
- if (Horz->Prev->Top.X > Result->Next->Top.X) Result = Horz->Prev;
+ if (Horz->Prev->Top.x > Result->Next->Top.x) Result = Horz->Prev;
}
while (E != Result)
{
E->NextInLML = E->Next;
if (IsHorizontal(*E) && E != EStart &&
- E->Bot.X != E->Prev->Top.X) ReverseHorizontal(*E);
+ E->Bot.x != E->Prev->Top.x) ReverseHorizontal(*E);
E = E->Next;
}
- if (IsHorizontal(*E) && E != EStart && E->Bot.X != E->Prev->Top.X)
+ if (IsHorizontal(*E) && E != EStart && E->Bot.x != E->Prev->Top.x)
ReverseHorizontal(*E);
Result = Result->Next; //move to the edge just beyond current bound
} else
{
- while (Result->Top.Y == Result->Prev->Bot.Y && Result->Prev->OutIdx != Skip)
+ while (Result->Top.y == Result->Prev->Bot.y && Result->Prev->OutIdx != Skip)
Result = Result->Prev;
if (IsHorizontal(*Result) && Result->Prev->OutIdx != Skip)
{
Horz = Result;
while (IsHorizontal(*Horz->Next)) Horz = Horz->Next;
- if (Horz->Next->Top.X == Result->Prev->Top.X ||
- Horz->Next->Top.X > Result->Prev->Top.X) Result = Horz->Next;
+ if (Horz->Next->Top.x == Result->Prev->Top.x ||
+ Horz->Next->Top.x > Result->Prev->Top.x) Result = Horz->Next;
}
while (E != Result)
{
E->NextInLML = E->Prev;
- if (IsHorizontal(*E) && E != EStart && E->Bot.X != E->Next->Top.X)
+ if (IsHorizontal(*E) && E != EStart && E->Bot.x != E->Next->Top.x)
ReverseHorizontal(*E);
E = E->Prev;
}
- if (IsHorizontal(*E) && E != EStart && E->Bot.X != E->Next->Top.X)
+ if (IsHorizontal(*E) && E != EStart && E->Bot.x != E->Next->Top.x)
ReverseHorizontal(*E);
Result = Result->Prev; //move to the edge just beyond current bound
}
@@ -1365,7 +1365,7 @@ bool ClipperBase::AddPath(const Path &pg, PolyType PolyTyp, bool Closed)
{
InitEdge2(*E, PolyTyp);
E = E->Next;
- if (IsFlat && E->Curr.Y != eStart->Curr.Y) IsFlat = false;
+ if (IsFlat && E->Curr.y != eStart->Curr.y) IsFlat = false;
}
while (E != eStart);
@@ -1382,14 +1382,14 @@ bool ClipperBase::AddPath(const Path &pg, PolyType PolyTyp, bool Closed)
}
E->Prev->OutIdx = Skip;
MinimaList::value_type locMin;
- locMin.Y = E->Bot.Y;
+ locMin.y = E->Bot.y;
locMin.LeftBound = 0;
locMin.RightBound = E;
locMin.RightBound->Side = esRight;
locMin.RightBound->WindDelta = 0;
for (;;)
{
- if (E->Bot.X != E->Prev->Top.X) ReverseHorizontal(*E);
+ if (E->Bot.x != E->Prev->Top.x) ReverseHorizontal(*E);
if (E->Next->OutIdx == Skip) break;
E->NextInLML = E->Next;
E = E->Next;
@@ -1416,7 +1416,7 @@ bool ClipperBase::AddPath(const Path &pg, PolyType PolyTyp, bool Closed)
//E and E.Prev now share a local minima (left aligned if horizontal).
//Compare their slopes to find which starts which bound ...
MinimaList::value_type locMin;
- locMin.Y = E->Bot.Y;
+ locMin.y = E->Bot.y;
if (E->Dx < E->Prev->Dx)
{
locMin.LeftBound = E->Prev;
@@ -1485,7 +1485,7 @@ void ClipperBase::Reset()
//reset all edges ...
for (MinimaList::iterator lm = m_MinimaList.begin(); lm != m_MinimaList.end(); ++lm)
{
- InsertScanbeam(lm->Y);
+ InsertScanbeam(lm->y);
TEdge* e = lm->LeftBound;
if (e)
{
@@ -1516,7 +1516,7 @@ void ClipperBase::DisposeLocalMinimaList()
bool ClipperBase::PopLocalMinima(cInt Y, const LocalMinimum *&locMin)
{
- if (m_CurrentLM == m_MinimaList.end() || (*m_CurrentLM).Y != Y) return false;
+ if (m_CurrentLM == m_MinimaList.end() || (*m_CurrentLM).y != Y) return false;
locMin = &(*m_CurrentLM);
++m_CurrentLM;
return true;
@@ -1532,28 +1532,28 @@ IntRect ClipperBase::GetBounds()
result.left = result.top = result.right = result.bottom = 0;
return result;
}
- result.left = lm->LeftBound->Bot.X;
- result.top = lm->LeftBound->Bot.Y;
- result.right = lm->LeftBound->Bot.X;
- result.bottom = lm->LeftBound->Bot.Y;
+ result.left = lm->LeftBound->Bot.x;
+ result.top = lm->LeftBound->Bot.y;
+ result.right = lm->LeftBound->Bot.x;
+ result.bottom = lm->LeftBound->Bot.y;
while (lm != m_MinimaList.end())
{
//todo - needs fixing for open paths
- result.bottom = std::max(result.bottom, lm->LeftBound->Bot.Y);
+ result.bottom = std::max(result.bottom, lm->LeftBound->Bot.y);
TEdge* e = lm->LeftBound;
for (;;) {
TEdge* bottomE = e;
while (e->NextInLML)
{
- if (e->Bot.X < result.left) result.left = e->Bot.X;
- if (e->Bot.X > result.right) result.right = e->Bot.X;
+ if (e->Bot.x < result.left) result.left = e->Bot.x;
+ if (e->Bot.x > result.right) result.right = e->Bot.x;
e = e->NextInLML;
}
- result.left = std::min(result.left, e->Bot.X);
- result.right = std::max(result.right, e->Bot.X);
- result.left = std::min(result.left, e->Top.X);
- result.right = std::max(result.right, e->Top.X);
- result.top = std::min(result.top, e->Top.Y);
+ result.left = std::min(result.left, e->Bot.x);
+ result.right = std::max(result.right, e->Bot.x);
+ result.left = std::min(result.left, e->Top.x);
+ result.right = std::max(result.right, e->Top.x);
+ result.top = std::min(result.top, e->Top.y);
if (bottomE == lm->LeftBound) e = lm->RightBound;
else break;
}
@@ -1689,7 +1689,7 @@ void ClipperBase::UpdateEdgeIntoAEL(TEdge *&e)
e->Curr = e->Bot;
e->PrevInAEL = AelPrev;
e->NextInAEL = AelNext;
- if (!IsHorizontal(*e)) InsertScanbeam(e->Top.Y);
+ if (!IsHorizontal(*e)) InsertScanbeam(e->Top.y);
}
//------------------------------------------------------------------------------
@@ -2113,10 +2113,10 @@ OutPt* Clipper::AddLocalMinPoly(TEdge *e1, TEdge *e2, const IntPoint &Pt)
if (prevE && prevE->OutIdx >= 0)
{
- cInt xPrev = TopX(*prevE, Pt.Y);
- cInt xE = TopX(*e, Pt.Y);
+ cInt xPrev = TopX(*prevE, Pt.y);
+ cInt xE = TopX(*e, Pt.y);
if (xPrev == xE && (e->WindDelta != 0) && (prevE->WindDelta != 0) &&
- SlopesEqual(IntPoint(xPrev, Pt.Y), prevE->Top, IntPoint(xE, Pt.Y), e->Top, m_UseFullRange))
+ SlopesEqual(IntPoint(xPrev, Pt.y), prevE->Top, IntPoint(xE, Pt.y), e->Top, m_UseFullRange))
{
OutPt* outPt = AddOutPt(prevE, Pt);
AddJoin(result, outPt, e->Top);
@@ -2239,14 +2239,14 @@ void Clipper::InsertLocalMinimaIntoAEL(const cInt botY)
Op1 = AddOutPt(rb, rb->Bot);
TEdge* ePrev = rb->PrevInAEL;
if ((rb->OutIdx >= 0) && (rb->WindDelta != 0) && ePrev && (ePrev->OutIdx >= 0) &&
- (ePrev->Curr.X == rb->Curr.X) && (ePrev->WindDelta != 0))
+ (ePrev->Curr.x == rb->Curr.x) && (ePrev->WindDelta != 0))
{
IntPoint pt = rb->Curr;
AddOutPt(ePrev, pt);
}
TEdge* eNext = rb->NextInAEL;
if ((rb->OutIdx >= 0) && (rb->WindDelta != 0) && eNext && (eNext->OutIdx >= 0) &&
- (eNext->Curr.X == rb->Curr.X) && (eNext->WindDelta != 0))
+ (eNext->Curr.x == rb->Curr.x) && (eNext->WindDelta != 0))
{
IntPoint pt = rb->Curr;
AddOutPt(eNext, pt);
@@ -2262,20 +2262,20 @@ void Clipper::InsertLocalMinimaIntoAEL(const cInt botY)
Op1 = AddOutPt(lb, lb->Bot);
TEdge* ePrev = lb->PrevInAEL;
if ((lb->OutIdx >= 0) && (lb->WindDelta != 0) && ePrev && (ePrev->OutIdx >= 0) &&
- (ePrev->Curr.X == lb->Curr.X) && (ePrev->WindDelta != 0))
+ (ePrev->Curr.x == lb->Curr.x) && (ePrev->WindDelta != 0))
{
IntPoint pt = lb->Curr;
AddOutPt(ePrev, pt);
}
TEdge* eNext = lb->NextInAEL;
if ((lb->OutIdx >= 0) && (lb->WindDelta != 0) && eNext && (eNext->OutIdx >= 0) &&
- (eNext->Curr.X == lb->Curr.X) && (eNext->WindDelta != 0))
+ (eNext->Curr.x == lb->Curr.x) && (eNext->WindDelta != 0))
{
IntPoint pt = lb->Curr;
AddOutPt(eNext, pt);
}
}
- InsertScanbeam(lb->Top.Y);
+ InsertScanbeam(lb->Top.y);
}
else
{
@@ -2289,20 +2289,20 @@ void Clipper::InsertLocalMinimaIntoAEL(const cInt botY)
Op1 = AddLocalMinPoly(lb, rb, lb->Bot);
TEdge* ePrev = lb->PrevInAEL;
if ((lb->OutIdx >= 0) && (lb->WindDelta != 0) && ePrev && (ePrev->OutIdx >= 0) &&
- (ePrev->Curr.X == lb->Curr.X) && (ePrev->WindDelta != 0))
+ (ePrev->Curr.x == lb->Curr.x) && (ePrev->WindDelta != 0))
{
IntPoint pt = lb->Curr;
AddOutPt(ePrev, pt);
}
TEdge* eNext = rb->NextInAEL;
if ((rb->OutIdx >= 0) && (rb->WindDelta != 0) && eNext && (eNext->OutIdx >= 0) &&
- (eNext->Curr.X == rb->Curr.X) && (eNext->WindDelta != 0))
+ (eNext->Curr.x == rb->Curr.x) && (eNext->WindDelta != 0))
{
IntPoint pt = rb->Curr;
AddOutPt(eNext, pt);
}
}
- InsertScanbeam(lb->Top.Y);
+ InsertScanbeam(lb->Top.y);
}
if (rb)
@@ -2311,9 +2311,9 @@ void Clipper::InsertLocalMinimaIntoAEL(const cInt botY)
{
AddEdgeToSEL(rb);
if (rb->NextInLML)
- InsertScanbeam(rb->NextInLML->Top.Y);
+ InsertScanbeam(rb->NextInLML->Top.y);
}
- else InsertScanbeam( rb->Top.Y );
+ else InsertScanbeam( rb->Top.y );
}
if (!lb || !rb) continue;
@@ -2327,13 +2327,13 @@ void Clipper::InsertLocalMinimaIntoAEL(const cInt botY)
Join* jr = m_GhostJoins[i];
//if the horizontal Rb and a 'ghost' horizontal overlap, then convert
//the 'ghost' join to a real join ready for later ...
- if (HorzSegmentsOverlap(jr->OutPt1->Pt.X, jr->OffPt.X, rb->Bot.X, rb->Top.X))
+ if (HorzSegmentsOverlap(jr->OutPt1->Pt.x, jr->OffPt.x, rb->Bot.x, rb->Top.x))
AddJoin(jr->OutPt1, Op1, jr->OffPt);
}
}
if (lb->OutIdx >= 0 && lb->PrevInAEL &&
- lb->PrevInAEL->Curr.X == lb->Bot.X &&
+ lb->PrevInAEL->Curr.x == lb->Bot.x &&
lb->PrevInAEL->OutIdx >= 0 &&
SlopesEqual(lb->PrevInAEL->Bot, lb->PrevInAEL->Top, lb->Curr, lb->Top, m_UseFullRange) &&
(lb->WindDelta != 0) && (lb->PrevInAEL->WindDelta != 0))
@@ -2626,10 +2626,10 @@ OutRec* GetLowermostRec(OutRec *outRec1, OutRec *outRec2)
outRec2->BottomPt = GetBottomPt(outRec2->Pts);
OutPt *OutPt1 = outRec1->BottomPt;
OutPt *OutPt2 = outRec2->BottomPt;
- if (OutPt1->Pt.Y > OutPt2->Pt.Y) return outRec1;
- else if (OutPt1->Pt.Y < OutPt2->Pt.Y) return outRec2;
- else if (OutPt1->Pt.X < OutPt2->Pt.X) return outRec1;
- else if (OutPt1->Pt.X > OutPt2->Pt.X) return outRec2;
+ if (OutPt1->Pt.y > OutPt2->Pt.y) return outRec1;
+ else if (OutPt1->Pt.y < OutPt2->Pt.y) return outRec2;
+ else if (OutPt1->Pt.x < OutPt2->Pt.x) return outRec1;
+ else if (OutPt1->Pt.x > OutPt2->Pt.x) return outRec2;
else if (OutPt1->Next == OutPt1) return outRec2;
else if (OutPt2->Next == OutPt2) return outRec1;
else if (FirstIsBottomPt(OutPt1, OutPt2)) return outRec1;
@@ -2822,13 +2822,13 @@ inline bool IsMinima(TEdge *e)
inline bool IsMaxima(TEdge *e, const cInt Y)
{
- return e && e->Top.Y == Y && !e->NextInLML;
+ return e && e->Top.y == Y && !e->NextInLML;
}
//------------------------------------------------------------------------------
inline bool IsIntermediate(TEdge *e, const cInt Y)
{
- return e->Top.Y == Y && e->NextInLML;
+ return e->Top.y == Y && e->NextInLML;
}
//------------------------------------------------------------------------------
@@ -2906,15 +2906,15 @@ TEdge* GetNextInAEL(TEdge *e, Direction dir)
void GetHorzDirection(TEdge& HorzEdge, Direction& Dir, cInt& Left, cInt& Right)
{
- if (HorzEdge.Bot.X < HorzEdge.Top.X)
+ if (HorzEdge.Bot.x < HorzEdge.Top.x)
{
- Left = HorzEdge.Bot.X;
- Right = HorzEdge.Top.X;
+ Left = HorzEdge.Bot.x;
+ Right = HorzEdge.Top.x;
Dir = dLeftToRight;
} else
{
- Left = HorzEdge.Top.X;
- Right = HorzEdge.Bot.X;
+ Left = HorzEdge.Top.x;
+ Right = HorzEdge.Bot.x;
Dir = dRightToLeft;
}
}
@@ -2923,8 +2923,8 @@ void GetHorzDirection(TEdge& HorzEdge, Direction& Dir, cInt& Left, cInt& Right)
/*******************************************************************************
* Notes: Horizontal edges (HEs) at scanline intersections (ie at the Top or *
* Bottom of a scanbeam) are processed as if layered. The order in which HEs *
-* are processed doesn't matter. HEs intersect with other HE Bot.Xs only [#] *
-* (or they could intersect with Top.Xs only, ie EITHER Bot.Xs OR Top.Xs), *
+* are processed doesn't matter. HEs intersect with other HE Bot.xs only [#] *
+* (or they could intersect with Top.xs only, ie EITHER Bot.xs OR Top.xs), *
* and with other non-horizontal edges [*]. Once these intersections are *
* processed, intermediate HEs then 'promote' the Edge above (NextInLML) into *
* the AEL. These 'promoted' edges may in turn intersect [%] with other HEs. *
@@ -2952,15 +2952,15 @@ void Clipper::ProcessHorizontal(TEdge *horzEdge)
if (dir == dLeftToRight)
{
maxIt = m_Maxima.begin();
- while (maxIt != m_Maxima.end() && *maxIt <= horzEdge->Bot.X) maxIt++;
- if (maxIt != m_Maxima.end() && *maxIt >= eLastHorz->Top.X)
+ while (maxIt != m_Maxima.end() && *maxIt <= horzEdge->Bot.x) maxIt++;
+ if (maxIt != m_Maxima.end() && *maxIt >= eLastHorz->Top.x)
maxIt = m_Maxima.end();
}
else
{
maxRit = m_Maxima.rbegin();
- while (maxRit != m_Maxima.rend() && *maxRit > horzEdge->Bot.X) maxRit++;
- if (maxRit != m_Maxima.rend() && *maxRit <= eLastHorz->Top.X)
+ while (maxRit != m_Maxima.rend() && *maxRit > horzEdge->Bot.x) maxRit++;
+ if (maxRit != m_Maxima.rend() && *maxRit <= eLastHorz->Top.x)
maxRit = m_Maxima.rend();
}
}
@@ -2982,30 +2982,30 @@ void Clipper::ProcessHorizontal(TEdge *horzEdge)
{
if (dir == dLeftToRight)
{
- while (maxIt != m_Maxima.end() && *maxIt < e->Curr.X)
+ while (maxIt != m_Maxima.end() && *maxIt < e->Curr.x)
{
if (horzEdge->OutIdx >= 0 && !IsOpen)
- AddOutPt(horzEdge, IntPoint(*maxIt, horzEdge->Bot.Y));
+ AddOutPt(horzEdge, IntPoint(*maxIt, horzEdge->Bot.y));
maxIt++;
}
}
else
{
- while (maxRit != m_Maxima.rend() && *maxRit > e->Curr.X)
+ while (maxRit != m_Maxima.rend() && *maxRit > e->Curr.x)
{
if (horzEdge->OutIdx >= 0 && !IsOpen)
- AddOutPt(horzEdge, IntPoint(*maxRit, horzEdge->Bot.Y));
+ AddOutPt(horzEdge, IntPoint(*maxRit, horzEdge->Bot.y));
maxRit++;
}
}
};
- if ((dir == dLeftToRight && e->Curr.X > horzRight) ||
- (dir == dRightToLeft && e->Curr.X < horzLeft)) break;
+ if ((dir == dLeftToRight && e->Curr.x > horzRight) ||
+ (dir == dRightToLeft && e->Curr.x < horzLeft)) break;
//Also break if we've got to the end of an intermediate horizontal edge ...
//nb: Smaller Dx's are to the right of larger Dx's ABOVE the horizontal.
- if (e->Curr.X == horzEdge->Top.X && horzEdge->NextInLML &&
+ if (e->Curr.x == horzEdge->Top.x && horzEdge->NextInLML &&
e->Dx < horzEdge->NextInLML->Dx) break;
if (horzEdge->OutIdx >= 0 && !IsOpen) //note: may be done multiple times
@@ -3015,8 +3015,8 @@ void Clipper::ProcessHorizontal(TEdge *horzEdge)
while (eNextHorz)
{
if (eNextHorz->OutIdx >= 0 &&
- HorzSegmentsOverlap(horzEdge->Bot.X,
- horzEdge->Top.X, eNextHorz->Bot.X, eNextHorz->Top.X))
+ HorzSegmentsOverlap(horzEdge->Bot.x,
+ horzEdge->Top.x, eNextHorz->Bot.x, eNextHorz->Top.x))
{
OutPt* op2 = GetLastOutPt(eNextHorz);
AddJoin(op2, op1, eNextHorz->Top);
@@ -3039,12 +3039,12 @@ void Clipper::ProcessHorizontal(TEdge *horzEdge)
if(dir == dLeftToRight)
{
- IntPoint Pt = IntPoint(e->Curr.X, horzEdge->Curr.Y);
+ IntPoint Pt = IntPoint(e->Curr.x, horzEdge->Curr.y);
IntersectEdges(horzEdge, e, Pt);
}
else
{
- IntPoint Pt = IntPoint(e->Curr.X, horzEdge->Curr.Y);
+ IntPoint Pt = IntPoint(e->Curr.x, horzEdge->Curr.y);
IntersectEdges( e, horzEdge, Pt);
}
TEdge* eNext = GetNextInAEL(e, dir);
@@ -3068,8 +3068,8 @@ void Clipper::ProcessHorizontal(TEdge *horzEdge)
while (eNextHorz)
{
if (eNextHorz->OutIdx >= 0 &&
- HorzSegmentsOverlap(horzEdge->Bot.X,
- horzEdge->Top.X, eNextHorz->Bot.X, eNextHorz->Top.X))
+ HorzSegmentsOverlap(horzEdge->Bot.x,
+ horzEdge->Top.x, eNextHorz->Bot.x, eNextHorz->Top.x))
{
OutPt* op2 = GetLastOutPt(eNextHorz);
AddJoin(op2, op1, eNextHorz->Top);
@@ -3090,14 +3090,14 @@ void Clipper::ProcessHorizontal(TEdge *horzEdge)
{
TEdge* ePrev = horzEdge->PrevInAEL;
if ((horzEdge->WindDelta != 0) && ePrev && (ePrev->OutIdx >= 0) &&
- (ePrev->Curr.X == horzEdge->Top.X) && (ePrev->WindDelta != 0))
+ (ePrev->Curr.x == horzEdge->Top.x) && (ePrev->WindDelta != 0))
{
IntPoint pt = horzEdge->Top;
AddOutPt(ePrev, pt);
}
TEdge* eNext = horzEdge->NextInAEL;
if ((horzEdge->WindDelta != 0) && eNext && (eNext->OutIdx >= 0) &&
- (eNext->Curr.X == horzEdge->Top.X) && (eNext->WindDelta != 0))
+ (eNext->Curr.x == horzEdge->Top.x) && (eNext->WindDelta != 0))
{
IntPoint pt = horzEdge->Top;
AddOutPt(eNext, pt);
@@ -3108,17 +3108,17 @@ void Clipper::ProcessHorizontal(TEdge *horzEdge)
//nb: HorzEdge is no longer horizontal here
TEdge* ePrev = horzEdge->PrevInAEL;
TEdge* eNext = horzEdge->NextInAEL;
- if (ePrev && ePrev->Curr.X == horzEdge->Bot.X &&
- ePrev->Curr.Y == horzEdge->Bot.Y && ePrev->WindDelta != 0 &&
- (ePrev->OutIdx >= 0 && ePrev->Curr.Y > ePrev->Top.Y &&
+ if (ePrev && ePrev->Curr.x == horzEdge->Bot.x &&
+ ePrev->Curr.y == horzEdge->Bot.y && ePrev->WindDelta != 0 &&
+ (ePrev->OutIdx >= 0 && ePrev->Curr.y > ePrev->Top.y &&
SlopesEqual(*horzEdge, *ePrev, m_UseFullRange)))
{
OutPt* op2 = AddOutPt(ePrev, horzEdge->Bot);
AddJoin(op1, op2, horzEdge->Top);
}
- else if (eNext && eNext->Curr.X == horzEdge->Bot.X &&
- eNext->Curr.Y == horzEdge->Bot.Y && eNext->WindDelta != 0 &&
- eNext->OutIdx >= 0 && eNext->Curr.Y > eNext->Top.Y &&
+ else if (eNext && eNext->Curr.x == horzEdge->Bot.x &&
+ eNext->Curr.y == horzEdge->Bot.y && eNext->WindDelta != 0 &&
+ eNext->OutIdx >= 0 && eNext->Curr.y > eNext->Top.y &&
SlopesEqual(*horzEdge, *eNext, m_UseFullRange))
{
OutPt* op2 = AddOutPt(eNext, horzEdge->Bot);
@@ -3176,7 +3176,7 @@ void Clipper::BuildIntersectList(const cInt topY)
{
e->PrevInSEL = e->PrevInAEL;
e->NextInSEL = e->NextInAEL;
- e->Curr.X = TopX( *e, topY );
+ e->Curr.x = TopX( *e, topY );
e = e->NextInAEL;
}
@@ -3190,10 +3190,10 @@ void Clipper::BuildIntersectList(const cInt topY)
{
TEdge *eNext = e->NextInSEL;
IntPoint Pt;
- if(e->Curr.X > eNext->Curr.X)
+ if(e->Curr.x > eNext->Curr.x)
{
IntersectPoint(*e, *eNext, Pt);
- if (Pt.Y < topY) Pt = IntPoint(TopX(*e, topY), topY);
+ if (Pt.y < topY) Pt = IntPoint(TopX(*e, topY), topY);
IntersectNode * newNode = new IntersectNode;
newNode->Edge1 = e;
newNode->Edge2 = eNext;
@@ -3232,9 +3232,9 @@ void Clipper::ProcessIntersectList()
bool IntersectListSort(IntersectNode* node1, IntersectNode* node2)
{
- if (node2->Pt.Y != node1->Pt.Y)
+ if (node2->Pt.y != node1->Pt.y)
{
- return node2->Pt.Y < node1->Pt.Y;
+ return node2->Pt.y < node1->Pt.y;
}
else
{
@@ -3287,7 +3287,7 @@ void Clipper::DoMaxima(TEdge *e)
}
TEdge* ePrev = e->PrevInAEL;
- if (ePrev && ePrev->Curr.X == e->Top.X && ePrev->Top != e->Top && ePrev->OutIdx >= 0 &&
+ if (ePrev && ePrev->Curr.x == e->Top.x && ePrev->Top != e->Top && ePrev->OutIdx >= 0 &&
ePrev->WindDelta != 0 && e->OutIdx >= 0 && e->WindDelta != 0)
{
IntPoint pt = e->Top;
@@ -3301,7 +3301,7 @@ void Clipper::DoMaxima(TEdge *e)
eNext = e->NextInAEL;
}
eNext = eMaxPair->NextInAEL;
- if (eNext && eNext->Curr.X == e->Top.X && eNext->Top != e->Top && eNext->OutIdx >= 0 &&
+ if (eNext && eNext->Curr.x == e->Top.x && eNext->Top != e->Top && eNext->OutIdx >= 0 &&
eNext->WindDelta != 0 && e->OutIdx >= 0 && e->WindDelta != 0)
{
IntPoint pt = e->Top;
@@ -3361,8 +3361,8 @@ void Clipper::ProcessEdgesAtTopOfScanbeam(const cInt topY)
{
if (m_StrictSimple)
{
- m_Maxima.push_back(e->Top.X);
- next_maxima.push_back(e->Top.X);
+ m_Maxima.push_back(e->Top.x);
+ next_maxima.push_back(e->Top.x);
}
TEdge* ePrev = e->PrevInAEL;
DoMaxima(e);
@@ -3371,7 +3371,7 @@ void Clipper::ProcessEdgesAtTopOfScanbeam(const cInt topY)
}
else
{
- //2. promote horizontal edges, otherwise update Curr.X and Curr.Y ...
+ //2. promote horizontal edges, otherwise update Curr.x and Curr.y ...
if (IsIntermediate(e, topY) && IsHorizontal(*e->NextInLML))
{
UpdateEdgeIntoAEL(e);
@@ -3380,17 +3380,17 @@ void Clipper::ProcessEdgesAtTopOfScanbeam(const cInt topY)
AddOutPt(e, e->Bot);
if (m_StrictSimple)
{
- m_Maxima.push_back(e->Top.X);
- m_Maxima.push_back(e->Bot.X);
- next_maxima.push_back(e->Bot.X);
+ m_Maxima.push_back(e->Top.x);
+ m_Maxima.push_back(e->Bot.x);
+ next_maxima.push_back(e->Bot.x);
}
}
AddEdgeToSEL(e);
}
else
{
- e->Curr.X = TopX( *e, topY );
- e->Curr.Y = topY;
+ e->Curr.x = TopX( *e, topY );
+ e->Curr.y = topY;
}
//When StrictlySimple and 'e' is being touched by another edge, then
@@ -3398,7 +3398,7 @@ void Clipper::ProcessEdgesAtTopOfScanbeam(const cInt topY)
if (m_StrictSimple && e->OutIdx >= 0 && e->WindDelta != 0)
{
TEdge* ePrev = e->PrevInAEL;
- while (ePrev && ePrev->Curr.X == e->Curr.X)
+ while (ePrev && ePrev->Curr.x == e->Curr.x)
{
if (ePrev->OutIdx >= 0 && ePrev->WindDelta != 0 &&
!(e->Bot == ePrev->Bot && e->Top == ePrev->Top))
@@ -3421,11 +3421,11 @@ void Clipper::ProcessEdgesAtTopOfScanbeam(const cInt topY)
if (m_StrictSimple)
{
MinimaList::iterator lm = m_CurrentLM;
- while (lm != m_MinimaList.end() && lm->Y == topY)
+ while (lm != m_MinimaList.end() && lm->y == topY)
{
if (lm->LeftBound && lm->RightBound)
{
- m_Maxima.push_back(lm->LeftBound->Bot.X);
+ m_Maxima.push_back(lm->LeftBound->Bot.x);
}
++lm;
}
@@ -3452,18 +3452,18 @@ void Clipper::ProcessEdgesAtTopOfScanbeam(const cInt topY)
//if output polygons share an edge, they'll need joining later ...
TEdge* ePrev = e->PrevInAEL;
TEdge* eNext = e->NextInAEL;
- if (ePrev && ePrev->Curr.X == e->Bot.X &&
- ePrev->Curr.Y == e->Bot.Y && op &&
- ePrev->OutIdx >= 0 && ePrev->Curr.Y > ePrev->Top.Y &&
+ if (ePrev && ePrev->Curr.x == e->Bot.x &&
+ ePrev->Curr.y == e->Bot.y && op &&
+ ePrev->OutIdx >= 0 && ePrev->Curr.y > ePrev->Top.y &&
SlopesEqual(e->Curr, e->Top, ePrev->Curr, ePrev->Top, m_UseFullRange) &&
(e->WindDelta != 0) && (ePrev->WindDelta != 0))
{
OutPt* op2 = AddOutPt(ePrev, e->Bot);
AddJoin(op, op2, e->Top);
}
- else if (eNext && eNext->Curr.X == e->Bot.X &&
- eNext->Curr.Y == e->Bot.Y && op &&
- eNext->OutIdx >= 0 && eNext->Curr.Y > eNext->Top.Y &&
+ else if (eNext && eNext->Curr.x == e->Bot.x &&
+ eNext->Curr.y == e->Bot.y && op &&
+ eNext->OutIdx >= 0 && eNext->Curr.y > eNext->Top.y &&
SlopesEqual(e->Curr, e->Top, eNext->Curr, eNext->Top, m_UseFullRange) &&
(e->WindDelta != 0) && (eNext->WindDelta != 0))
{
@@ -3641,13 +3641,13 @@ void SwapIntersectNodes(IntersectNode &int1, IntersectNode &int2)
inline bool E2InsertsBeforeE1(TEdge &e1, TEdge &e2)
{
- if (e2.Curr.X == e1.Curr.X)
+ if (e2.Curr.x == e1.Curr.x)
{
- if (e2.Top.Y > e1.Top.Y)
- return e2.Top.X < TopX(e1, e2.Top.Y);
- else return e1.Top.X > TopX(e2, e1.Top.Y);
+ if (e2.Top.y > e1.Top.y)
+ return e2.Top.x < TopX(e1, e2.Top.y);
+ else return e1.Top.x > TopX(e2, e1.Top.y);
}
- else return e2.Curr.X < e1.Curr.X;
+ else return e2.Curr.x < e1.Curr.x;
}
//------------------------------------------------------------------------------
@@ -3735,8 +3735,8 @@ OutPt* DupOutPt(OutPt* outPt, bool InsertAfter)
bool JoinHorz(OutPt* op1, OutPt* op1b, OutPt* op2, OutPt* op2b,
const IntPoint Pt, bool DiscardLeft)
{
- Direction Dir1 = (op1->Pt.X > op1b->Pt.X ? dRightToLeft : dLeftToRight);
- Direction Dir2 = (op2->Pt.X > op2b->Pt.X ? dRightToLeft : dLeftToRight);
+ Direction Dir1 = (op1->Pt.x > op1b->Pt.x ? dRightToLeft : dLeftToRight);
+ Direction Dir2 = (op2->Pt.x > op2b->Pt.x ? dRightToLeft : dLeftToRight);
if (Dir1 == Dir2) return false;
//When DiscardLeft, we want Op1b to be on the Left of Op1, otherwise we
@@ -3746,10 +3746,10 @@ bool JoinHorz(OutPt* op1, OutPt* op1b, OutPt* op2, OutPt* op2b,
//otherwise make sure we're AT or LEFT of Pt. (Likewise with Op2b.)
if (Dir1 == dLeftToRight)
{
- while (op1->Next->Pt.X <= Pt.X &&
- op1->Next->Pt.X >= op1->Pt.X && op1->Next->Pt.Y == Pt.Y)
+ while (op1->Next->Pt.x <= Pt.x &&
+ op1->Next->Pt.x >= op1->Pt.x && op1->Next->Pt.y == Pt.y)
op1 = op1->Next;
- if (DiscardLeft && (op1->Pt.X != Pt.X)) op1 = op1->Next;
+ if (DiscardLeft && (op1->Pt.x != Pt.x)) op1 = op1->Next;
op1b = DupOutPt(op1, !DiscardLeft);
if (op1b->Pt != Pt)
{
@@ -3760,10 +3760,10 @@ bool JoinHorz(OutPt* op1, OutPt* op1b, OutPt* op2, OutPt* op2b,
}
else
{
- while (op1->Next->Pt.X >= Pt.X &&
- op1->Next->Pt.X <= op1->Pt.X && op1->Next->Pt.Y == Pt.Y)
+ while (op1->Next->Pt.x >= Pt.x &&
+ op1->Next->Pt.x <= op1->Pt.x && op1->Next->Pt.y == Pt.y)
op1 = op1->Next;
- if (!DiscardLeft && (op1->Pt.X != Pt.X)) op1 = op1->Next;
+ if (!DiscardLeft && (op1->Pt.x != Pt.x)) op1 = op1->Next;
op1b = DupOutPt(op1, DiscardLeft);
if (op1b->Pt != Pt)
{
@@ -3775,10 +3775,10 @@ bool JoinHorz(OutPt* op1, OutPt* op1b, OutPt* op2, OutPt* op2b,
if (Dir2 == dLeftToRight)
{
- while (op2->Next->Pt.X <= Pt.X &&
- op2->Next->Pt.X >= op2->Pt.X && op2->Next->Pt.Y == Pt.Y)
+ while (op2->Next->Pt.x <= Pt.x &&
+ op2->Next->Pt.x >= op2->Pt.x && op2->Next->Pt.y == Pt.y)
op2 = op2->Next;
- if (DiscardLeft && (op2->Pt.X != Pt.X)) op2 = op2->Next;
+ if (DiscardLeft && (op2->Pt.x != Pt.x)) op2 = op2->Next;
op2b = DupOutPt(op2, !DiscardLeft);
if (op2b->Pt != Pt)
{
@@ -3788,10 +3788,10 @@ bool JoinHorz(OutPt* op1, OutPt* op1b, OutPt* op2, OutPt* op2b,
};
} else
{
- while (op2->Next->Pt.X >= Pt.X &&
- op2->Next->Pt.X <= op2->Pt.X && op2->Next->Pt.Y == Pt.Y)
+ while (op2->Next->Pt.x >= Pt.x &&
+ op2->Next->Pt.x <= op2->Pt.x && op2->Next->Pt.y == Pt.y)
op2 = op2->Next;
- if (!DiscardLeft && (op2->Pt.X != Pt.X)) op2 = op2->Next;
+ if (!DiscardLeft && (op2->Pt.x != Pt.x)) op2 = op2->Next;
op2b = DupOutPt(op2, DiscardLeft);
if (op2b->Pt != Pt)
{
@@ -3831,7 +3831,7 @@ bool Clipper::JoinPoints(Join *j, OutRec* outRec1, OutRec* outRec2)
//location at the Bottom of the overlapping segment (& Join.OffPt is above).
//3. StrictSimple joins where edges touch but are not collinear and where
//Join.OutPt1, Join.OutPt2 & Join.OffPt all share the same point.
- bool isHorizontal = (j->OutPt1->Pt.Y == j->OffPt.Y);
+ bool isHorizontal = (j->OutPt1->Pt.y == j->OffPt.y);
if (isHorizontal && (j->OffPt == j->OutPt1->Pt) &&
(j->OffPt == j->OutPt2->Pt))
@@ -3879,11 +3879,11 @@ bool Clipper::JoinPoints(Join *j, OutRec* outRec1, OutRec* outRec2)
op1b = j->OutPt1->Next;
while (op1b != op1 && (op1b->Pt == j->OffPt))
op1b = op1b->Next;
- bool reverse1 = (op1b->Pt.Y > j->OffPt.Y);
+ bool reverse1 = (op1b->Pt.y > j->OffPt.y);
op2b = j->OutPt2->Next;
while (op2b != op2 && (op2b->Pt == j->OffPt))
op2b = op2b->Next;
- bool reverse2 = (op2b->Pt.Y > j->OffPt.Y);
+ bool reverse2 = (op2b->Pt.y > j->OffPt.y);
if (reverse1 == reverse2) return false;
if (reverse1)
{
@@ -3915,22 +3915,22 @@ bool Clipper::JoinPoints(Join *j, OutRec* outRec1, OutRec* outRec2)
//them we're not yet sure where the overlapping is. OutPt1.Pt & OutPt2.Pt
//may be anywhere along the horizontal edge.
op1b = op1;
- while (op1->Prev->Pt.Y == op1->Pt.Y && op1->Prev != op1b && op1->Prev != op2)
+ while (op1->Prev->Pt.y == op1->Pt.y && op1->Prev != op1b && op1->Prev != op2)
op1 = op1->Prev;
- while (op1b->Next->Pt.Y == op1b->Pt.Y && op1b->Next != op1 && op1b->Next != op2)
+ while (op1b->Next->Pt.y == op1b->Pt.y && op1b->Next != op1 && op1b->Next != op2)
op1b = op1b->Next;
if (op1b->Next == op1 || op1b->Next == op2) return false; //a flat 'polygon'
op2b = op2;
- while (op2->Prev->Pt.Y == op2->Pt.Y && op2->Prev != op2b && op2->Prev != op1b)
+ while (op2->Prev->Pt.y == op2->Pt.y && op2->Prev != op2b && op2->Prev != op1b)
op2 = op2->Prev;
- while (op2b->Next->Pt.Y == op2b->Pt.Y && op2b->Next != op2 && op2b->Next != op1)
+ while (op2b->Next->Pt.y == op2b->Pt.y && op2b->Next != op2 && op2b->Next != op1)
op2b = op2b->Next;
if (op2b->Next == op2 || op2b->Next == op1) return false; //a flat 'polygon'
cInt Left, Right;
//Op1 --> Op1b & Op2 --> Op2b are the extremites of the horizontal edges
- if (!GetOverlap(op1->Pt.X, op1b->Pt.X, op2->Pt.X, op2b->Pt.X, Left, Right))
+ if (!GetOverlap(op1->Pt.x, op1b->Pt.x, op2->Pt.x, op2b->Pt.x, Left, Right))
return false;
//DiscardLeftSide: when overlapping edges are joined, a spike will created
@@ -3938,51 +3938,51 @@ bool Clipper::JoinPoints(Join *j, OutRec* outRec1, OutRec* outRec2)
//on the discard Side as either may still be needed for other joins ...
IntPoint Pt;
bool DiscardLeftSide;
- if (op1->Pt.X >= Left && op1->Pt.X <= Right)
+ if (op1->Pt.x >= Left && op1->Pt.x <= Right)
{
- Pt = op1->Pt; DiscardLeftSide = (op1->Pt.X > op1b->Pt.X);
+ Pt = op1->Pt; DiscardLeftSide = (op1->Pt.x > op1b->Pt.x);
}
- else if (op2->Pt.X >= Left&& op2->Pt.X <= Right)
+ else if (op2->Pt.x >= Left&& op2->Pt.x <= Right)
{
- Pt = op2->Pt; DiscardLeftSide = (op2->Pt.X > op2b->Pt.X);
+ Pt = op2->Pt; DiscardLeftSide = (op2->Pt.x > op2b->Pt.x);
}
- else if (op1b->Pt.X >= Left && op1b->Pt.X <= Right)
+ else if (op1b->Pt.x >= Left && op1b->Pt.x <= Right)
{
- Pt = op1b->Pt; DiscardLeftSide = op1b->Pt.X > op1->Pt.X;
+ Pt = op1b->Pt; DiscardLeftSide = op1b->Pt.x > op1->Pt.x;
}
else
{
- Pt = op2b->Pt; DiscardLeftSide = (op2b->Pt.X > op2->Pt.X);
+ Pt = op2b->Pt; DiscardLeftSide = (op2b->Pt.x > op2->Pt.x);
}
j->OutPt1 = op1; j->OutPt2 = op2;
return JoinHorz(op1, op1b, op2, op2b, Pt, DiscardLeftSide);
} else
{
//nb: For non-horizontal joins ...
- // 1. Jr.OutPt1.Pt.Y == Jr.OutPt2.Pt.Y
- // 2. Jr.OutPt1.Pt > Jr.OffPt.Y
+ // 1. Jr.OutPt1.Pt.y == Jr.OutPt2.Pt.y
+ // 2. Jr.OutPt1.Pt > Jr.OffPt.y
//make sure the polygons are correctly oriented ...
op1b = op1->Next;
while ((op1b->Pt == op1->Pt) && (op1b != op1)) op1b = op1b->Next;
- bool Reverse1 = ((op1b->Pt.Y > op1->Pt.Y) ||
+ bool Reverse1 = ((op1b->Pt.y > op1->Pt.y) ||
!SlopesEqual(op1->Pt, op1b->Pt, j->OffPt, m_UseFullRange));
if (Reverse1)
{
op1b = op1->Prev;
while ((op1b->Pt == op1->Pt) && (op1b != op1)) op1b = op1b->Prev;
- if ((op1b->Pt.Y > op1->Pt.Y) ||
+ if ((op1b->Pt.y > op1->Pt.y) ||
!SlopesEqual(op1->Pt, op1b->Pt, j->OffPt, m_UseFullRange)) return false;
};
op2b = op2->Next;
while ((op2b->Pt == op2->Pt) && (op2b != op2))op2b = op2b->Next;
- bool Reverse2 = ((op2b->Pt.Y > op2->Pt.Y) ||
+ bool Reverse2 = ((op2b->Pt.y > op2->Pt.y) ||
!SlopesEqual(op2->Pt, op2b->Pt, j->OffPt, m_UseFullRange));
if (Reverse2)
{
op2b = op2->Prev;
while ((op2b->Pt == op2->Pt) && (op2b != op2)) op2b = op2b->Prev;
- if ((op2b->Pt.Y > op2->Pt.Y) ||
+ if ((op2b->Pt.y > op2->Pt.y) ||
!SlopesEqual(op2->Pt, op2b->Pt, j->OffPt, m_UseFullRange)) return false;
}
@@ -4215,11 +4215,11 @@ void Clipper::JoinCommonEdges()
DoublePoint GetUnitNormal(const IntPoint &pt1, const IntPoint &pt2)
{
- if(pt2.X == pt1.X && pt2.Y == pt1.Y)
+ if(pt2.x == pt1.x && pt2.y == pt1.y)
return DoublePoint(0, 0);
- double Dx = (double)(pt2.X - pt1.X);
- double dy = (double)(pt2.Y - pt1.Y);
+ double Dx = (double)(pt2.x - pt1.x);
+ double dy = (double)(pt2.y - pt1.y);
double f = 1 *1.0/ std::sqrt( Dx*Dx + dy*dy );
Dx *= f;
dy *= f;
@@ -4234,7 +4234,7 @@ ClipperOffset::ClipperOffset(double miterLimit, double arcTolerance)
{
this->MiterLimit = miterLimit;
this->ArcTolerance = arcTolerance;
- m_lowest.X = -1;
+ m_lowest.x = -1;
}
//------------------------------------------------------------------------------
@@ -4249,7 +4249,7 @@ void ClipperOffset::Clear()
for (int i = 0; i < m_polyNodes.ChildCount(); ++i)
delete m_polyNodes.Childs[i];
m_polyNodes.Childs.clear();
- m_lowest.X = -1;
+ m_lowest.x = -1;
}
//------------------------------------------------------------------------------
@@ -4272,9 +4272,9 @@ void ClipperOffset::AddPath(const Path& path, JoinType joinType, EndType endType
{
j++;
newNode->Contour.push_back(path[i]);
- if (path[i].Y > newNode->Contour[k].Y ||
- (path[i].Y == newNode->Contour[k].Y &&
- path[i].X < newNode->Contour[k].X)) k = j;
+ if (path[i].y > newNode->Contour[k].y ||
+ (path[i].y == newNode->Contour[k].y &&
+ path[i].x < newNode->Contour[k].x)) k = j;
}
if (endType == etClosedPolygon && j < 2)
{
@@ -4285,14 +4285,14 @@ void ClipperOffset::AddPath(const Path& path, JoinType joinType, EndType endType
//if this path's lowest pt is lower than all the others then update m_lowest
if (endType != etClosedPolygon) return;
- if (m_lowest.X < 0)
+ if (m_lowest.x < 0)
m_lowest = IntPoint(m_polyNodes.ChildCount() - 1, k);
else
{
- IntPoint ip = m_polyNodes.Childs[(int)m_lowest.X]->Contour[(int)m_lowest.Y];
- if (newNode->Contour[k].Y > ip.Y ||
- (newNode->Contour[k].Y == ip.Y &&
- newNode->Contour[k].X < ip.X))
+ IntPoint ip = m_polyNodes.Childs[(int)m_lowest.x]->Contour[(int)m_lowest.y];
+ if (newNode->Contour[k].y > ip.y ||
+ (newNode->Contour[k].y == ip.y &&
+ newNode->Contour[k].x < ip.x))
m_lowest = IntPoint(m_polyNodes.ChildCount() - 1, k);
}
}
@@ -4309,8 +4309,8 @@ void ClipperOffset::FixOrientations()
{
//fixup orientations of all closed paths if the orientation of the
//closed path with the lowermost vertex is wrong ...
- if (m_lowest.X >= 0 &&
- !Orientation(m_polyNodes.Childs[(int)m_lowest.X]->Contour))
+ if (m_lowest.x >= 0 &&
+ !Orientation(m_polyNodes.Childs[(int)m_lowest.x]->Contour))
{
for (int i = 0; i < m_polyNodes.ChildCount(); ++i)
{
@@ -4457,8 +4457,8 @@ void ClipperOffset::DoOffset(double delta)
for (cInt j = 1; j <= steps; j++)
{
m_destPoly.push_back(IntPoint(
- Round(m_srcPoly[0].X + X * delta),
- Round(m_srcPoly[0].Y + Y * delta)));
+ Round(m_srcPoly[0].x + X * delta),
+ Round(m_srcPoly[0].y + Y * delta)));
double X2 = X;
X = X * m_cos - m_sin * Y;
Y = X2 * m_sin + Y * m_cos;
@@ -4470,8 +4470,8 @@ void ClipperOffset::DoOffset(double delta)
for (int j = 0; j < 4; ++j)
{
m_destPoly.push_back(IntPoint(
- Round(m_srcPoly[0].X + X * delta),
- Round(m_srcPoly[0].Y + Y * delta)));
+ Round(m_srcPoly[0].x + X * delta),
+ Round(m_srcPoly[0].y + Y * delta)));
if (X < 0) X = 1;
else if (Y < 0) Y = 1;
else X = -1;
@@ -4507,8 +4507,8 @@ void ClipperOffset::DoOffset(double delta)
//re-build m_normals ...
DoublePoint n = m_normals[len -1];
for (int j = len - 1; j > 0; j--)
- m_normals[j] = DoublePoint(-m_normals[j - 1].X, -m_normals[j - 1].Y);
- m_normals[0] = DoublePoint(-n.X, -n.Y);
+ m_normals[j] = DoublePoint(-m_normals[j - 1].x, -m_normals[j - 1].y);
+ m_normals[0] = DoublePoint(-n.x, -n.y);
k = 0;
for (int j = len - 1; j >= 0; j--)
OffsetPoint(j, k, node.m_jointype);
@@ -4524,11 +4524,11 @@ void ClipperOffset::DoOffset(double delta)
if (node.m_endtype == etOpenButt)
{
int j = len - 1;
- pt1 = IntPoint((cInt)Round(m_srcPoly[j].X + m_normals[j].X *
- delta), (cInt)Round(m_srcPoly[j].Y + m_normals[j].Y * delta));
+ pt1 = IntPoint((cInt)Round(m_srcPoly[j].x + m_normals[j].x *
+ delta), (cInt)Round(m_srcPoly[j].y + m_normals[j].y * delta));
m_destPoly.push_back(pt1);
- pt1 = IntPoint((cInt)Round(m_srcPoly[j].X - m_normals[j].X *
- delta), (cInt)Round(m_srcPoly[j].Y - m_normals[j].Y * delta));
+ pt1 = IntPoint((cInt)Round(m_srcPoly[j].x - m_normals[j].x *
+ delta), (cInt)Round(m_srcPoly[j].y - m_normals[j].y * delta));
m_destPoly.push_back(pt1);
}
else
@@ -4536,7 +4536,7 @@ void ClipperOffset::DoOffset(double delta)
int j = len - 1;
k = len - 2;
m_sinA = 0;
- m_normals[j] = DoublePoint(-m_normals[j].X, -m_normals[j].Y);
+ m_normals[j] = DoublePoint(-m_normals[j].x, -m_normals[j].y);
if (node.m_endtype == etOpenSquare)
DoSquare(j, k);
else
@@ -4545,19 +4545,19 @@ void ClipperOffset::DoOffset(double delta)
//re-build m_normals ...
for (int j = len - 1; j > 0; j--)
- m_normals[j] = DoublePoint(-m_normals[j - 1].X, -m_normals[j - 1].Y);
- m_normals[0] = DoublePoint(-m_normals[1].X, -m_normals[1].Y);
+ m_normals[j] = DoublePoint(-m_normals[j - 1].x, -m_normals[j - 1].y);
+ m_normals[0] = DoublePoint(-m_normals[1].x, -m_normals[1].y);
k = len - 1;
for (int j = k - 1; j > 0; --j) OffsetPoint(j, k, node.m_jointype);
if (node.m_endtype == etOpenButt)
{
- pt1 = IntPoint((cInt)Round(m_srcPoly[0].X - m_normals[0].X * delta),
- (cInt)Round(m_srcPoly[0].Y - m_normals[0].Y * delta));
+ pt1 = IntPoint((cInt)Round(m_srcPoly[0].x - m_normals[0].x * delta),
+ (cInt)Round(m_srcPoly[0].y - m_normals[0].y * delta));
m_destPoly.push_back(pt1);
- pt1 = IntPoint((cInt)Round(m_srcPoly[0].X + m_normals[0].X * delta),
- (cInt)Round(m_srcPoly[0].Y + m_normals[0].Y * delta));
+ pt1 = IntPoint((cInt)Round(m_srcPoly[0].x + m_normals[0].x * delta),
+ (cInt)Round(m_srcPoly[0].y + m_normals[0].y * delta));
m_destPoly.push_back(pt1);
}
else
@@ -4578,15 +4578,15 @@ void ClipperOffset::DoOffset(double delta)
void ClipperOffset::OffsetPoint(int j, int& k, JoinType jointype)
{
//cross product ...
- m_sinA = (m_normals[k].X * m_normals[j].Y - m_normals[j].X * m_normals[k].Y);
+ m_sinA = (m_normals[k].x * m_normals[j].y - m_normals[j].x * m_normals[k].y);
if (std::fabs(m_sinA * m_delta) < 1.0)
{
//dot product ...
- double cosA = (m_normals[k].X * m_normals[j].X + m_normals[j].Y * m_normals[k].Y );
+ double cosA = (m_normals[k].x * m_normals[j].x + m_normals[j].y * m_normals[k].y );
if (cosA > 0) // angle => 0 degrees
{
- m_destPoly.push_back(IntPoint(Round(m_srcPoly[j].X + m_normals[k].X * m_delta),
- Round(m_srcPoly[j].Y + m_normals[k].Y * m_delta)));
+ m_destPoly.push_back(IntPoint(Round(m_srcPoly[j].x + m_normals[k].x * m_delta),
+ Round(m_srcPoly[j].y + m_normals[k].y * m_delta)));
return;
}
//else angle => 180 degrees
@@ -4596,19 +4596,19 @@ void ClipperOffset::OffsetPoint(int j, int& k, JoinType jointype)
if (m_sinA * m_delta < 0)
{
- m_destPoly.push_back(IntPoint(Round(m_srcPoly[j].X + m_normals[k].X * m_delta),
- Round(m_srcPoly[j].Y + m_normals[k].Y * m_delta)));
+ m_destPoly.push_back(IntPoint(Round(m_srcPoly[j].x + m_normals[k].x * m_delta),
+ Round(m_srcPoly[j].y + m_normals[k].y * m_delta)));
m_destPoly.push_back(m_srcPoly[j]);
- m_destPoly.push_back(IntPoint(Round(m_srcPoly[j].X + m_normals[j].X * m_delta),
- Round(m_srcPoly[j].Y + m_normals[j].Y * m_delta)));
+ m_destPoly.push_back(IntPoint(Round(m_srcPoly[j].x + m_normals[j].x * m_delta),
+ Round(m_srcPoly[j].y + m_normals[j].y * m_delta)));
}
else
switch (jointype)
{
case jtMiter:
{
- double r = 1 + (m_normals[j].X * m_normals[k].X +
- m_normals[j].Y * m_normals[k].Y);
+ double r = 1 + (m_normals[j].x * m_normals[k].x +
+ m_normals[j].y * m_normals[k].y);
if (r >= m_miterLim) DoMiter(j, k, r); else DoSquare(j, k);
break;
}
@@ -4622,43 +4622,43 @@ void ClipperOffset::OffsetPoint(int j, int& k, JoinType jointype)
void ClipperOffset::DoSquare(int j, int k)
{
double dx = std::tan(std::atan2(m_sinA,
- m_normals[k].X * m_normals[j].X + m_normals[k].Y * m_normals[j].Y) / 4);
+ m_normals[k].x * m_normals[j].x + m_normals[k].y * m_normals[j].y) / 4);
m_destPoly.push_back(IntPoint(
- Round(m_srcPoly[j].X + m_delta * (m_normals[k].X - m_normals[k].Y * dx)),
- Round(m_srcPoly[j].Y + m_delta * (m_normals[k].Y + m_normals[k].X * dx))));
+ Round(m_srcPoly[j].x + m_delta * (m_normals[k].x - m_normals[k].y * dx)),
+ Round(m_srcPoly[j].y + m_delta * (m_normals[k].y + m_normals[k].x * dx))));
m_destPoly.push_back(IntPoint(
- Round(m_srcPoly[j].X + m_delta * (m_normals[j].X + m_normals[j].Y * dx)),
- Round(m_srcPoly[j].Y + m_delta * (m_normals[j].Y - m_normals[j].X * dx))));
+ Round(m_srcPoly[j].x + m_delta * (m_normals[j].x + m_normals[j].y * dx)),
+ Round(m_srcPoly[j].y + m_delta * (m_normals[j].y - m_normals[j].x * dx))));
}
//------------------------------------------------------------------------------
void ClipperOffset::DoMiter(int j, int k, double r)
{
double q = m_delta / r;
- m_destPoly.push_back(IntPoint(Round(m_srcPoly[j].X + (m_normals[k].X + m_normals[j].X) * q),
- Round(m_srcPoly[j].Y + (m_normals[k].Y + m_normals[j].Y) * q)));
+ m_destPoly.push_back(IntPoint(Round(m_srcPoly[j].x + (m_normals[k].x + m_normals[j].x) * q),
+ Round(m_srcPoly[j].y + (m_normals[k].y + m_normals[j].y) * q)));
}
//------------------------------------------------------------------------------
void ClipperOffset::DoRound(int j, int k)
{
double a = std::atan2(m_sinA,
- m_normals[k].X * m_normals[j].X + m_normals[k].Y * m_normals[j].Y);
+ m_normals[k].x * m_normals[j].x + m_normals[k].y * m_normals[j].y);
int steps = std::max((int)Round(m_StepsPerRad * std::fabs(a)), 1);
- double X = m_normals[k].X, Y = m_normals[k].Y, X2;
+ double X = m_normals[k].x, Y = m_normals[k].y, X2;
for (int i = 0; i < steps; ++i)
{
m_destPoly.push_back(IntPoint(
- Round(m_srcPoly[j].X + X * m_delta),
- Round(m_srcPoly[j].Y + Y * m_delta)));
+ Round(m_srcPoly[j].x + X * m_delta),
+ Round(m_srcPoly[j].y + Y * m_delta)));
X2 = X;
X = X * m_cos - m_sin * Y;
Y = X2 * m_sin + Y * m_cos;
}
m_destPoly.push_back(IntPoint(
- Round(m_srcPoly[j].X + m_normals[j].X * m_delta),
- Round(m_srcPoly[j].Y + m_normals[j].Y * m_delta)));
+ Round(m_srcPoly[j].x + m_normals[j].x * m_delta),
+ Round(m_srcPoly[j].y + m_normals[j].y * m_delta)));
}
//------------------------------------------------------------------------------
@@ -4667,19 +4667,19 @@ void ClipperOffset::DoRound(int j, int k)
bool SortOutPt(OutPt* op1, OutPt* op2)
{
- if (op1->Pt.Y > op2->Pt.Y)
+ if (op1->Pt.y > op2->Pt.y)
{
return true;
}
- else if (op1->Pt.Y < op2->Pt.Y)
+ else if (op1->Pt.y < op2->Pt.y)
{
return false;
}
- else if (op1->Pt.X < op2->Pt.X)
+ else if (op1->Pt.x < op2->Pt.x)
{
return true;
}
- else if (op1->Pt.X > op2->Pt.X)
+ else if (op1->Pt.x > op2->Pt.x)
{
return false;
}
@@ -5377,8 +5377,8 @@ void SimplifyPolygons(Paths &polys, PolyFillType fillType)
inline double DistanceSqrd(const IntPoint& pt1, const IntPoint& pt2)
{
- double Dx = ((double)pt1.X - pt2.X);
- double dy = ((double)pt1.Y - pt2.Y);
+ double Dx = ((double)pt1.x - pt2.x);
+ double dy = ((double)pt1.y - pt2.y);
return (Dx*Dx + dy*dy);
}
//------------------------------------------------------------------------------
@@ -5392,10 +5392,10 @@ double DistanceFromLineSqrd(
//A = (y¹ - y²); B = (x² - x¹); C = (y² - y¹)x¹ - (x² - x¹)y¹
//perpendicular distance of point (x³,y³) = (Ax³ + By³ + C)/Sqrt(A² + B²)
//see http://en.wikipedia.org/wiki/Perpendicular_distance
- double A = double(ln1.Y - ln2.Y);
- double B = double(ln2.X - ln1.X);
- double C = A * ln1.X + B * ln1.Y;
- C = A * pt.X + B * pt.Y - C;
+ double A = double(ln1.y - ln2.y);
+ double B = double(ln2.x - ln1.x);
+ double C = A * ln1.x + B * ln1.y;
+ C = A * pt.x + B * pt.y - C;
return (C * C) / (A * A + B * B);
}
//---------------------------------------------------------------------------
@@ -5406,20 +5406,20 @@ bool SlopesNearCollinear(const IntPoint& pt1,
//this function is more accurate when the point that's geometrically
//between the other 2 points is the one that's tested for distance.
//ie makes it more likely to pick up 'spikes' ...
- if (Abs(pt1.X - pt2.X) > Abs(pt1.Y - pt2.Y))
+ if (Abs(pt1.x - pt2.x) > Abs(pt1.y - pt2.y))
{
- if ((pt1.X > pt2.X) == (pt1.X < pt3.X))
+ if ((pt1.x > pt2.x) == (pt1.x < pt3.x))
return DistanceFromLineSqrd(pt1, pt2, pt3) < distSqrd;
- else if ((pt2.X > pt1.X) == (pt2.X < pt3.X))
+ else if ((pt2.x > pt1.x) == (pt2.x < pt3.x))
return DistanceFromLineSqrd(pt2, pt1, pt3) < distSqrd;
else
return DistanceFromLineSqrd(pt3, pt1, pt2) < distSqrd;
}
else
{
- if ((pt1.Y > pt2.Y) == (pt1.Y < pt3.Y))
+ if ((pt1.y > pt2.y) == (pt1.y < pt3.y))
return DistanceFromLineSqrd(pt1, pt2, pt3) < distSqrd;
- else if ((pt2.Y > pt1.Y) == (pt2.Y < pt3.Y))
+ else if ((pt2.y > pt1.y) == (pt2.y < pt3.y))
return DistanceFromLineSqrd(pt2, pt1, pt3) < distSqrd;
else
return DistanceFromLineSqrd(pt3, pt1, pt2) < distSqrd;
@@ -5429,8 +5429,8 @@ bool SlopesNearCollinear(const IntPoint& pt1,
bool PointsAreClose(IntPoint pt1, IntPoint pt2, double distSqrd)
{
- double Dx = (double)pt1.X - pt2.X;
- double dy = (double)pt1.Y - pt2.Y;
+ double Dx = (double)pt1.x - pt2.x;
+ double dy = (double)pt1.y - pt2.y;
return ((Dx * Dx) + (dy * dy) <= distSqrd);
}
//------------------------------------------------------------------------------
@@ -5539,7 +5539,7 @@ void Minkowski(const Path& poly, const Path& path,
Path p;
p.reserve(polyCnt);
for (size_t j = 0; j < poly.size(); ++j)
- p.push_back(IntPoint(path[i].X + poly[j].X, path[i].Y + poly[j].Y));
+ p.push_back(IntPoint(path[i].x + poly[j].x, path[i].y + poly[j].y));
pp.push_back(p);
}
else
@@ -5548,7 +5548,7 @@ void Minkowski(const Path& poly, const Path& path,
Path p;
p.reserve(polyCnt);
for (size_t j = 0; j < poly.size(); ++j)
- p.push_back(IntPoint(path[i].X - poly[j].X, path[i].Y - poly[j].Y));
+ p.push_back(IntPoint(path[i].x - poly[j].x, path[i].y - poly[j].y));
pp.push_back(p);
}
@@ -5583,7 +5583,7 @@ void TranslatePath(const Path& input, Path& output, const IntPoint delta)
//precondition: input != output
output.resize(input.size());
for (size_t i = 0; i < input.size(); ++i)
- output[i] = IntPoint(input[i].X + delta.X, input[i].Y + delta.Y);
+ output[i] = IntPoint(input[i].x + delta.x, input[i].y + delta.y);
}
//------------------------------------------------------------------------------
@@ -5659,7 +5659,7 @@ void OpenPathsFromPolyTree(PolyTree& polytree, Paths& paths)
std::ostream& operator <<(std::ostream &s, const IntPoint &p)
{
- s << "(" << p.X << "," << p.Y << ")";
+ s << "(" << p.x << "," << p.y << ")";
return s;
}
//------------------------------------------------------------------------------
@@ -5669,8 +5669,8 @@ std::ostream& operator <<(std::ostream &s, const Path &p)
if (p.empty()) return s;
Path::size_type last = p.size() -1;
for (Path::size_type i = 0; i < last; i++)
- s << "(" << p[i].X << "," << p[i].Y << "), ";
- s << "(" << p[last].X << "," << p[last].Y << ")\n";
+ s << "(" << p[i].x << "," << p[i].y << "), ";
+ s << "(" << p[last].x << "," << p[last].y << ")\n";
return s;
}
//------------------------------------------------------------------------------
diff --git a/src/clipper/clipper.hpp b/src/clipper/clipper.hpp
index d7eb334207..661aeb33e6 100644
--- a/src/clipper/clipper.hpp
+++ b/src/clipper/clipper.hpp
@@ -93,22 +93,22 @@ typedef CLIPPER_INTPOINT_IMPL IntPoint;
#else
struct IntPoint {
- cInt X;
- cInt Y;
+ cInt x;
+ cInt y;
#ifdef use_xyz
cInt Z;
- IntPoint(cInt x = 0, cInt y = 0, cInt z = 0): X(x), Y(y), Z(z) {};
+ IntPoint(cInt _x = 0, cInt _y = 0, cInt z = 0): x(_x), y(_y), Z(z) {};
#else
- IntPoint(cInt x = 0, cInt y = 0): X(x), Y(y) {};
+ IntPoint(cInt _x = 0, cInt _y = 0): x(_x), y(_y) {};
#endif
friend inline bool operator== (const IntPoint& a, const IntPoint& b)
{
- return a.X == b.X && a.Y == b.Y;
+ return a.x == b.x && a.y == b.y;
}
friend inline bool operator!= (const IntPoint& a, const IntPoint& b)
{
- return a.X != b.X || a.Y != b.Y;
+ return a.x != b.x || a.y != b.y;
}
};
#endif
@@ -147,10 +147,10 @@ std::ostream& operator <<(std::ostream &s, const Paths &p);
struct DoublePoint
{
- double X;
- double Y;
- DoublePoint(double x = 0, double y = 0) : X(x), Y(y) {}
- DoublePoint(IntPoint ip) : X((double)ip.X), Y((double)ip.Y) {}
+ double x;
+ double y;
+ DoublePoint(double _x = 0, double _y = 0) : x(_x), y(_y) {}
+ DoublePoint(IntPoint ip) : x((double)ip.x), y((double)ip.y) {}
};
//------------------------------------------------------------------------------
diff --git a/src/clipper/fix_members.sh b/src/clipper/fix_members.sh
new file mode 100755
index 0000000000..998d45f0d6
--- /dev/null
+++ b/src/clipper/fix_members.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+
+export ROOTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+perl -i -p -e "s/\.X/\.x/g;" ${ROOTDIR}/clipper.*
+perl -i -p -e "s/\->X/\->x/g;" ${ROOTDIR}/clipper.*
+perl -i -p -e "s/cInt X;/cInt x;/g;" ${ROOTDIR}/clipper.*
+perl -i -p -e "s/double X;/double x;/g;" ${ROOTDIR}/clipper.*
+perl -i -p -e "s/X\(x\)/x\(_x\)/g;" ${ROOTDIR}/clipper.*
+perl -i -p -e "s/X\(\(/x\(\(/g;" ${ROOTDIR}/clipper.*
+perl -i -p -e "s/double x = 0/double _x = 0/g;" ${ROOTDIR}/clipper.*
+perl -i -p -e "s/cInt x = 0/cInt _x = 0/g;" ${ROOTDIR}/clipper.*
+
+perl -i -p -e "s/\.Y/\.y/g;" ${ROOTDIR}/clipper.*
+perl -i -p -e "s/\->Y/\->y/g;" ${ROOTDIR}/clipper.*
+perl -i -p -e "s/cInt Y;/cInt y;/g;" ${ROOTDIR}/clipper.*
+perl -i -p -e "s/double Y;/double y;/g;" ${ROOTDIR}/clipper.*
+perl -i -p -e "s/Y\(y\)/y\(_y\)/g;" ${ROOTDIR}/clipper.*
+perl -i -p -e "s/Y\(\(/y\(\(/g;" ${ROOTDIR}/clipper.*
+perl -i -p -e "s/cInt Y;/cInt y;/g;" ${ROOTDIR}/clipper.*
+perl -i -p -e "s/double y = 0/double _y = 0/g;" ${ROOTDIR}/clipper.*
+perl -i -p -e "s/cInt y = 0/cInt _y = 0/g;" ${ROOTDIR}/clipper.*
+
+