summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/graph/geom
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/geom')
-rw-r--r--src/jogl/classes/com/jogamp/graph/geom/Outline.java36
-rw-r--r--src/jogl/classes/com/jogamp/graph/geom/Triangle.java10
-rw-r--r--src/jogl/classes/com/jogamp/graph/geom/Vertex.java22
-rw-r--r--src/jogl/classes/com/jogamp/graph/geom/opengl/SVertex.java40
4 files changed, 54 insertions, 54 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/geom/Outline.java b/src/jogl/classes/com/jogamp/graph/geom/Outline.java
index 12c45860b..dfa6a8635 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/Outline.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/Outline.java
@@ -36,12 +36,12 @@ import com.jogamp.opengl.math.geom.AABBox;
/** Define a single continuous stroke by control vertices.
- * The vertices define the shape of the region defined by this
+ * The vertices define the shape of the region defined by this
* outline. The Outline can contain a list of off-curve and on-curve
* vertices which define curved regions.
- *
+ *
* Note: An outline should be closed to be rendered as a region.
- *
+ *
* @see OutlineShape, Region
*/
public class Outline implements Cloneable, Comparable<Outline> {
@@ -55,7 +55,7 @@ public class Outline implements Cloneable, Comparable<Outline> {
* An outline can contain off Curve vertices which define curved
* regions in the outline.
*/
- public Outline() {
+ public Outline() {
}
public final int getVertexCount() {
@@ -64,7 +64,7 @@ public class Outline implements Cloneable, Comparable<Outline> {
/** Appends a vertex to the outline loop/strip.
* @param vertex Vertex to be added
- * @throws NullPointerException if the {@link Vertex} element is null
+ * @throws NullPointerException if the {@link Vertex} element is null
*/
public final void addVertex(Vertex vertex) throws NullPointerException {
addVertex(vertices.size(), vertex);
@@ -73,7 +73,7 @@ public class Outline implements Cloneable, Comparable<Outline> {
/** Insert the {@link Vertex} element at the given {@code position} to the outline loop/strip.
* @param position of the added Vertex
* @param vertex Vertex object to be added
- * @throws NullPointerException if the {@link Vertex} element is null
+ * @throws NullPointerException if the {@link Vertex} element is null
* @throws IndexOutOfBoundsException if position is out of range (position < 0 || position > getVertexNumber())
*/
public final void addVertex(int position, Vertex vertex) throws NullPointerException, IndexOutOfBoundsException {
@@ -88,10 +88,10 @@ public class Outline implements Cloneable, Comparable<Outline> {
/** Replaces the {@link Vertex} element at the given {@code position}.
* <p>Sets the bounding box dirty, hence a next call to {@link #getBounds()} will validate it.</p>
- *
+ *
* @param position of the replaced Vertex
- * @param vertex replacement Vertex object
- * @throws NullPointerException if the {@link Outline} element is null
+ * @param vertex replacement Vertex object
+ * @throws NullPointerException if the {@link Outline} element is null
* @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getVertexNumber())
*/
public final void setVertex(int position, Vertex vertex) throws NullPointerException, IndexOutOfBoundsException {
@@ -112,12 +112,12 @@ public class Outline implements Cloneable, Comparable<Outline> {
/** Removes the {@link Vertex} element at the given {@code position}.
* <p>Sets the bounding box dirty, hence a next call to {@link #getBounds()} will validate it.</p>
- *
+ *
* @param position of the to be removed Vertex
* @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getVertexNumber())
*/
public final Vertex removeVertex(int position) throws IndexOutOfBoundsException {
- dirtyBBox = true;
+ dirtyBBox = true;
return vertices.remove(position);
}
@@ -139,7 +139,7 @@ public class Outline implements Cloneable, Comparable<Outline> {
/**
* Use the given outline loop/strip.
* <p>Validates the bounding box.</p>
- *
+ *
* @param vertices the new outline loop/strip
*/
public final void setVertices(ArrayList<Vertex> vertices) {
@@ -152,7 +152,7 @@ public class Outline implements Cloneable, Comparable<Outline> {
}
/** define if this outline is closed or not.
- * if set to closed, checks if the last vertex is
+ * if set to closed, checks if the last vertex is
* equal to the first vertex. If not Equal adds a
* vertex at the end to the list.
* @param closed
@@ -170,7 +170,7 @@ public class Outline implements Cloneable, Comparable<Outline> {
}
/** Compare two outlines with Bounding Box area
- * as criteria.
+ * as criteria.
* @see java.lang.Comparable#compareTo(java.lang.Object)
*/
public final int compareTo(Outline outline) {
@@ -198,11 +198,11 @@ public class Outline implements Cloneable, Comparable<Outline> {
validateBoundingBox();
}
return bbox;
- }
+ }
/**
* @param obj the Object to compare this Outline with
- * @return true if {@code obj} is an Outline, not null, equals bounds and equal vertices in the same order
+ * @return true if {@code obj} is an Outline, not null, equals bounds and equal vertices in the same order
*/
public boolean equals(Object obj) {
if( obj == this) {
@@ -210,7 +210,7 @@ public class Outline implements Cloneable, Comparable<Outline> {
}
if( null == obj || !(obj instanceof Outline) ) {
return false;
- }
+ }
final Outline o = (Outline) obj;
if(getVertexCount() != o.getVertexCount()) {
return false;
@@ -240,5 +240,5 @@ public class Outline implements Cloneable, Comparable<Outline> {
o.vertices.add(vertices.get(i).clone());
}
return o;
- }
+ }
}
diff --git a/src/jogl/classes/com/jogamp/graph/geom/Triangle.java b/src/jogl/classes/com/jogamp/graph/geom/Triangle.java
index fb34de221..bd0900495 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/Triangle.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/Triangle.java
@@ -48,11 +48,11 @@ public class Triangle {
public Vertex[] getVertices() {
return vertices;
}
-
+
public boolean isEdgesBoundary() {
return boundaryEdges[0] || boundaryEdges[1] || boundaryEdges[2];
}
-
+
public boolean isVerticesBoundary() {
return boundaryVertices[0] || boundaryVertices[1] || boundaryVertices[2];
}
@@ -60,11 +60,11 @@ public class Triangle {
public void setEdgesBoundary(boolean[] boundary) {
this.boundaryEdges = boundary;
}
-
+
public boolean[] getEdgeBoundary() {
return boundaryEdges;
}
-
+
public boolean[] getVerticesBoundary() {
return boundaryVertices;
}
@@ -72,7 +72,7 @@ public class Triangle {
public void setVerticesBoundary(boolean[] boundaryVertices) {
this.boundaryVertices = boundaryVertices;
}
-
+
public String toString() {
return "Tri ID: " + id + "\n" + vertices[0] + "\n" + vertices[1] + "\n" + vertices[2];
}
diff --git a/src/jogl/classes/com/jogamp/graph/geom/Vertex.java b/src/jogl/classes/com/jogamp/graph/geom/Vertex.java
index e3df86de1..40048235e 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/Vertex.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/Vertex.java
@@ -30,7 +30,7 @@ package com.jogamp.graph.geom;
import com.jogamp.opengl.math.Vert3fImmutable;
/**
- * A Vertex with custom memory layout using custom factory.
+ * A Vertex with custom memory layout using custom factory.
*/
public interface Vertex extends Vert3fImmutable, Cloneable {
@@ -39,16 +39,16 @@ public interface Vertex extends Vert3fImmutable, Cloneable {
T create(float x, float y, float z, boolean onCurve);
- T create(float[] coordsBuffer, int offset, int length, boolean onCurve);
+ T create(float[] coordsBuffer, int offset, int length, boolean onCurve);
}
-
+
void setCoord(float x, float y, float z);
/**
* @see System#arraycopy(Object, int, Object, int, int) for thrown IndexOutOfBoundsException
*/
void setCoord(float[] coordsBuffer, int offset, int length);
-
+
void setX(float x);
void setY(float y);
@@ -60,24 +60,24 @@ public interface Vertex extends Vert3fImmutable, Cloneable {
void setOnCurve(boolean onCurve);
int getId();
-
+
void setId(int id);
-
+
float[] getTexCoord();
-
+
void setTexCoord(float s, float t);
-
+
/**
* @see System#arraycopy(Object, int, Object, int, int) for thrown IndexOutOfBoundsException
*/
void setTexCoord(float[] texCoordsBuffer, int offset, int length);
-
+
/**
* @param obj the Object to compare this Vertex with
- * @return true if {@code obj} is a Vertex and not null, on-curve flag is equal and has same vertex- and tex-coords.
+ * @return true if {@code obj} is a Vertex and not null, on-curve flag is equal and has same vertex- and tex-coords.
*/
boolean equals(Object obj);
-
+
/**
* @return deep clone of this Vertex
*/
diff --git a/src/jogl/classes/com/jogamp/graph/geom/opengl/SVertex.java b/src/jogl/classes/com/jogamp/graph/geom/opengl/SVertex.java
index 97e438b63..6b07688a7 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/opengl/SVertex.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/opengl/SVertex.java
@@ -39,11 +39,11 @@ public class SVertex implements Vertex {
protected float[] coord = new float[3];
protected boolean onCurve;
private float[] texCoord = new float[2];
-
+
static final Factory factory = new Factory();
-
- public static Factory factory() { return factory; }
-
+
+ public static Factory factory() { return factory; }
+
public static class Factory implements Vertex.Factory<SVertex> {
public SVertex create() {
return new SVertex();
@@ -55,9 +55,9 @@ public class SVertex implements Vertex {
public SVertex create(float[] coordsBuffer, int offset, int length, boolean onCurve) {
return new SVertex(coordsBuffer, offset, length, onCurve);
- }
+ }
}
-
+
public SVertex() {
}
@@ -65,19 +65,19 @@ public class SVertex implements Vertex {
setCoord(x, y, z);
setOnCurve(onCurve);
}
-
+
public SVertex(float[] coordsBuffer, int offset, int length, boolean onCurve) {
setCoord(coordsBuffer, offset, length);
setOnCurve(onCurve);
}
-
- public SVertex(float[] coordsBuffer, int offset, int length,
+
+ public SVertex(float[] coordsBuffer, int offset, int length,
float[] texCoordsBuffer, int offsetTC, int lengthTC, boolean onCurve) {
setCoord(coordsBuffer, offset, length);
setTexCoord(texCoordsBuffer, offsetTC, lengthTC);
setOnCurve(onCurve);
}
-
+
public final void setCoord(float x, float y, float z) {
this.coord[0] = x;
this.coord[1] = y;
@@ -87,12 +87,12 @@ public class SVertex implements Vertex {
public final void setCoord(float[] coordsBuffer, int offset, int length) {
System.arraycopy(coordsBuffer, offset, coord, 0, length);
}
-
+
@Override
public int getCoordCount() {
return 3;
}
-
+
@Override
public final float[] getCoord() {
return coord;
@@ -133,11 +133,11 @@ public class SVertex implements Vertex {
public final int getId(){
return id;
}
-
+
public final void setId(int id){
this.id = id;
}
-
+
public boolean equals(Object obj) {
if( obj == this) {
return true;
@@ -146,12 +146,12 @@ public class SVertex implements Vertex {
return false;
}
final Vertex v = (Vertex) obj;
- return this == v ||
- isOnCurve() == v.isOnCurve() &&
+ return this == v ||
+ isOnCurve() == v.isOnCurve() &&
VectorUtil.checkEqualityVec2(getTexCoord(), v.getTexCoord()) &&
VectorUtil.checkEquality(getCoord(), v.getCoord()) ;
}
-
+
public final float[] getTexCoord() {
return texCoord;
}
@@ -164,16 +164,16 @@ public class SVertex implements Vertex {
public final void setTexCoord(float[] texCoordsBuffer, int offset, int length) {
System.arraycopy(texCoordsBuffer, offset, texCoord, 0, length);
}
-
+
/**
* @return deep clone of this Vertex, but keeping the id blank
*/
public SVertex clone(){
return new SVertex(this.coord, 0, 3, this.texCoord, 0, 2, this.onCurve);
}
-
+
public String toString() {
- return "[ID: " + id + ", onCurve: " + onCurve +
+ return "[ID: " + id + ", onCurve: " + onCurve +
": p " + coord[0] + ", " + coord[1] + ", " + coord[2] +
", t " + texCoord[0] + ", " + texCoord[1] + "]";
}