From 526af50c03af2e00a028caf4b8504e6c3f3c4221 Mon Sep 17 00:00:00 2001 From: Rami Santina Date: Fri, 25 Mar 2011 12:00:55 +0200 Subject: Refactored Vertex Point PointTex GraphPoint namings Vertex class --> SVertex (Simple vertex wwhere memory impl is float[]) Point interface --> Vertex (which combines in it PointTex Interface) GraphPoint --> GraphVertex --- src/jogamp/graph/curve/tess/Loop.java | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/jogamp/graph/curve/tess/Loop.java') diff --git a/src/jogamp/graph/curve/tess/Loop.java b/src/jogamp/graph/curve/tess/Loop.java index caebd64e4..e4553968b 100644 --- a/src/jogamp/graph/curve/tess/Loop.java +++ b/src/jogamp/graph/curve/tess/Loop.java @@ -32,10 +32,10 @@ import java.util.ArrayList; import jogamp.graph.math.VectorFloatUtil; import com.jogamp.graph.geom.AABBox; -import com.jogamp.graph.geom.PointTex; +import com.jogamp.graph.geom.Vertex; import com.jogamp.graph.geom.Triangle; -public class Loop { +public class Loop { private HEdge root = null; private AABBox box = new AABBox(); private GraphOutline initialOutline = null; @@ -66,9 +66,9 @@ public class Loop { return null; } - GraphPoint v1 = root.getGraphPoint(); - GraphPoint v2 = next1.getGraphPoint(); - GraphPoint v3 = next2.getGraphPoint(); + GraphVertex v1 = root.getGraphPoint(); + GraphVertex v2 = next1.getGraphPoint(); + GraphVertex v3 = next2.getGraphPoint(); HEdge v3Edge = new HEdge(v3, HEdge.INNER); @@ -98,7 +98,7 @@ public class Loop { * @param direction requested winding of edges (CCW or CW) */ private HEdge initFromPolyline(GraphOutline outline, int direction){ - ArrayList> vertices = outline.getGraphPoint(); + ArrayList> vertices = outline.getGraphPoint(); if(vertices.size()<3) { throw new IllegalArgumentException("outline's vertices < 3: " + vertices.size()); @@ -120,7 +120,7 @@ public class Loop { } while(index != max){ - GraphPoint v1 = vertices.get(index); + GraphVertex v1 = vertices.get(index); box.resize(v1.getX(), v1.getY(), v1.getZ()); HEdge edge = new HEdge(v1, edgeType); @@ -162,7 +162,7 @@ public class Loop { /**needed to generate vertex references.*/ initFromPolyline(polyline, VectorFloatUtil.CW); - GraphPoint v3 = locateClosestVertex(polyline); + GraphVertex v3 = locateClosestVertex(polyline); HEdge v3Edge = v3.findBoundEdge(); HEdge v3EdgeP = v3Edge.getPrev(); HEdge crossEdge = new HEdge(root.getGraphPoint(), HEdge.INNER); @@ -186,22 +186,22 @@ public class Loop { * to search for closestvertices * @return the vertex that is closest to the newly set root Hedge. */ - private GraphPoint locateClosestVertex(GraphOutline polyline) { + private GraphVertex locateClosestVertex(GraphOutline polyline) { HEdge closestE = null; - GraphPoint closestV = null; + GraphVertex closestV = null; float minDistance = Float.MAX_VALUE; boolean inValid = false; - ArrayList> initVertices = initialOutline.getGraphPoint(); - ArrayList> vertices = polyline.getGraphPoint(); + ArrayList> initVertices = initialOutline.getGraphPoint(); + ArrayList> vertices = polyline.getGraphPoint(); for(int i=0; i< initVertices.size()-1; i++){ - GraphPoint v = initVertices.get(i); - GraphPoint nextV = initVertices.get(i+1); - for(GraphPoint cand:vertices){ + GraphVertex v = initVertices.get(i); + GraphVertex nextV = initVertices.get(i+1); + for(GraphVertex cand:vertices){ float distance = VectorFloatUtil.computeLength(v.getCoord(), cand.getCoord()); if(distance < minDistance){ - for (GraphPoint vert:vertices){ + for (GraphVertex vert:vertices){ if(vert == v || vert == nextV || vert == cand) continue; inValid = VectorFloatUtil.inCircle(v.getPoint(), nextV.getPoint(), -- cgit v1.2.3