diff options
Diffstat (limited to 'src/jogamp/graph/curve/tess')
-rw-r--r-- | src/jogamp/graph/curve/tess/GraphOutline.java | 12 | ||||
-rw-r--r-- | src/jogamp/graph/curve/tess/GraphVertex.java (renamed from src/jogamp/graph/curve/tess/GraphPoint.java) | 10 | ||||
-rw-r--r-- | src/jogamp/graph/curve/tess/HEdge.java | 20 | ||||
-rw-r--r-- | src/jogamp/graph/curve/tess/Loop.java | 32 |
4 files changed, 37 insertions, 37 deletions
diff --git a/src/jogamp/graph/curve/tess/GraphOutline.java b/src/jogamp/graph/curve/tess/GraphOutline.java index cf73ab379..bb262ce5b 100644 --- a/src/jogamp/graph/curve/tess/GraphOutline.java +++ b/src/jogamp/graph/curve/tess/GraphOutline.java @@ -30,11 +30,11 @@ package jogamp.graph.curve.tess; import java.util.ArrayList; import com.jogamp.graph.geom.Outline; -import com.jogamp.graph.geom.PointTex; +import com.jogamp.graph.geom.Vertex; -public class GraphOutline <T extends PointTex> { +public class GraphOutline <T extends Vertex> { final private Outline<T> outline; - final private ArrayList<GraphPoint<T>> controlpoints = new ArrayList<GraphPoint<T>>(3); + final private ArrayList<GraphVertex<T>> controlpoints = new ArrayList<GraphVertex<T>>(3); public GraphOutline(){ this.outline = new Outline<T>(); @@ -48,7 +48,7 @@ public class GraphOutline <T extends PointTex> { this.outline = ol; ArrayList<T> vertices = this.outline.getVertices(); for(T v:vertices){ - this.controlpoints.add(new GraphPoint<T>(v)); + this.controlpoints.add(new GraphVertex<T>(v)); } } @@ -61,7 +61,7 @@ public class GraphOutline <T extends PointTex> { }*/ - public ArrayList<GraphPoint<T>> getGraphPoint() { + public ArrayList<GraphVertex<T>> getGraphPoint() { return controlpoints; } @@ -73,7 +73,7 @@ public class GraphOutline <T extends PointTex> { this.controlpoints = controlpoints; }*/ - public void addVertex(GraphPoint<T> v) { + public void addVertex(GraphVertex<T> v) { controlpoints.add(v); outline.addVertex(v.getPoint()); } diff --git a/src/jogamp/graph/curve/tess/GraphPoint.java b/src/jogamp/graph/curve/tess/GraphVertex.java index 87d0b9929..a474a002e 100644 --- a/src/jogamp/graph/curve/tess/GraphPoint.java +++ b/src/jogamp/graph/curve/tess/GraphVertex.java @@ -29,14 +29,14 @@ package jogamp.graph.curve.tess; import java.util.ArrayList; -import com.jogamp.graph.geom.PointTex; +import com.jogamp.graph.geom.Vertex; -public class GraphPoint <T extends PointTex> { +public class GraphVertex <T extends Vertex> { private T point; private ArrayList<HEdge<T>> edges = null; private boolean boundaryContained = false; - public GraphPoint(T point) { + public GraphVertex(T point) { this.point = point; } @@ -85,7 +85,7 @@ public class GraphPoint <T extends PointTex> { edges = null; } } - public HEdge<T> findNextEdge(GraphPoint<T> nextVert){ + public HEdge<T> findNextEdge(GraphVertex<T> nextVert){ for(HEdge<T> e:edges){ if(e.getNext().getGraphPoint() == nextVert){ return e; @@ -101,7 +101,7 @@ public class GraphPoint <T extends PointTex> { } return null; } - public HEdge<T> findPrevEdge(GraphPoint<T> prevVert){ + public HEdge<T> findPrevEdge(GraphVertex<T> prevVert){ for(HEdge<T> e:edges){ if(e.getPrev().getGraphPoint() == prevVert){ return e; diff --git a/src/jogamp/graph/curve/tess/HEdge.java b/src/jogamp/graph/curve/tess/HEdge.java index acb32cb4d..5635e2c31 100644 --- a/src/jogamp/graph/curve/tess/HEdge.java +++ b/src/jogamp/graph/curve/tess/HEdge.java @@ -27,28 +27,28 @@ */ package jogamp.graph.curve.tess; -import com.jogamp.graph.geom.PointTex; +import com.jogamp.graph.geom.Vertex; import com.jogamp.graph.geom.Triangle; -public class HEdge <T extends PointTex> { +public class HEdge <T extends Vertex> { public static int BOUNDARY = 3; public static int INNER = 1; public static int HOLE = 2; - private GraphPoint<T> vert; + private GraphVertex<T> vert; private HEdge<T> prev = null; private HEdge<T> next = null; private HEdge<T> sibling = null; private int type = BOUNDARY; private Triangle<T> triangle = null; - public HEdge(GraphPoint<T> vert, int type) { + public HEdge(GraphVertex<T> vert, int type) { this.vert = vert; this.type = type; } - public HEdge(GraphPoint<T> vert, HEdge<T> prev, HEdge<T> next, HEdge<T> sibling, int type) { + public HEdge(GraphVertex<T> vert, HEdge<T> prev, HEdge<T> next, HEdge<T> sibling, int type) { this.vert = vert; this.prev = prev; this.next = next; @@ -56,7 +56,7 @@ public class HEdge <T extends PointTex> { this.type = type; } - public HEdge(GraphPoint<T> vert, HEdge<T> prev, HEdge<T> next, HEdge<T> sibling, int type, + public HEdge(GraphVertex<T> vert, HEdge<T> prev, HEdge<T> next, HEdge<T> sibling, int type, Triangle<T> triangle) { this.vert = vert; this.prev = prev; @@ -66,11 +66,11 @@ public class HEdge <T extends PointTex> { this.triangle = triangle; } - public GraphPoint<T> getGraphPoint() { + public GraphVertex<T> getGraphPoint() { return vert; } - public void setVert(GraphPoint<T> vert) { + public void setVert(GraphVertex<T> vert) { this.vert = vert; } @@ -114,12 +114,12 @@ public class HEdge <T extends PointTex> { this.triangle = triangle; } - public static <T extends PointTex> void connect(HEdge<T> first, HEdge<T> next){ + public static <T extends Vertex> void connect(HEdge<T> first, HEdge<T> next){ first.setNext(next); next.setPrev(first); } - public static <T extends PointTex> void makeSiblings(HEdge<T> first, HEdge<T> second){ + public static <T extends Vertex> void makeSiblings(HEdge<T> first, HEdge<T> second){ first.setSibling(second); second.setSibling(first); } 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 <T extends PointTex> { +public class Loop <T extends Vertex> { private HEdge<T> root = null; private AABBox box = new AABBox(); private GraphOutline<T> initialOutline = null; @@ -66,9 +66,9 @@ public class Loop <T extends PointTex> { return null; } - GraphPoint<T> v1 = root.getGraphPoint(); - GraphPoint<T> v2 = next1.getGraphPoint(); - GraphPoint<T> v3 = next2.getGraphPoint(); + GraphVertex<T> v1 = root.getGraphPoint(); + GraphVertex<T> v2 = next1.getGraphPoint(); + GraphVertex<T> v3 = next2.getGraphPoint(); HEdge<T> v3Edge = new HEdge<T>(v3, HEdge.INNER); @@ -98,7 +98,7 @@ public class Loop <T extends PointTex> { * @param direction requested winding of edges (CCW or CW) */ private HEdge<T> initFromPolyline(GraphOutline<T> outline, int direction){ - ArrayList<GraphPoint<T>> vertices = outline.getGraphPoint(); + ArrayList<GraphVertex<T>> vertices = outline.getGraphPoint(); if(vertices.size()<3) { throw new IllegalArgumentException("outline's vertices < 3: " + vertices.size()); @@ -120,7 +120,7 @@ public class Loop <T extends PointTex> { } while(index != max){ - GraphPoint<T> v1 = vertices.get(index); + GraphVertex<T> v1 = vertices.get(index); box.resize(v1.getX(), v1.getY(), v1.getZ()); HEdge<T> edge = new HEdge<T>(v1, edgeType); @@ -162,7 +162,7 @@ public class Loop <T extends PointTex> { /**needed to generate vertex references.*/ initFromPolyline(polyline, VectorFloatUtil.CW); - GraphPoint<T> v3 = locateClosestVertex(polyline); + GraphVertex<T> v3 = locateClosestVertex(polyline); HEdge<T> v3Edge = v3.findBoundEdge(); HEdge<T> v3EdgeP = v3Edge.getPrev(); HEdge<T> crossEdge = new HEdge<T>(root.getGraphPoint(), HEdge.INNER); @@ -186,22 +186,22 @@ public class Loop <T extends PointTex> { * to search for closestvertices * @return the vertex that is closest to the newly set root Hedge. */ - private GraphPoint<T> locateClosestVertex(GraphOutline<T> polyline) { + private GraphVertex<T> locateClosestVertex(GraphOutline<T> polyline) { HEdge<T> closestE = null; - GraphPoint<T> closestV = null; + GraphVertex<T> closestV = null; float minDistance = Float.MAX_VALUE; boolean inValid = false; - ArrayList<GraphPoint<T>> initVertices = initialOutline.getGraphPoint(); - ArrayList<GraphPoint<T>> vertices = polyline.getGraphPoint(); + ArrayList<GraphVertex<T>> initVertices = initialOutline.getGraphPoint(); + ArrayList<GraphVertex<T>> vertices = polyline.getGraphPoint(); for(int i=0; i< initVertices.size()-1; i++){ - GraphPoint<T> v = initVertices.get(i); - GraphPoint<T> nextV = initVertices.get(i+1); - for(GraphPoint<T> cand:vertices){ + GraphVertex<T> v = initVertices.get(i); + GraphVertex<T> nextV = initVertices.get(i+1); + for(GraphVertex<T> cand:vertices){ float distance = VectorFloatUtil.computeLength(v.getCoord(), cand.getCoord()); if(distance < minDistance){ - for (GraphPoint<T> vert:vertices){ + for (GraphVertex<T> vert:vertices){ if(vert == v || vert == nextV || vert == cand) continue; inValid = VectorFloatUtil.inCircle(v.getPoint(), nextV.getPoint(), |