aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/graph/curve/OutlineShape.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/jogamp/graph/curve/OutlineShape.java')
-rwxr-xr-xsrc/com/jogamp/graph/curve/OutlineShape.java35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/com/jogamp/graph/curve/OutlineShape.java b/src/com/jogamp/graph/curve/OutlineShape.java
index c385b83f5..0c3988db3 100755
--- a/src/com/jogamp/graph/curve/OutlineShape.java
+++ b/src/com/jogamp/graph/curve/OutlineShape.java
@@ -98,13 +98,13 @@ public class OutlineShape {
/** The list of outlines that are part of this
* outline shape.
*/
- private ArrayList<Outline<Vertex>> outlines = new ArrayList<Outline<Vertex>>(3);
+ private ArrayList<Outline> outlines = new ArrayList<Outline>(3);
/** Create a new Outline based Shape
*/
public OutlineShape(Vertex.Factory<? extends Vertex> factory) {
vertexFactory = factory;
- outlines.add(new Outline<Vertex>());
+ outlines.add(new Outline());
}
/** Returns the associated vertex factory of this outline shape
@@ -120,7 +120,7 @@ public class OutlineShape {
* will belong to the new outline
*/
public void addEmptyOutline(){
- outlines.add(new Outline<Vertex>());
+ outlines.add(new Outline());
}
/** Adds an outline to the OutlineShape object
@@ -129,7 +129,7 @@ public class OutlineShape {
* it will do nothing.
* @param outline an Outline object
*/
- public void addOutline(Outline<Vertex> outline){
+ public void addOutline(Outline outline){
if(outline.isEmpty()){
return;
}
@@ -197,7 +197,7 @@ public class OutlineShape {
* of outlines that define the shape
* @return the last outline
*/
- public final Outline<Vertex> getLastOutline(){
+ public final Outline getLastOutline(){
return outlines.get(outlines.size()-1);
}
/** Make sure that the outlines represent
@@ -212,13 +212,13 @@ public class OutlineShape {
}
private void transformOutlinesQuadratic(){
- ArrayList<Outline<Vertex>> newOutlines = new ArrayList<Outline<Vertex>>(3);
+ ArrayList<Outline> newOutlines = new ArrayList<Outline>(3);
/**loop over the outlines and make sure no
* adj off-curve vertices
*/
- for(Outline<Vertex> outline:outlines){
- Outline<Vertex> newOutline = new Outline<Vertex>();
+ for(Outline outline:outlines){
+ Outline newOutline = new Outline();
ArrayList<Vertex> vertices = outline.getVertices();
int size =vertices.size()-1;
@@ -242,7 +242,7 @@ public class OutlineShape {
private void generateVertexIds(){
int maxVertexId = 0;
- for(Outline<Vertex> outline:outlines){
+ for(Outline outline:outlines){
ArrayList<Vertex> vertices = outline.getVertices();
for(Vertex vert:vertices){
vert.setId(maxVertexId);
@@ -256,7 +256,7 @@ public class OutlineShape {
*/
public ArrayList<Vertex> getVertices(){
ArrayList<Vertex> vertices = new ArrayList<Vertex>();
- for(Outline<Vertex> polyline:outlines){
+ for(Outline polyline:outlines){
vertices.addAll(polyline.getVertices());
}
return vertices;
@@ -266,7 +266,7 @@ public class OutlineShape {
* @return an arraylist of triangles representing the filled region
* which is produced by the combination of the outlines
*/
- public ArrayList<Triangle<Vertex>> triangulate(){
+ public ArrayList<Triangle> triangulate(){
return triangulate(0.5f);
}
@@ -276,21 +276,20 @@ public class OutlineShape {
* @return an arraylist of triangles representing the filled region
* which is produced by the combination of the outlines
*/
- public ArrayList<Triangle<Vertex>> triangulate(float sharpness){
+ public ArrayList<Triangle> triangulate(float sharpness){
if(outlines.size() == 0){
return null;
}
sortOutlines();
generateVertexIds();
-
- CDTriangulator2D<Vertex> triangulator2d = new CDTriangulator2D<Vertex>(sharpness);
-
+
+ CDTriangulator2D triangulator2d = new CDTriangulator2D(sharpness);
for(int index = 0; index< outlines.size();index++){
- Outline<Vertex> outline = outlines.get(index);
+ Outline outline = outlines.get(index);
triangulator2d.addCurve(outline);
}
-
- ArrayList<Triangle<Vertex>> triangles = triangulator2d.generateTriangulation();
+
+ ArrayList<Triangle> triangles = triangulator2d.generateTriangulation();
triangulator2d.reset();
return triangles;