diff options
Diffstat (limited to 'src/jogl/classes/com')
-rw-r--r-- | src/jogl/classes/com/jogamp/graph/curve/tess/CDTriangulator2D.java | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/tess/CDTriangulator2D.java b/src/jogl/classes/com/jogamp/graph/curve/tess/CDTriangulator2D.java index e0d7d3236..4c1ea3fe6 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/tess/CDTriangulator2D.java +++ b/src/jogl/classes/com/jogamp/graph/curve/tess/CDTriangulator2D.java @@ -80,19 +80,25 @@ public class CDTriangulator2D { public void addCurve(Outline polyline){ Loop loop = null; - if(!loops.isEmpty()){ + // FIXME: multiple in/out and CW/CCW tests (as follows) ?? + + if(!loops.isEmpty()) { + // FIXME: #1 in/out test loop = getContainerLoop(polyline); } if(loop == null) { + // Claim: CCW (out) GraphOutline outline = new GraphOutline(polyline); + // FIXME: #2/#3 extract..(CCW) and new Loop(CCW).. does CW/CCW tests GraphOutline innerPoly = extractBoundaryTriangles(outline, false); vertices.addAll(polyline.getVertices()); loop = new Loop(innerPoly, VectorUtil.Winding.CCW); loops.add(loop); - } - else { + } else { + // Claim: CW (in) GraphOutline outline = new GraphOutline(polyline); + // FIXME: #3/#4 extract..(CW) and addContraint..(CW) does CW/CCW tests GraphOutline innerPoly = extractBoundaryTriangles(outline, true); vertices.addAll(innerPoly.getVertices()); loop.addConstraintCurve(innerPoly); @@ -159,12 +165,12 @@ public class CDTriangulator2D { gv1.setBoundaryContained(true); gv2.setBoundaryContained(true); - Triangle t= null; - boolean holeLike = false; - if(VectorUtil.ccw(v0,v1,v2)){ + final Triangle t; + final boolean holeLike; + if(VectorUtil.ccw(v0,v1,v2)) { + holeLike = false; t = new Triangle(v0, v1, v2); - } - else { + } else { holeLike = true; t = new Triangle(v2, v1, v0); } @@ -196,6 +202,7 @@ public class CDTriangulator2D { private Loop getContainerLoop(Outline polyline){ ArrayList<Vertex> vertices = polyline.getVertices(); + // FIXME: remove implicit iterator for(Vertex vert: vertices){ for (Loop loop:loops){ if(loop.checkInside(vert)){ |