From 5ea211cde39be9669d1f2f289abbba460398f82e Mon Sep 17 00:00:00 2001 From: Rami Santina Date: Sat, 21 May 2011 17:49:08 +0300 Subject: Remove implicit for loops reduces temp objects --- src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java | 4 ++-- src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java | 9 ++++++--- src/jogl/classes/jogamp/graph/curve/tess/Loop.java | 10 ++++------ src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java | 1 + 4 files changed, 13 insertions(+), 11 deletions(-) (limited to 'src/jogl/classes/jogamp') diff --git a/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java b/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java index 6a2f47c79..c8251af15 100644 --- a/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java +++ b/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java @@ -47,8 +47,8 @@ public class GraphOutline { public GraphOutline(Outline ol){ this.outline = ol; ArrayList vertices = this.outline.getVertices(); - for(Vertex v:vertices){ - this.controlpoints.add(new GraphVertex(v)); + for(int i = 0; i< vertices.size(); i++){ + this.controlpoints.add(new GraphVertex(vertices.get(i))); } } diff --git a/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java b/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java index 5efe57c28..52d02baa5 100644 --- a/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java +++ b/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java @@ -86,7 +86,8 @@ public class GraphVertex { } } public HEdge findNextEdge(GraphVertex nextVert){ - for(HEdge e:edges){ + for(int i=0; i CCW ? + //FIXME: handle case when vertices come inverted - Rami + // skips inversion CW -> CCW final boolean invert = hasWinding != reqWinding && reqWinding == VectorUtil.Winding.CW; - if( hasWinding != reqWinding ) { - System.err.println("Winding: i "+invert+" "+hasWinding+" -> "+reqWinding); - } final int max; final int edgeType = reqWinding == VectorUtil.Winding.CCW ? HEdge.BOUNDARY : HEdge.HOLE ; @@ -201,7 +198,8 @@ public class Loop { for(int i=0; i< initVertices.size()-1; i++){ GraphVertex v = initVertices.get(i); GraphVertex nextV = initVertices.get(i+1); - for(GraphVertex cand:vertices){ + for(int pos=0; pos