From b58d6d6ccf9c622f2377cf6c0c3487a8897aba6d Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 11 May 2011 00:25:37 +0200 Subject: Graph: Add comments 'n questions (FIXME?) --- .../jogamp/graph/curve/tess/CDTriangulator2D.java | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src/jogl/classes/com/jogamp') 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 vertices = polyline.getVertices(); + // FIXME: remove implicit iterator for(Vertex vert: vertices){ for (Loop loop:loops){ if(loop.checkInside(vert)){ -- cgit v1.2.3