aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/graph/geom/Outline.java
diff options
context:
space:
mode:
authorRami Santina <[email protected]>2011-03-30 16:38:14 +0300
committerRami Santina <[email protected]>2011-03-30 16:38:14 +0300
commit8e5d620eae1dcc1f1178e09c1d5172324541f503 (patch)
treef2d26265a6d2ee46fba6bae368fbde36428418a8 /src/com/jogamp/graph/geom/Outline.java
parent133edeb70921dbcae3ec7cc76f1bc6dd0cd36da8 (diff)
parent630a9ea52b16da6badb31a98b70893f8d294b4e8 (diff)
Merge with sgothel
Diffstat (limited to 'src/com/jogamp/graph/geom/Outline.java')
-rw-r--r--src/com/jogamp/graph/geom/Outline.java29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/com/jogamp/graph/geom/Outline.java b/src/com/jogamp/graph/geom/Outline.java
index 4f8d26783..24f44b5fc 100644
--- a/src/com/jogamp/graph/geom/Outline.java
+++ b/src/com/jogamp/graph/geom/Outline.java
@@ -43,9 +43,9 @@ import com.jogamp.graph.math.VectorUtil;
*
* @see OutlineShape, Region
*/
-public class Outline<T extends Vertex> implements Comparable<Outline<T>>{
+public class Outline implements Comparable<Outline> {
- private ArrayList<T> vertices = new ArrayList<T>(3);
+ private ArrayList<Vertex> vertices = new ArrayList<Vertex>(3);
private boolean closed = false;
private AABBox box = new AABBox();
@@ -61,7 +61,7 @@ public class Outline<T extends Vertex> implements Comparable<Outline<T>>{
* end of the outline loop/strip.
* @param vertex Vertex to be added
*/
- public final void addVertex(T vertex) {
+ public final void addVertex(Vertex vertex) {
vertices.add(vertex);
box.resize(vertex.getX(), vertex.getY(), vertex.getZ());
}
@@ -70,38 +70,36 @@ public class Outline<T extends Vertex> implements Comparable<Outline<T>>{
addVertex(factory, x, y, 0f, onCurve);
}
- @SuppressWarnings("unchecked")
public final void addVertex(Vertex.Factory<? extends Vertex> factory, float x, float y, float z, boolean onCurve) {
Vertex v = factory.create(x, y, z);
v.setOnCurve(onCurve);
- addVertex((T)v);
+ addVertex(v);
}
- @SuppressWarnings("unchecked")
public final void addVertex(Vertex.Factory<? extends Vertex> factory, float[] coordsBuffer, int offset, int length, boolean onCurve) {
Vertex v = factory.create(coordsBuffer, offset, length);
v.setOnCurve(onCurve);
- addVertex((T)v);
+ addVertex(v);
}
- public T getVertex(int index){
+ public Vertex getVertex(int index){
return vertices.get(index);
}
public boolean isEmpty(){
return (vertices.size() == 0);
}
- public T getLastVertex(){
+ public Vertex getLastVertex(){
if(isEmpty()){
return null;
}
return vertices.get(vertices.size()-1);
}
- public ArrayList<T> getVertices() {
+ public ArrayList<Vertex> getVertices() {
return vertices;
}
- public void setVertices(ArrayList<T> vertices) {
+ public void setVertices(ArrayList<Vertex> vertices) {
this.vertices = vertices;
}
public AABBox getBox() {
@@ -120,11 +118,10 @@ public class Outline<T extends Vertex> implements Comparable<Outline<T>>{
public void setClosed(boolean closed) {
this.closed = closed;
if(closed){
- T first = vertices.get(0);
- T last = getLastVertex();
+ Vertex first = vertices.get(0);
+ Vertex last = getLastVertex();
if(!VectorUtil.checkEquality(first.getCoord(), last.getCoord())){
- @SuppressWarnings("unchecked")
- T v = (T) first.clone();
+ Vertex v = first.clone();
vertices.add(v);
}
}
@@ -134,7 +131,7 @@ public class Outline<T extends Vertex> implements Comparable<Outline<T>>{
* as criteria.
* @see java.lang.Comparable#compareTo(java.lang.Object)
*/
- public int compareTo(Outline<T> outline) {
+ public int compareTo(Outline outline) {
float size = box.getSize();
float newSize = outline.getBox().getSize();
if(size < newSize){