diff options
author | Sven Gothel <[email protected]> | 2011-03-29 15:05:49 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-03-29 15:05:49 +0200 |
commit | 5f0293b84d0146d9e750ea7e75caaa101ae3b3c3 (patch) | |
tree | e95f0c919a0a385cf70ef6846295a83705c0af60 /src/com/jogamp/graph/curve | |
parent | 4ed4dc3847d8d53a3424011f3d56b00ef246a81e (diff) |
Refactoring for public: Remove Line ; public/private API cleanup
Diffstat (limited to 'src/com/jogamp/graph/curve')
-rwxr-xr-x | src/com/jogamp/graph/curve/OutlineShape.java | 28 | ||||
-rw-r--r-- | src/com/jogamp/graph/curve/tess/CDTriangulator2D.java | 7 |
2 files changed, 6 insertions, 29 deletions
diff --git a/src/com/jogamp/graph/curve/OutlineShape.java b/src/com/jogamp/graph/curve/OutlineShape.java index d7b941282..9373808f1 100755 --- a/src/com/jogamp/graph/curve/OutlineShape.java +++ b/src/com/jogamp/graph/curve/OutlineShape.java @@ -30,12 +30,10 @@ package com.jogamp.graph.curve; import java.util.ArrayList;
import java.util.Collections;
-import jogamp.graph.math.VectorFloatUtil;
-
import com.jogamp.graph.geom.Outline;
-import com.jogamp.graph.geom.Line;
import com.jogamp.graph.geom.Triangle;
import com.jogamp.graph.geom.Vertex;
+import com.jogamp.graph.math.VectorUtil;
import com.jogamp.graph.curve.tess.CDTriangulator2D;
@@ -153,7 +151,7 @@ public class OutlineShape { if(!(currentVertex.isOnCurve()) && !(nextVertex.isOnCurve())) {
newOutline.addVertex(currentVertex);
- float[] newCoords = VectorFloatUtil.mid(currentVertex.getCoord(), nextVertex.getCoord());
+ float[] newCoords = VectorUtil.mid(currentVertex.getCoord(), nextVertex.getCoord());
newOutline.addVertex(pointFactory, newCoords, 0, 3, true);
}
else {
@@ -188,28 +186,6 @@ public class OutlineShape { }
- /** Generates the lines the define the noncurved
- * parts of this graph
- * @return arraylist of lines
- */
- public ArrayList<Line<Vertex>> getLines(){
- ArrayList<Line<Vertex>> lines = new ArrayList<Line<Vertex>>();
- for(Outline<Vertex> outline:outlines){
- ArrayList<Vertex> outVertices = outline.getVertices();
- int size = outVertices.size();
- for(int i=0; i < size; i++) {
- Vertex currentVertex = outVertices.get(i);
- if(currentVertex.isOnCurve()) {
- Vertex v2 = outVertices.get((i+1)%size);
- if(v2.isOnCurve()){
- lines.add(new Line<Vertex>(currentVertex, v2));
- }
- }
- }
- }
- return lines;
- }
-
/** Triangluate the graph object
* @param sharpness sharpness of the curved regions default = 0.5
*/
diff --git a/src/com/jogamp/graph/curve/tess/CDTriangulator2D.java b/src/com/jogamp/graph/curve/tess/CDTriangulator2D.java index 2a1b52b1c..0a7cf08d4 100644 --- a/src/com/jogamp/graph/curve/tess/CDTriangulator2D.java +++ b/src/com/jogamp/graph/curve/tess/CDTriangulator2D.java @@ -33,11 +33,12 @@ import java.util.ArrayList; import jogamp.graph.curve.tess.GraphOutline; import jogamp.graph.curve.tess.GraphVertex; import jogamp.graph.curve.tess.Loop; -import jogamp.graph.math.VectorFloatUtil; import com.jogamp.graph.geom.Outline; import com.jogamp.graph.geom.Triangle; import com.jogamp.graph.geom.Vertex; +import com.jogamp.graph.math.VectorUtil; + import jogamp.opengl.Debug; /** Constrained Delaunay Triangulation @@ -94,7 +95,7 @@ public class CDTriangulator2D <T extends Vertex> { GraphOutline<T> outline = new GraphOutline<T>(polyline); GraphOutline<T> innerPoly = extractBoundaryTriangles(outline, false); vertices.addAll(polyline.getVertices()); - loop = new Loop<T>(innerPoly, VectorFloatUtil.CCW); + loop = new Loop<T>(innerPoly, VectorUtil.CCW); loops.add(loop); } else { @@ -168,7 +169,7 @@ public class CDTriangulator2D <T extends Vertex> { Triangle<T> t= null; boolean holeLike = false; - if(VectorFloatUtil.ccw(v0,v1,v2)){ + if(VectorUtil.ccw(v0,v1,v2)){ t = new Triangle<T>(v0, v1, v2); } else { |