if( bIsCleared )
maClipPoly = maPendingPolygons; else
maClipPoly = utils::solvePolygonOperationAnd(
maClipPoly,
maPendingPolygons); break; caseXOR: if( bIsEmpty )
maClipPoly = maPendingPolygons; elseif( bIsCleared )
{ // not representable, strictly speaking, // using polygons with the common even/odd // or nonzero winding number fill rule. If // we'd want to represent it, fill rule // would need to be "non-negative winding // number" (and we then would return // 'holes' here)
// going for an ugly hack meanwhile
maClipPoly = utils::solvePolygonOperationXor(
B2DPolyPolygon(
utils::createPolygonFromRect(B2DRange(-1E20,-1E20,1E20,1E20))),
maPendingPolygons);
} else
maClipPoly = utils::solvePolygonOperationXor(
maClipPoly,
maPendingPolygons); break; case SUBTRACT:
assert( !bIsEmpty );
// first union all pending ones, subtract en bloc then
maPendingPolygons = solveCrossovers(maPendingPolygons);
maPendingPolygons = stripNeutralPolygons(maPendingPolygons);
maPendingPolygons = stripDispensablePolygons(maPendingPolygons);
if( bIsCleared )
{ // not representable, strictly speaking, // using polygons with the common even/odd // or nonzero winding number fill rule. If // we'd want to represent it, fill rule // would need to be "non-negative winding // number" (and we then would return // 'holes' here)
// use the specialized range clipper for the win
B2DPolyPolygon aCollectedRanges; constbool bIsEmpty=isNullClipPoly(); constbool bIsCleared=!maClipPoly.count(); switch(mePendingOps)
{ caseUNION:
assert( !bIsCleared );
if( bIsEmpty )
maClipPoly = aCollectedRanges; elseif( bIsCleared )
{ // not representable, strictly speaking, // using polygons with the common even/odd // or nonzero winding number fill rule. If // we'd want to represent it, fill rule // would need to be "non-negative winding // number" (and we then would return // 'holes' here)
// going for an ugly hack meanwhile
maClipPoly = utils::solvePolygonOperationXor(
B2DPolyPolygon(
utils::createPolygonFromRect(B2DRange(-1E20,-1E20,1E20,1E20))),
aCollectedRanges);
} else
maClipPoly = utils::solvePolygonOperationXor(
maClipPoly,
aCollectedRanges); break; case SUBTRACT:
assert( !bIsEmpty );
// first union all pending ranges, subtract en bloc then
aCollectedRanges = maPendingRanges.solveCrossovers();
aCollectedRanges = stripNeutralPolygons(aCollectedRanges);
aCollectedRanges = stripDispensablePolygons(aCollectedRanges);
if( bIsCleared )
{ // not representable, strictly speaking, // using polygons with the common even/odd // or nonzero winding number fill rule. If // we'd want to represent it, fill rule // would need to be "non-negative winding // number" (and we then would return // 'holes' here)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.