diff options
author | Sven Gothel <[email protected]> | 2011-05-10 23:54:39 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-05-10 23:54:39 +0200 |
commit | f5ec2dd42244282c2a005269ae4674ab78af269a (patch) | |
tree | 09e97a3f63a48eba51225181110067824bbf95a0 /src/jogl/classes/com/jogamp/graph | |
parent | 9ceff75afcbf6c446e75c1be6b4be1e62d543f3a (diff) |
Graph: getWinding(ArrayList<Vertex> vertices) test; minor renaming
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph')
-rw-r--r-- | src/jogl/classes/com/jogamp/graph/curve/tess/CDTriangulator2D.java | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/graph/math/VectorUtil.java | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/tess/CDTriangulator2D.java b/src/jogl/classes/com/jogamp/graph/curve/tess/CDTriangulator2D.java index 55bdbcd33..e0d7d3236 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/tess/CDTriangulator2D.java +++ b/src/jogl/classes/com/jogamp/graph/curve/tess/CDTriangulator2D.java @@ -94,7 +94,7 @@ public class CDTriangulator2D { else { GraphOutline outline = new GraphOutline(polyline); GraphOutline innerPoly = extractBoundaryTriangles(outline, true); - vertices.addAll(innerPoly.getPoints()); + vertices.addAll(innerPoly.getVertices()); loop.addConstraintCurve(innerPoly); } } @@ -140,7 +140,7 @@ public class CDTriangulator2D { return triangles; } - private GraphOutline extractBoundaryTriangles(GraphOutline outline, boolean hole){ + private GraphOutline extractBoundaryTriangles(GraphOutline outline, boolean hole) { GraphOutline innerOutline = new GraphOutline(); ArrayList<GraphVertex> outVertices = outline.getGraphPoint(); int size = outVertices.size(); diff --git a/src/jogl/classes/com/jogamp/graph/math/VectorUtil.java b/src/jogl/classes/com/jogamp/graph/math/VectorUtil.java index aae7a8c5c..b91969745 100755 --- a/src/jogl/classes/com/jogamp/graph/math/VectorUtil.java +++ b/src/jogl/classes/com/jogamp/graph/math/VectorUtil.java @@ -310,7 +310,7 @@ public class VectorUtil { /** Computes the area of a list of vertices to check if ccw
* @param vertices
- * @return positve area if ccw else negative area value
+ * @return positive area if ccw else negative area value
*/
public static float area(ArrayList<Vertex> vertices) {
int n = vertices.size();
@@ -323,4 +323,7 @@ public class VectorUtil { }
return area;
}
+ public static Winding getWinding(ArrayList<Vertex> vertices) {
+ return area(vertices) >= 0 ? Winding.CCW : Winding.CW ;
+ }
}
|