summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/com/jogamp')
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/tess/CDTriangulator2D.java21
1 files changed, 10 insertions, 11 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 4c1ea3fe6..9de295616 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/tess/CDTriangulator2D.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/tess/CDTriangulator2D.java
@@ -88,17 +88,13 @@ public class CDTriangulator2D {
}
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 {
- // 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);
@@ -200,14 +196,17 @@ public class CDTriangulator2D {
return innerOutline;
}
- private Loop getContainerLoop(Outline polyline){
+ 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)){
- return loop;
- }
+ for(int i=0; i < loops.size(); i++) {
+ Loop loop = loops.get(i);
+ boolean inside = false;
+ for(int j=0; j < vertices.size(); j++) {
+ Vertex v = vertices.get(j);
+ inside |= loop.checkInside(v);
+ }
+ if(inside) {
+ return loop;
}
}
return null;