Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Education
Marble
Commits
73c4289d
Commit
73c4289d
authored
Sep 17, 2020
by
Volker Krause
Browse files
Update clipper code to 6.4.2 from upstream
parent
10a880c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
tools/vectorosm-tilecreator/clipper/clipper.cpp
View file @
73c4289d
/*******************************************************************************
* *
* Author : Angus Johnson *
* Version : 6.4.
0
*
* Date : 2
July 2015
*
* Version : 6.4.
2
*
* Date : 2
7 February 2017
*
* Website : http://www.angusj.com *
* Copyright : Angus Johnson 2010-201
5
*
* Copyright : Angus Johnson 2010-201
7
*
* *
* License: *
* Use, modification & distribution is subject to Boost Software License Ver 1. *
...
...
@@ -14,7 +14,7 @@
* The code in this library is an extension of Bala Vatti's clipping algorithm: *
* "A generic solution to polygon clipping" *
* Communications of the ACM, Vol 35, Issue 7 (July 1992) pp 56-63. *
*
https://
d
l.acm.org/citation.cfm?id=129906 *
* https://
porta
l.acm.org/citation.cfm?id=129906 *
* *
* Computer graphics and geometric modeling: implementation and algorithms *
* By Max K. Agoston *
...
...
@@ -27,7 +27,7 @@
* ASME 2005 International Design Engineering Technical Conferences *
* and Computers and Information in Engineering Conference (IDETC/CIE2005) *
* September 24-28, 2005 , Long Beach, California, USA *
* https://
mcmains
.me.berkeley.edu/pubs/DAC05OffsetPolygon.pdf
*
* https://
www
.me.berkeley.edu/
~mcmains/
pubs/DAC05OffsetPolygon.pdf *
* *
*******************************************************************************/
...
...
@@ -1626,7 +1626,7 @@ bool Clipper::ExecuteInternal()
void
Clipper
::
SetWindingCount
(
TEdge
&
edge
)
{
TEdge
*
e
=
edge
.
PrevInAEL
;
//find the edge of the same polytype that immediately prece
d
es 'edge' in AEL
//find the edge of the same polytype that immediately precee
d
s 'edge' in AEL
while
(
e
&&
((
e
->
PolyTyp
!=
edge
.
PolyTyp
)
||
(
e
->
WindDelta
==
0
)))
e
=
e
->
PrevInAEL
;
if
(
!
e
)
{
...
...
@@ -1868,7 +1868,7 @@ OutPt* Clipper::AddLocalMinPoly(TEdge *e1, TEdge *e2, const IntPoint &Pt)
prevE
=
e
->
PrevInAEL
;
}
if
(
prevE
&&
prevE
->
OutIdx
>=
0
)
if
(
prevE
&&
prevE
->
OutIdx
>=
0
&&
prevE
->
Top
.
Y
<
Pt
.
Y
&&
e
->
Top
.
Y
<
Pt
.
Y
)
{
cInt
xPrev
=
TopX
(
*
prevE
,
Pt
.
Y
);
cInt
xE
=
TopX
(
*
e
,
Pt
.
Y
);
...
...
@@ -2715,7 +2715,11 @@ void Clipper::ProcessHorizontal(TEdge *horzEdge)
if
(
horzEdge
->
OutIdx
>=
0
&&
!
IsOpen
)
//note: may be done multiple times
{
op1
=
AddOutPt
(
horzEdge
,
e
->
Curr
);
#ifdef use_xyz
if
(
dir
==
dLeftToRight
)
SetZ
(
e
->
Curr
,
*
horzEdge
,
*
e
);
else
SetZ
(
e
->
Curr
,
*
e
,
*
horzEdge
);
#endif
op1
=
AddOutPt
(
horzEdge
,
e
->
Curr
);
TEdge
*
eNextHorz
=
m_SortedEdges
;
while
(
eNextHorz
)
{
...
...
@@ -3041,7 +3045,10 @@ void Clipper::ProcessEdgesAtTopOfScanbeam(const cInt topY)
{
e
->
Curr
.
X
=
TopX
(
*
e
,
topY
);
e
->
Curr
.
Y
=
topY
;
}
#ifdef use_xyz
e
->
Curr
.
Z
=
topY
==
e
->
Top
.
Y
?
e
->
Top
.
Z
:
(
topY
==
e
->
Bot
.
Y
?
e
->
Bot
.
Z
:
0
);
#endif
}
//When StrictlySimple and 'e' is being touched by another edge, then
//make sure both edges have a vertex here ...
...
...
@@ -3665,7 +3672,7 @@ void Clipper::FixupFirstLefts3(OutRec* OldOutRec, OutRec* NewOutRec)
{
OutRec
*
outRec
=
m_PolyOuts
[
i
];
OutRec
*
firstLeft
=
ParseFirstLeft
(
outRec
->
FirstLeft
);
if
(
outRec
->
Pts
&&
outRec
->
F
irstLeft
==
OldOutRec
)
if
(
outRec
->
Pts
&&
f
irstLeft
==
OldOutRec
)
outRec
->
FirstLeft
=
NewOutRec
;
}
}
...
...
tools/vectorosm-tilecreator/clipper/clipper.hpp
View file @
73c4289d
/*******************************************************************************
* *
* Author : Angus Johnson *
* Version : 6.4.
0
*
* Date : 2
July 2015
*
* Version : 6.4.
2
*
* Date : 2
7 February 2017
*
* Website : http://www.angusj.com *
* Copyright : Angus Johnson 2010-201
5
*
* Copyright : Angus Johnson 2010-201
7
*
* *
* License: *
* Use, modification & distribution is subject to Boost Software License Ver 1. *
...
...
@@ -14,7 +14,7 @@
* The code in this library is an extension of Bala Vatti's clipping algorithm: *
* "A generic solution to polygon clipping" *
* Communications of the ACM, Vol 35, Issue 7 (July 1992) pp 56-63. *
* http
s
://
d
l.acm.org/citation.cfm?id=129906
*
* http://
porta
l.acm.org/citation.cfm?id=129906 *
* *
* Computer graphics and geometric modeling: implementation and algorithms *
* By Max K. Agoston *
...
...
@@ -27,14 +27,14 @@
* ASME 2005 International Design Engineering Technical Conferences *
* and Computers and Information in Engineering Conference (IDETC/CIE2005) *
* September 24-28, 2005 , Long Beach, California, USA *
* https://
mcmains
.me.berkeley.edu/pubs/DAC05OffsetPolygon.pdf
*
* https://
www
.me.berkeley.edu/
~mcmains/
pubs/DAC05OffsetPolygon.pdf *
* *
*******************************************************************************/
#ifndef clipper_hpp
#define clipper_hpp
#define CLIPPER_VERSION "6.
2.6
"
#define CLIPPER_VERSION "6.
4.2
"
//use_int32: When enabled 32bit ints are used instead of 64bit ints. This
//improve performance but coordinate values are limited to the range +/- 46340
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment