diff options
Diffstat (limited to 'src/jogl/classes/jogamp/graph/curve')
-rw-r--r-- | src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java | 18 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/graph/curve/tess/Loop.java | 14 |
2 files changed, 12 insertions, 20 deletions
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java b/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java index 08b75478d..d69b33f1f 100644 --- a/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java +++ b/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java @@ -50,15 +50,13 @@ public class CDTriangulator2D implements Triangulator { protected static final boolean DEBUG = Debug.debug("graph.curve.Triangulation"); - private static final boolean FORCE_NONCONVEX = Debug.debug("graph.curve.triangulation.force.non-convex"); - private static final boolean FORCE_CONVEX = Debug.debug("graph.curve.triangulation.force.convex"); private static final boolean TEST_LINE_AA = Debug.debug("graph.curve.triangulation.LINE_AA"); private static final boolean TEST_MARK_LINE = Debug.debug("graph.curve.triangulation.MARK_AA"); private static final boolean TEST_ENABLED = TEST_LINE_AA || TEST_MARK_LINE; private final ArrayList<Loop> loops = new ArrayList<Loop>(); - private boolean convexFlag; + private boolean complexShape; private int addedVerticeCount; private int maxTriID; @@ -66,19 +64,13 @@ public class CDTriangulator2D implements Triangulator { /** Constructor for a new Delaunay triangulator */ public CDTriangulator2D() { - if( FORCE_NONCONVEX ) { - convexFlag = false; - } else { - convexFlag = true; - } + complexShape = false; reset(); } @Override - public void setConvexShape(final boolean convex) { - if( !FORCE_NONCONVEX && !FORCE_CONVEX ) { - convexFlag = convex; - } + public void setComplexShape(final boolean complex) { + complexShape = complex; } @Override @@ -114,7 +106,7 @@ public class CDTriangulator2D implements Triangulator { final GraphOutline innerPoly = extractBoundaryTriangles(sink, outline, false /* hole */, sharpness); // vertices.addAll(polyline.getVertices()); if( innerPoly.getGraphPoint().size() >= 3 ) { - loop = Loop.createBoundary(innerPoly, convexFlag); + loop = Loop.createBoundary(innerPoly, complexShape); if( null != loop ) { loops.add(loop); } diff --git a/src/jogl/classes/jogamp/graph/curve/tess/Loop.java b/src/jogl/classes/jogamp/graph/curve/tess/Loop.java index a69fbd6b5..838cf8b5f 100644 --- a/src/jogl/classes/jogamp/graph/curve/tess/Loop.java +++ b/src/jogl/classes/jogamp/graph/curve/tess/Loop.java @@ -41,13 +41,13 @@ import com.jogamp.graph.geom.Triangle; public class Loop { private final AABBox box = new AABBox(); private final GraphOutline initialOutline; - private final boolean isConvex; + private final boolean complexShape; private HEdge root; private final List<GraphOutline> outlines = new ArrayList<GraphOutline>(); - private Loop(final GraphOutline polyline, final int edgeType, final boolean isConvex){ + private Loop(final GraphOutline polyline, final int edgeType, final boolean complexShape){ this.initialOutline = polyline; - this.isConvex = isConvex; + this.complexShape = complexShape; this.root = initFromPolyline(initialOutline, edgeType); } @@ -249,7 +249,7 @@ public class Loop { final Vertex rootPoint = root.getGraphPoint().getPoint(); final Vertex nextPoint = next1.getGraphPoint().getPoint(); final Vertex candPoint = next1.getNext().getGraphPoint().getPoint(); - if( !isConvex && intersectsOutline(rootPoint, nextPoint, candPoint) ) { + if( complexShape && intersectsOutline(rootPoint, nextPoint, candPoint) ) { return null; } return new Triangle(rootPoint, nextPoint, candPoint, checkVerticesBoundary(root)); @@ -290,7 +290,7 @@ public class Loop { final Vertex rootPoint = root.getGraphPoint().getPoint(); final Vertex nextPoint = next1.getGraphPoint().getPoint(); final Vertex candPoint = next1.getNext().getGraphPoint().getPoint(); - if( !isConvex && intersectsOutlineDbg(rootPoint, nextPoint, candPoint) ) { + if( complexShape && intersectsOutlineDbg(rootPoint, nextPoint, candPoint) ) { System.err.printf("Loop.cut.X0: last-simplex intersects%n"); return null; } @@ -409,7 +409,7 @@ public class Loop { if( !VectorUtil.isCCW( rootPoint, nextPoint, candPoint) ) { return null; } - if( !isConvex && intersectsOutline(rootPoint, nextPoint, candPoint) ) { + if( complexShape && intersectsOutline(rootPoint, nextPoint, candPoint) ) { return null; } if( !delaunay ) { @@ -440,7 +440,7 @@ public class Loop { candPoint, rootPoint, nextPoint, candPoint); return null; } - if( !isConvex && intersectsOutlineDbg(rootPoint, nextPoint, candPoint) ) { + if( complexShape && intersectsOutlineDbg(rootPoint, nextPoint, candPoint) ) { return null; } if( !delaunay ) { |