aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/glu/tessellator
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/glu/tessellator')
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/Dict.java26
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/GLUhalfEdge.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/GLUtessellatorImpl.java44
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/Geom.java46
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/Mesh.java96
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/Normal.java25
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQ.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java34
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java24
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java48
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java158
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/TessMono.java14
12 files changed, 263 insertions, 258 deletions
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Dict.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Dict.java
index 3ac9df67a..3bb759359 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Dict.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Dict.java
@@ -60,8 +60,8 @@ class Dict {
private Dict() {
}
- static Dict dictNewDict(Object frame, DictLeq leq) {
- Dict dict = new Dict();
+ static Dict dictNewDict(final Object frame, final DictLeq leq) {
+ final Dict dict = new Dict();
dict.head = new DictNode();
dict.head.key = null;
@@ -74,22 +74,22 @@ class Dict {
return dict;
}
- static void dictDeleteDict(Dict dict) {
+ static void dictDeleteDict(final Dict dict) {
dict.head = null;
dict.frame = null;
dict.leq = null;
}
- static DictNode dictInsert(Dict dict, Object key) {
+ static DictNode dictInsert(final Dict dict, final Object key) {
return dictInsertBefore(dict, dict.head, key);
}
- static DictNode dictInsertBefore(Dict dict, DictNode node, Object key) {
+ static DictNode dictInsertBefore(final Dict dict, DictNode node, final Object key) {
do {
node = node.prev;
} while (node.key != null && !dict.leq.leq(dict.frame, node.key, key));
- DictNode newNode = new DictNode();
+ final DictNode newNode = new DictNode();
newNode.key = key;
newNode.next = node.next;
node.next.prev = newNode;
@@ -99,32 +99,32 @@ class Dict {
return newNode;
}
- static Object dictKey(DictNode aNode) {
+ static Object dictKey(final DictNode aNode) {
return aNode.key;
}
- static DictNode dictSucc(DictNode aNode) {
+ static DictNode dictSucc(final DictNode aNode) {
return aNode.next;
}
- static DictNode dictPred(DictNode aNode) {
+ static DictNode dictPred(final DictNode aNode) {
return aNode.prev;
}
- static DictNode dictMin(Dict aDict) {
+ static DictNode dictMin(final Dict aDict) {
return aDict.head.next;
}
- static DictNode dictMax(Dict aDict) {
+ static DictNode dictMax(final Dict aDict) {
return aDict.head.prev;
}
- static void dictDelete(Dict dict, DictNode node) {
+ static void dictDelete(final Dict dict, final DictNode node) {
node.next.prev = node.prev;
node.prev.next = node.next;
}
- static DictNode dictSearch(Dict dict, Object key) {
+ static DictNode dictSearch(final Dict dict, final Object key) {
DictNode node = dict.head;
do {
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUhalfEdge.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUhalfEdge.java
index 29944f9b2..a849058c8 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUhalfEdge.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUhalfEdge.java
@@ -65,7 +65,7 @@ class GLUhalfEdge {
public int winding; /* change in winding number when crossing */
public boolean first;
- public GLUhalfEdge(boolean first) {
+ public GLUhalfEdge(final boolean first) {
this.first = first;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUtessellatorImpl.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUtessellatorImpl.java
index d594cb3eb..6f89a95f2 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUtessellatorImpl.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUtessellatorImpl.java
@@ -177,11 +177,11 @@ public class GLUtessellatorImpl implements GLUtessellator {
mesh = null;
}
- private void requireState(int newState) {
+ private void requireState(final int newState) {
if (state != newState) gotoState(newState);
}
- private void gotoState(int newState) {
+ private void gotoState(final int newState) {
while (state != newState) {
/* We change the current state one level at a time, to get to
* the desired state.
@@ -211,7 +211,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
requireState(TessState.T_DORMANT);
}
- public void gluTessProperty(int which, double value) {
+ public void gluTessProperty(final int which, final double value) {
switch (which) {
case GLU.GLU_TESS_TOLERANCE:
if (value < 0.0 || value > 1.0) break;
@@ -219,7 +219,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
return;
case GLU.GLU_TESS_WINDING_RULE:
- int windingRule = (int) value;
+ final int windingRule = (int) value;
if (windingRule != value) break; /* not an integer */
switch (windingRule) {
@@ -250,7 +250,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
}
/* Returns tessellator property */
- public void gluGetTessProperty(int which, double[] value, int value_offset) {
+ public void gluGetTessProperty(final int which, final double[] value, final int value_offset) {
switch (which) {
case GLU.GLU_TESS_TOLERANCE:
/* tolerance should be in range [0..1] */
@@ -279,13 +279,13 @@ public class GLUtessellatorImpl implements GLUtessellator {
}
} /* gluGetTessProperty() */
- public void gluTessNormal(double x, double y, double z) {
+ public void gluTessNormal(final double x, final double y, final double z) {
normal[0] = x;
normal[1] = y;
normal[2] = z;
}
- public void gluTessCallback(int which, GLUtessellatorCallback aCallback) {
+ public void gluTessCallback(final int which, final GLUtessellatorCallback aCallback) {
switch (which) {
case GLU.GLU_TESS_BEGIN:
callBegin = aCallback == null ? NULL_CB : aCallback;
@@ -340,7 +340,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
}
}
- private boolean addVertex(double[] coords, Object vertexData) {
+ private boolean addVertex(final double[] coords, final Object vertexData) {
GLUhalfEdge e;
e = lastEdge;
@@ -377,12 +377,12 @@ public class GLUtessellatorImpl implements GLUtessellator {
return true;
}
- private void cacheVertex(double[] coords, Object vertexData) {
+ private void cacheVertex(final double[] coords, final Object vertexData) {
if (cache[cacheCount] == null) {
cache[cacheCount] = new CachedVertex();
}
- CachedVertex v = cache[cacheCount];
+ final CachedVertex v = cache[cacheCount];
v.data = vertexData;
v.coords[0] = coords[0];
@@ -393,13 +393,13 @@ public class GLUtessellatorImpl implements GLUtessellator {
private boolean flushCache() {
- CachedVertex[] v = cache;
+ final CachedVertex[] v = cache;
mesh = Mesh.__gl_meshNewMesh();
if (mesh == null) return false;
for (int i = 0; i < cacheCount; i++) {
- CachedVertex vertex = v[i];
+ final CachedVertex vertex = v[i];
if (!addVertex(vertex.coords, vertex.data)) return false;
}
cacheCount = 0;
@@ -408,11 +408,11 @@ public class GLUtessellatorImpl implements GLUtessellator {
return true;
}
- public void gluTessVertex(double[] coords, int coords_offset, Object vertexData) {
+ public void gluTessVertex(final double[] coords, final int coords_offset, final Object vertexData) {
int i;
boolean tooLarge = false;
double x;
- double[] clamped = new double[3];
+ final double[] clamped = new double[3];
requireState(TessState.T_IN_CONTOUR);
@@ -456,7 +456,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
}
- public void gluTessBeginPolygon(Object data) {
+ public void gluTessBeginPolygon(final Object data) {
requireState(TessState.T_DORMANT);
state = TessState.T_IN_POLYGON;
@@ -573,7 +573,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
Mesh.__gl_meshDeleteMesh(mesh);
polygonData = null;
mesh = null;
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
callErrorOrErrorData(GLU.GLU_OUT_OF_MEMORY);
}
@@ -590,7 +590,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
/*ARGSUSED*/
- public void gluNextContour(int type) {
+ public void gluNextContour(final int type) {
gluTessEndContour();
gluTessBeginContour();
}
@@ -601,21 +601,21 @@ public class GLUtessellatorImpl implements GLUtessellator {
gluTessEndPolygon();
}
- void callBeginOrBeginData(int a) {
+ void callBeginOrBeginData(final int a) {
if (callBeginData != NULL_CB)
callBeginData.beginData(a, polygonData);
else
callBegin.begin(a);
}
- void callVertexOrVertexData(Object a) {
+ void callVertexOrVertexData(final Object a) {
if (callVertexData != NULL_CB)
callVertexData.vertexData(a, polygonData);
else
callVertex.vertex(a);
}
- void callEdgeFlagOrEdgeFlagData(boolean a) {
+ void callEdgeFlagOrEdgeFlagData(final boolean a) {
if (callEdgeFlagData != NULL_CB)
callEdgeFlagData.edgeFlagData(a, polygonData);
else
@@ -629,14 +629,14 @@ public class GLUtessellatorImpl implements GLUtessellator {
callEnd.end();
}
- void callCombineOrCombineData(double[] coords, Object[] vertexData, float[] weights, Object[] outData) {
+ void callCombineOrCombineData(final double[] coords, final Object[] vertexData, final float[] weights, final Object[] outData) {
if (callCombineData != NULL_CB)
callCombineData.combineData(coords, vertexData, weights, outData, polygonData);
else
callCombine.combine(coords, vertexData, weights, outData);
}
- void callErrorOrErrorData(int a) {
+ void callErrorOrErrorData(final int a) {
if (callErrorData != NULL_CB)
callErrorData.errorData(a, polygonData);
else
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Geom.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Geom.java
index 3da2d267e..493052f79 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Geom.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Geom.java
@@ -66,7 +66,7 @@ class Geom {
* let r be the negated result (this evaluates (uw)(v->s)), then
* r is guaranteed to satisfy MIN(u->t,w->t) <= r <= MAX(u->t,w->t).
*/
- static double EdgeEval(GLUvertex u, GLUvertex v, GLUvertex w) {
+ static double EdgeEval(final GLUvertex u, final GLUvertex v, final GLUvertex w) {
double gapL, gapR;
assert (VertLeq(u, v) && VertLeq(v, w));
@@ -85,7 +85,7 @@ class Geom {
return 0;
}
- static double EdgeSign(GLUvertex u, GLUvertex v, GLUvertex w) {
+ static double EdgeSign(final GLUvertex u, final GLUvertex v, final GLUvertex w) {
double gapL, gapR;
assert (VertLeq(u, v) && VertLeq(v, w));
@@ -105,7 +105,7 @@ class Geom {
* Define versions of EdgeSign, EdgeEval with s and t transposed.
*/
- static double TransEval(GLUvertex u, GLUvertex v, GLUvertex w) {
+ static double TransEval(final GLUvertex u, final GLUvertex v, final GLUvertex w) {
/* Given three vertices u,v,w such that TransLeq(u,v) && TransLeq(v,w),
* evaluates the t-coord of the edge uw at the s-coord of the vertex v.
* Returns v->s - (uw)(v->t), ie. the signed distance from uw to v.
@@ -134,7 +134,7 @@ class Geom {
return 0;
}
- static double TransSign(GLUvertex u, GLUvertex v, GLUvertex w) {
+ static double TransSign(final GLUvertex u, final GLUvertex v, final GLUvertex w) {
/* Returns a number whose sign matches TransEval(u,v,w) but which
* is cheaper to evaluate. Returns > 0, == 0 , or < 0
* as v is above, on, or below the edge uw.
@@ -154,7 +154,7 @@ class Geom {
}
- static boolean VertCCW(GLUvertex u, GLUvertex v, GLUvertex w) {
+ static boolean VertCCW(final GLUvertex u, final GLUvertex v, final GLUvertex w) {
/* For almost-degenerate situations, the results are not reliable.
* Unless the floating-point arithmetic can be performed without
* rounding errors, *any* implementation will give incorrect results
@@ -172,7 +172,7 @@ class Geom {
* MIN(x,y) <= r <= MAX(x,y), and the results are very accurate
* even when a and b differ greatly in magnitude.
*/
- static double Interpolate(double a, double x, double b, double y) {
+ static double Interpolate(double a, final double x, double b, final double y) {
a = (a < 0) ? 0 : a;
b = (b < 0) ? 0 : b;
if (a <= b) {
@@ -188,7 +188,7 @@ class Geom {
static void EdgeIntersect(GLUvertex o1, GLUvertex d1,
GLUvertex o2, GLUvertex d2,
- GLUvertex v)
+ final GLUvertex v)
/* Given edges (o1,d1) and (o2,d2), compute their point of intersection.
* The computed point is guaranteed to lie in the intersection of the
* bounding rectangles defined by each edge.
@@ -204,12 +204,12 @@ class Geom {
*/
if (!VertLeq(o1, d1)) {
- GLUvertex temp = o1;
+ final GLUvertex temp = o1;
o1 = d1;
d1 = temp;
}
if (!VertLeq(o2, d2)) {
- GLUvertex temp = o2;
+ final GLUvertex temp = o2;
o2 = d2;
d2 = temp;
}
@@ -248,12 +248,12 @@ class Geom {
/* Now repeat the process for t */
if (!TransLeq(o1, d1)) {
- GLUvertex temp = o1;
+ final GLUvertex temp = o1;
o1 = d1;
d1 = temp;
}
if (!TransLeq(o2, d2)) {
- GLUvertex temp = o2;
+ final GLUvertex temp = o2;
o2 = d2;
d2 = temp;
}
@@ -290,29 +290,29 @@ class Geom {
}
}
- static boolean VertEq(GLUvertex u, GLUvertex v) {
+ static boolean VertEq(final GLUvertex u, final GLUvertex v) {
return u.s == v.s && u.t == v.t;
}
- static boolean VertLeq(GLUvertex u, GLUvertex v) {
+ static boolean VertLeq(final GLUvertex u, final GLUvertex v) {
return u.s < v.s || (u.s == v.s && u.t <= v.t);
}
/* Versions of VertLeq, EdgeSign, EdgeEval with s and t transposed. */
- static boolean TransLeq(GLUvertex u, GLUvertex v) {
+ static boolean TransLeq(final GLUvertex u, final GLUvertex v) {
return u.t < v.t || (u.t == v.t && u.s <= v.s);
}
- static boolean EdgeGoesLeft(GLUhalfEdge e) {
+ static boolean EdgeGoesLeft(final GLUhalfEdge e) {
return VertLeq(e.Sym.Org, e.Org);
}
- static boolean EdgeGoesRight(GLUhalfEdge e) {
+ static boolean EdgeGoesRight(final GLUhalfEdge e) {
return VertLeq(e.Org, e.Sym.Org);
}
- static double VertL1dist(GLUvertex u, GLUvertex v) {
+ static double VertL1dist(final GLUvertex u, final GLUvertex v) {
return Math.abs(u.s - v.s) + Math.abs(u.t - v.t);
}
@@ -320,13 +320,13 @@ class Geom {
// Compute the cosine of the angle between the edges between o and
// v1 and between o and v2
- static double EdgeCos(GLUvertex o, GLUvertex v1, GLUvertex v2) {
- double ov1s = v1.s - o.s;
- double ov1t = v1.t - o.t;
- double ov2s = v2.s - o.s;
- double ov2t = v2.t - o.t;
+ static double EdgeCos(final GLUvertex o, final GLUvertex v1, final GLUvertex v2) {
+ final double ov1s = v1.s - o.s;
+ final double ov1t = v1.t - o.t;
+ final double ov2s = v2.s - o.s;
+ final double ov2t = v2.t - o.t;
double dotp = ov1s * ov2s + ov1t * ov2t;
- double len = Math.sqrt(ov1s * ov1s + ov1t * ov1t) * Math.sqrt(ov2s * ov2s + ov2t * ov2t);
+ final double len = Math.sqrt(ov1s * ov1s + ov1t * ov1t) * Math.sqrt(ov2s * ov2s + ov2t * ov2t);
if (len > 0.0) {
dotp /= len;
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Mesh.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Mesh.java
index eb48aa5a4..e855a5531 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Mesh.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Mesh.java
@@ -115,9 +115,9 @@ class Mesh {
* depending on whether a and b belong to different face or vertex rings.
* For more explanation see __gl_meshSplice() below.
*/
- static void Splice(jogamp.opengl.glu.tessellator.GLUhalfEdge a, jogamp.opengl.glu.tessellator.GLUhalfEdge b) {
- jogamp.opengl.glu.tessellator.GLUhalfEdge aOnext = a.Onext;
- jogamp.opengl.glu.tessellator.GLUhalfEdge bOnext = b.Onext;
+ static void Splice(final jogamp.opengl.glu.tessellator.GLUhalfEdge a, final jogamp.opengl.glu.tessellator.GLUhalfEdge b) {
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge aOnext = a.Onext;
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge bOnext = b.Onext;
aOnext.Sym.Lnext = b;
bOnext.Sym.Lnext = a;
@@ -131,11 +131,11 @@ class Mesh {
* the new vertex *before* vNext so that algorithms which walk the vertex
* list will not see the newly created vertices.
*/
- static void MakeVertex(jogamp.opengl.glu.tessellator.GLUvertex newVertex,
- jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig, jogamp.opengl.glu.tessellator.GLUvertex vNext) {
+ static void MakeVertex(final jogamp.opengl.glu.tessellator.GLUvertex newVertex,
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig, final jogamp.opengl.glu.tessellator.GLUvertex vNext) {
jogamp.opengl.glu.tessellator.GLUhalfEdge e;
jogamp.opengl.glu.tessellator.GLUvertex vPrev;
- jogamp.opengl.glu.tessellator.GLUvertex vNew = newVertex;
+ final jogamp.opengl.glu.tessellator.GLUvertex vNew = newVertex;
assert (vNew != null);
@@ -164,10 +164,10 @@ class Mesh {
* the new face *before* fNext so that algorithms which walk the face
* list will not see the newly created faces.
*/
- static void MakeFace(jogamp.opengl.glu.tessellator.GLUface newFace, jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig, jogamp.opengl.glu.tessellator.GLUface fNext) {
+ static void MakeFace(final jogamp.opengl.glu.tessellator.GLUface newFace, final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig, final jogamp.opengl.glu.tessellator.GLUface fNext) {
jogamp.opengl.glu.tessellator.GLUhalfEdge e;
jogamp.opengl.glu.tessellator.GLUface fPrev;
- jogamp.opengl.glu.tessellator.GLUface fNew = newFace;
+ final jogamp.opengl.glu.tessellator.GLUface fNew = newFace;
assert (fNew != null);
@@ -218,8 +218,9 @@ class Mesh {
/* KillVertex( vDel ) destroys a vertex and removes it from the global
* vertex list. It updates the vertex loop to point to a given new vertex.
*/
- static void KillVertex(jogamp.opengl.glu.tessellator.GLUvertex vDel, jogamp.opengl.glu.tessellator.GLUvertex newOrg) {
- jogamp.opengl.glu.tessellator.GLUhalfEdge e, eStart = vDel.anEdge;
+ static void KillVertex(final jogamp.opengl.glu.tessellator.GLUvertex vDel, final jogamp.opengl.glu.tessellator.GLUvertex newOrg) {
+ jogamp.opengl.glu.tessellator.GLUhalfEdge e;
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge eStart = vDel.anEdge;
jogamp.opengl.glu.tessellator.GLUvertex vPrev, vNext;
/* change the origin of all affected edges */
@@ -239,8 +240,9 @@ class Mesh {
/* KillFace( fDel ) destroys a face and removes it from the global face
* list. It updates the face loop to point to a given new face.
*/
- static void KillFace(jogamp.opengl.glu.tessellator.GLUface fDel, jogamp.opengl.glu.tessellator.GLUface newLface) {
- jogamp.opengl.glu.tessellator.GLUhalfEdge e, eStart = fDel.anEdge;
+ static void KillFace(final jogamp.opengl.glu.tessellator.GLUface fDel, final jogamp.opengl.glu.tessellator.GLUface newLface) {
+ jogamp.opengl.glu.tessellator.GLUhalfEdge e;
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge eStart = fDel.anEdge;
jogamp.opengl.glu.tessellator.GLUface fPrev, fNext;
/* change the left face of all affected edges */
@@ -263,10 +265,10 @@ class Mesh {
/* __gl_meshMakeEdge creates one edge, two vertices, and a loop (face).
* The loop consists of the two new half-edges.
*/
- public static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshMakeEdge(jogamp.opengl.glu.tessellator.GLUmesh mesh) {
- jogamp.opengl.glu.tessellator.GLUvertex newVertex1 = new jogamp.opengl.glu.tessellator.GLUvertex();
- jogamp.opengl.glu.tessellator.GLUvertex newVertex2 = new jogamp.opengl.glu.tessellator.GLUvertex();
- jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
+ public static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshMakeEdge(final jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+ final jogamp.opengl.glu.tessellator.GLUvertex newVertex1 = new jogamp.opengl.glu.tessellator.GLUvertex();
+ final jogamp.opengl.glu.tessellator.GLUvertex newVertex2 = new jogamp.opengl.glu.tessellator.GLUvertex();
+ final jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
jogamp.opengl.glu.tessellator.GLUhalfEdge e;
e = MakeEdge(mesh.eHead);
@@ -302,7 +304,7 @@ class Mesh {
* If eDst == eOrg->Onext, the new vertex will have a single edge.
* If eDst == eOrg->Oprev, the old vertex will have a single edge.
*/
- public static boolean __gl_meshSplice(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg, jogamp.opengl.glu.tessellator.GLUhalfEdge eDst) {
+ public static boolean __gl_meshSplice(final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg, final jogamp.opengl.glu.tessellator.GLUhalfEdge eDst) {
boolean joiningLoops = false;
boolean joiningVertices = false;
@@ -323,7 +325,7 @@ class Mesh {
Splice(eDst, eOrg);
if (!joiningVertices) {
- jogamp.opengl.glu.tessellator.GLUvertex newVertex = new jogamp.opengl.glu.tessellator.GLUvertex();
+ final jogamp.opengl.glu.tessellator.GLUvertex newVertex = new jogamp.opengl.glu.tessellator.GLUvertex();
/* We split one vertex into two -- the new vertex is eDst.Org.
* Make sure the old vertex points to a valid half-edge.
@@ -332,7 +334,7 @@ class Mesh {
eOrg.Org.anEdge = eOrg;
}
if (!joiningLoops) {
- jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
+ final jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
/* We split one loop into two -- the new loop is eDst.Lface.
* Make sure the old face points to a valid half-edge.
@@ -355,8 +357,8 @@ class Mesh {
* plus a few calls to memFree, but this would allocate and delete
* unnecessary vertices and faces.
*/
- static boolean __gl_meshDelete(jogamp.opengl.glu.tessellator.GLUhalfEdge eDel) {
- jogamp.opengl.glu.tessellator.GLUhalfEdge eDelSym = eDel.Sym;
+ static boolean __gl_meshDelete(final jogamp.opengl.glu.tessellator.GLUhalfEdge eDel) {
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge eDelSym = eDel.Sym;
boolean joiningLoops = false;
/* First step: disconnect the origin vertex eDel.Org. We make all
@@ -377,7 +379,7 @@ class Mesh {
Splice(eDel, eDel.Sym.Lnext);
if (!joiningLoops) {
- jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
+ final jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
/* We are splitting one loop into two -- create a new loop for eDel. */
MakeFace(newFace, eDel, eDel.Lface);
@@ -415,9 +417,9 @@ class Mesh {
* eNew == eOrg.Lnext, and eNew.Dst is a newly created vertex.
* eOrg and eNew will have the same left face.
*/
- static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshAddEdgeVertex(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg) {
+ static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshAddEdgeVertex(final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg) {
jogamp.opengl.glu.tessellator.GLUhalfEdge eNewSym;
- jogamp.opengl.glu.tessellator.GLUhalfEdge eNew = MakeEdge(eOrg);
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge eNew = MakeEdge(eOrg);
eNewSym = eNew.Sym;
@@ -427,7 +429,7 @@ class Mesh {
/* Set the vertex and face information */
eNew.Org = eOrg.Sym.Org;
{
- jogamp.opengl.glu.tessellator.GLUvertex newVertex = new jogamp.opengl.glu.tessellator.GLUvertex();
+ final jogamp.opengl.glu.tessellator.GLUvertex newVertex = new jogamp.opengl.glu.tessellator.GLUvertex();
MakeVertex(newVertex, eNewSym, eNew.Org);
}
@@ -441,9 +443,9 @@ class Mesh {
* such that eNew == eOrg.Lnext. The new vertex is eOrg.Sym.Org == eNew.Org.
* eOrg and eNew will have the same left face.
*/
- public static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshSplitEdge(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg) {
+ public static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshSplitEdge(final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg) {
jogamp.opengl.glu.tessellator.GLUhalfEdge eNew;
- jogamp.opengl.glu.tessellator.GLUhalfEdge tempHalfEdge = __gl_meshAddEdgeVertex(eOrg);
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge tempHalfEdge = __gl_meshAddEdgeVertex(eOrg);
eNew = tempHalfEdge.Sym;
@@ -472,10 +474,10 @@ class Mesh {
* If (eOrg.Lnext == eDst), the old face is reduced to a single edge.
* If (eOrg.Lnext.Lnext == eDst), the old face is reduced to two edges.
*/
- static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshConnect(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg, jogamp.opengl.glu.tessellator.GLUhalfEdge eDst) {
+ static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshConnect(final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg, final jogamp.opengl.glu.tessellator.GLUhalfEdge eDst) {
jogamp.opengl.glu.tessellator.GLUhalfEdge eNewSym;
boolean joiningLoops = false;
- jogamp.opengl.glu.tessellator.GLUhalfEdge eNew = MakeEdge(eOrg);
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge eNew = MakeEdge(eOrg);
eNewSym = eNew.Sym;
@@ -498,7 +500,7 @@ class Mesh {
eOrg.Lface.anEdge = eNewSym;
if (!joiningLoops) {
- jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
+ final jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
/* We split one loop into two -- the new loop is eNew.Lface */
MakeFace(newFace, eNew, eOrg.Lface);
@@ -516,8 +518,8 @@ class Mesh {
* An entire mesh can be deleted by zapping its faces, one at a time,
* in any order. Zapped faces cannot be used in further mesh operations!
*/
- static void __gl_meshZapFace(jogamp.opengl.glu.tessellator.GLUface fZap) {
- jogamp.opengl.glu.tessellator.GLUhalfEdge eStart = fZap.anEdge;
+ static void __gl_meshZapFace(final jogamp.opengl.glu.tessellator.GLUface fZap) {
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge eStart = fZap.anEdge;
jogamp.opengl.glu.tessellator.GLUhalfEdge e, eNext, eSym;
jogamp.opengl.glu.tessellator.GLUface fPrev, fNext;
@@ -566,7 +568,7 @@ class Mesh {
jogamp.opengl.glu.tessellator.GLUface f;
jogamp.opengl.glu.tessellator.GLUhalfEdge e;
jogamp.opengl.glu.tessellator.GLUhalfEdge eSym;
- jogamp.opengl.glu.tessellator.GLUmesh mesh = new jogamp.opengl.glu.tessellator.GLUmesh();
+ final jogamp.opengl.glu.tessellator.GLUmesh mesh = new jogamp.opengl.glu.tessellator.GLUmesh();
v = mesh.vHead;
f = mesh.fHead;
@@ -609,13 +611,13 @@ class Mesh {
/* __gl_meshUnion( mesh1, mesh2 ) forms the union of all structures in
* both meshes, and returns the new mesh (the old meshes are destroyed).
*/
- static jogamp.opengl.glu.tessellator.GLUmesh __gl_meshUnion(jogamp.opengl.glu.tessellator.GLUmesh mesh1, jogamp.opengl.glu.tessellator.GLUmesh mesh2) {
- jogamp.opengl.glu.tessellator.GLUface f1 = mesh1.fHead;
- jogamp.opengl.glu.tessellator.GLUvertex v1 = mesh1.vHead;
- jogamp.opengl.glu.tessellator.GLUhalfEdge e1 = mesh1.eHead;
- jogamp.opengl.glu.tessellator.GLUface f2 = mesh2.fHead;
- jogamp.opengl.glu.tessellator.GLUvertex v2 = mesh2.vHead;
- jogamp.opengl.glu.tessellator.GLUhalfEdge e2 = mesh2.eHead;
+ static jogamp.opengl.glu.tessellator.GLUmesh __gl_meshUnion(final jogamp.opengl.glu.tessellator.GLUmesh mesh1, final jogamp.opengl.glu.tessellator.GLUmesh mesh2) {
+ final jogamp.opengl.glu.tessellator.GLUface f1 = mesh1.fHead;
+ final jogamp.opengl.glu.tessellator.GLUvertex v1 = mesh1.vHead;
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge e1 = mesh1.eHead;
+ final jogamp.opengl.glu.tessellator.GLUface f2 = mesh2.fHead;
+ final jogamp.opengl.glu.tessellator.GLUvertex v2 = mesh2.vHead;
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge e2 = mesh2.eHead;
/* Add the faces, vertices, and edges of mesh2 to those of mesh1 */
if (f2.next != f2) {
@@ -645,8 +647,8 @@ class Mesh {
/* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh.
*/
- static void __gl_meshDeleteMeshZap(jogamp.opengl.glu.tessellator.GLUmesh mesh) {
- jogamp.opengl.glu.tessellator.GLUface fHead = mesh.fHead;
+ static void __gl_meshDeleteMeshZap(final jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+ final jogamp.opengl.glu.tessellator.GLUface fHead = mesh.fHead;
while (fHead.next != fHead) {
__gl_meshZapFace(fHead.next);
@@ -656,7 +658,7 @@ class Mesh {
/* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh.
*/
- public static void __gl_meshDeleteMesh(jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+ public static void __gl_meshDeleteMesh(final jogamp.opengl.glu.tessellator.GLUmesh mesh) {
jogamp.opengl.glu.tessellator.GLUface f, fNext;
jogamp.opengl.glu.tessellator.GLUvertex v, vNext;
jogamp.opengl.glu.tessellator.GLUhalfEdge e, eNext;
@@ -677,10 +679,10 @@ class Mesh {
/* __gl_meshCheckMesh( mesh ) checks a mesh for self-consistency.
*/
- public static void __gl_meshCheckMesh(jogamp.opengl.glu.tessellator.GLUmesh mesh) {
- jogamp.opengl.glu.tessellator.GLUface fHead = mesh.fHead;
- jogamp.opengl.glu.tessellator.GLUvertex vHead = mesh.vHead;
- jogamp.opengl.glu.tessellator.GLUhalfEdge eHead = mesh.eHead;
+ public static void __gl_meshCheckMesh(final jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+ final jogamp.opengl.glu.tessellator.GLUface fHead = mesh.fHead;
+ final jogamp.opengl.glu.tessellator.GLUvertex vHead = mesh.vHead;
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge eHead = mesh.eHead;
jogamp.opengl.glu.tessellator.GLUface f, fPrev;
jogamp.opengl.glu.tessellator.GLUvertex v, vPrev;
jogamp.opengl.glu.tessellator.GLUhalfEdge e, ePrev;
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Normal.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Normal.java
index 196e6cf27..44668a943 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Normal.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Normal.java
@@ -83,11 +83,11 @@ class Normal {
}
}
- private static double Dot(double[] u, double[] v) {
+ private static double Dot(final double[] u, final double[] v) {
return (u[0] * v[0] + u[1] * v[1] + u[2] * v[2]);
}
- static void Normalize(double[] v) {
+ static void Normalize(final double[] v) {
double len = v[0] * v[0] + v[1] * v[1] + v[2] * v[2];
assert (len > 0);
@@ -97,7 +97,7 @@ class Normal {
v[2] /= len;
}
- static int LongAxis(double[] v) {
+ static int LongAxis(final double[] v) {
int i = 0;
if (Math.abs(v[1]) > Math.abs(v[0])) {
@@ -109,12 +109,12 @@ class Normal {
return i;
}
- static void ComputeNormal(GLUtessellatorImpl tess, double[] norm) {
+ static void ComputeNormal(final GLUtessellatorImpl tess, final double[] norm) {
jogamp.opengl.glu.tessellator.GLUvertex v, v1, v2;
double c, tLen2, maxLen2;
double[] maxVal, minVal, d1, d2, tNorm;
jogamp.opengl.glu.tessellator.GLUvertex[] maxVert, minVert;
- jogamp.opengl.glu.tessellator.GLUvertex vHead = tess.mesh.vHead;
+ final jogamp.opengl.glu.tessellator.GLUvertex vHead = tess.mesh.vHead;
int i;
maxVal = new double[3];
@@ -192,10 +192,12 @@ class Normal {
}
}
- static void CheckOrientation(GLUtessellatorImpl tess) {
+ static void CheckOrientation(final GLUtessellatorImpl tess) {
double area;
- jogamp.opengl.glu.tessellator.GLUface f, fHead = tess.mesh.fHead;
- jogamp.opengl.glu.tessellator.GLUvertex v, vHead = tess.mesh.vHead;
+ jogamp.opengl.glu.tessellator.GLUface f;
+ final jogamp.opengl.glu.tessellator.GLUface fHead = tess.mesh.fHead;
+ jogamp.opengl.glu.tessellator.GLUvertex v;
+ final jogamp.opengl.glu.tessellator.GLUvertex vHead = tess.mesh.vHead;
jogamp.opengl.glu.tessellator.GLUhalfEdge e;
/* When we compute the normal automatically, we choose the orientation
@@ -224,10 +226,11 @@ class Normal {
/* Determine the polygon normal and project vertices onto the plane
* of the polygon.
*/
- public static void __gl_projectPolygon(GLUtessellatorImpl tess) {
- jogamp.opengl.glu.tessellator.GLUvertex v, vHead = tess.mesh.vHead;
+ public static void __gl_projectPolygon(final GLUtessellatorImpl tess) {
+ jogamp.opengl.glu.tessellator.GLUvertex v;
+ final jogamp.opengl.glu.tessellator.GLUvertex vHead = tess.mesh.vHead;
double w;
- double[] norm = new double[3];
+ final double[] norm = new double[3];
double[] sUnit, tUnit;
int i;
boolean computedNormal = false;
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQ.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQ.java
index 25405ad64..1f9b9e5ed 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQ.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQ.java
@@ -75,11 +75,11 @@ abstract class PriorityQ {
// #else
/* Violates modularity, but a little faster */
// #include "geom.h"
- public static boolean LEQ(Leq leq, Object x, Object y) {
+ public static boolean LEQ(final Leq leq, final Object x, final Object y) {
return jogamp.opengl.glu.tessellator.Geom.VertLeq((jogamp.opengl.glu.tessellator.GLUvertex) x, (jogamp.opengl.glu.tessellator.GLUvertex) y);
}
- static PriorityQ pqNewPriorityQ(Leq leq) {
+ static PriorityQ pqNewPriorityQ(final Leq leq) {
return new PriorityQSort(leq);
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java
index 1ac0fd438..74d981907 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java
@@ -61,7 +61,7 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
jogamp.opengl.glu.tessellator.PriorityQ.Leq leq;
/* really __gl_pqHeapNewPriorityQ */
- public PriorityQHeap(jogamp.opengl.glu.tessellator.PriorityQ.Leq leq) {
+ public PriorityQHeap(final jogamp.opengl.glu.tessellator.PriorityQ.Leq leq) {
size = 0;
max = jogamp.opengl.glu.tessellator.PriorityQ.INIT_SIZE;
nodes = new jogamp.opengl.glu.tessellator.PriorityQ.PQnode[jogamp.opengl.glu.tessellator.PriorityQ.INIT_SIZE + 1];
@@ -88,8 +88,8 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
}
void FloatDown(int curr) {
- jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
- jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
+ final jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
+ final jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
int hCurr, hChild;
int child;
@@ -117,8 +117,8 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
void FloatUp(int curr) {
- jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
- jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
+ final jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
+ final jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
int hCurr, hParent;
int parent;
@@ -155,19 +155,19 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
/* really __gl_pqHeapInsert */
/* returns LONG_MAX iff out of memory */
@Override
- int pqInsert(Object keyNew) {
+ int pqInsert(final Object keyNew) {
int curr;
int free;
curr = ++size;
if ((curr * 2) > max) {
- jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] saveNodes = nodes;
- jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] saveHandles = handles;
+ final jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] saveNodes = nodes;
+ final jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] saveHandles = handles;
/* If the heap overflows, double its size. */
max <<= 1;
// pq->nodes = (PQnode *)memRealloc( pq->nodes, (size_t) ((pq->max + 1) * sizeof( pq->nodes[0] )));
- PriorityQ.PQnode[] pqNodes = new PriorityQ.PQnode[max + 1];
+ final PriorityQ.PQnode[] pqNodes = new PriorityQ.PQnode[max + 1];
System.arraycopy( nodes, 0, pqNodes, 0, nodes.length );
for (int i = nodes.length; i < pqNodes.length; i++) {
pqNodes[i] = new PQnode();
@@ -179,7 +179,7 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
}
// pq->handles = (PQhandleElem *)memRealloc( pq->handles,(size_t)((pq->max + 1) * sizeof( pq->handles[0] )));
- PriorityQ.PQhandleElem[] pqHandles = new PriorityQ.PQhandleElem[max + 1];
+ final PriorityQ.PQhandleElem[] pqHandles = new PriorityQ.PQhandleElem[max + 1];
System.arraycopy( handles, 0, pqHandles, 0, handles.length );
for (int i = handles.length; i < pqHandles.length; i++) {
pqHandles[i] = new PQhandleElem();
@@ -212,10 +212,10 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
/* really __gl_pqHeapExtractMin */
@Override
Object pqExtractMin() {
- jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
- jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
- int hMin = n[1].handle;
- Object min = h[hMin].key;
+ final jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
+ final jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
+ final int hMin = n[1].handle;
+ final Object min = h[hMin].key;
if (size > 0) {
n[1].handle = n[size].handle;
@@ -234,9 +234,9 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
/* really __gl_pqHeapDelete */
@Override
- void pqDelete(int hCurr) {
- jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
- jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
+ void pqDelete(final int hCurr) {
+ final jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
+ final jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
int curr;
assert (hCurr >= 1 && hCurr <= max && h[hCurr].key != null);
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java
index cf54b15c3..45e994b67 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java
@@ -59,7 +59,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
boolean initialized;
jogamp.opengl.glu.tessellator.PriorityQ.Leq leq;
- public PriorityQSort(jogamp.opengl.glu.tessellator.PriorityQ.Leq leq) {
+ public PriorityQSort(final jogamp.opengl.glu.tessellator.PriorityQ.Leq leq) {
heap = new jogamp.opengl.glu.tessellator.PriorityQHeap(leq);
keys = new Object[jogamp.opengl.glu.tessellator.PriorityQ.INIT_SIZE];
@@ -78,17 +78,17 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
keys = null;
}
- private static boolean LT(jogamp.opengl.glu.tessellator.PriorityQ.Leq leq, Object x, Object y) {
- return (!jogamp.opengl.glu.tessellator.PriorityQHeap.LEQ(leq, y, x));
+ private static boolean LT(final jogamp.opengl.glu.tessellator.PriorityQ.Leq leq, final Object x, final Object y) {
+ return (!PriorityQ.LEQ(leq, y, x));
}
- private static boolean GT(jogamp.opengl.glu.tessellator.PriorityQ.Leq leq, Object x, Object y) {
- return (!jogamp.opengl.glu.tessellator.PriorityQHeap.LEQ(leq, x, y));
+ private static boolean GT(final jogamp.opengl.glu.tessellator.PriorityQ.Leq leq, final Object x, final Object y) {
+ return (!PriorityQ.LEQ(leq, x, y));
}
- private static void Swap(int[] array, int a, int b) {
+ private static void Swap(final int[] array, final int a, final int b) {
if (true) {
- int tmp = array[a];
+ final int tmp = array[a];
array[a] = array[b];
array[b] = tmp;
} else {
@@ -105,7 +105,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
boolean pqInit() {
int p, r, i, j;
int piv;
- Stack[] stack = new Stack[50];
+ final Stack[] stack = new Stack[50];
for (int k = 0; k < stack.length; k++) {
stack[k] = new Stack();
}
@@ -194,7 +194,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
/* really __gl_pqSortInsert */
/* returns LONG_MAX iff out of memory */
@Override
- int pqInsert(Object keyNew) {
+ int pqInsert(final Object keyNew) {
int curr;
if (initialized) {
@@ -202,12 +202,12 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
}
curr = size;
if (++size >= max) {
- Object[] saveKey = keys;
+ final Object[] saveKey = keys;
/* If the heap overflows, double its size. */
max <<= 1;
// pq->keys = (PQHeapKey *)memRealloc( pq->keys,(size_t)(pq->max * sizeof( pq->keys[0] )));
- Object[] pqKeys = new Object[max];
+ final Object[] pqKeys = new Object[max];
System.arraycopy( keys, 0, pqKeys, 0, keys.length );
keys = pqKeys;
if (keys == null) {
@@ -254,7 +254,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
sortMin = keys[order[size - 1]];
if (!heap.pqIsEmpty()) {
heapMin = heap.pqMinimum();
- if (jogamp.opengl.glu.tessellator.PriorityQHeap.LEQ(leq, heapMin, sortMin)) {
+ if (PriorityQ.LEQ(leq, heapMin, sortMin)) {
return heapMin;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java
index a2e973508..6325de8d2 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java
@@ -73,7 +73,7 @@ class Render {
public FaceCount() {
}
- public FaceCount(long size, jogamp.opengl.glu.tessellator.GLUhalfEdge eStart, renderCallBack render) {
+ public FaceCount(final long size, final jogamp.opengl.glu.tessellator.GLUhalfEdge eStart, final renderCallBack render) {
this.size = size;
this.eStart = eStart;
this.render = render;
@@ -97,7 +97,7 @@ class Render {
*
* The rendering output is provided as callbacks (see the api).
*/
- public static void __gl_renderMesh(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+ public static void __gl_renderMesh(final GLUtessellatorImpl tess, final jogamp.opengl.glu.tessellator.GLUmesh mesh) {
jogamp.opengl.glu.tessellator.GLUface f;
/* Make a list of separate triangles so we can render them all at once */
@@ -124,7 +124,7 @@ class Render {
}
- static void RenderMaximumFaceGroup(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUface fOrig) {
+ static void RenderMaximumFaceGroup(final GLUtessellatorImpl tess, final jogamp.opengl.glu.tessellator.GLUface fOrig) {
/* We want to find the largest triangle fan or strip of unmarked faces
* which includes the given face fOrig. There are 3 possible fans
* passing through fOrig (one centered at each vertex), and 3 possible
@@ -132,7 +132,7 @@ class Render {
* is to try all of these, and take the primitive which uses the most
* triangles (a greedy approach).
*/
- jogamp.opengl.glu.tessellator.GLUhalfEdge e = fOrig.anEdge;
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge e = fOrig.anEdge;
FaceCount max = new FaceCount();
FaceCount newFace = new FaceCount();
@@ -178,11 +178,11 @@ class Render {
* more complicated, and we need a general tracking method like the
* one here.
*/
- private static boolean Marked(jogamp.opengl.glu.tessellator.GLUface f) {
+ private static boolean Marked(final jogamp.opengl.glu.tessellator.GLUface f) {
return !f.inside || f.marked;
}
- private static GLUface AddToTrail(jogamp.opengl.glu.tessellator.GLUface f, jogamp.opengl.glu.tessellator.GLUface t) {
+ private static GLUface AddToTrail(final jogamp.opengl.glu.tessellator.GLUface f, final jogamp.opengl.glu.tessellator.GLUface t) {
f.trail = t;
f.marked = true;
return f;
@@ -199,12 +199,12 @@ class Render {
}
}
- static FaceCount MaximumFan(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig) {
+ static FaceCount MaximumFan(final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig) {
/* eOrig.Lface is the face we want to render. We want to find the size
* of a maximal fan around eOrig.Org. To do this we just walk around
* the origin vertex as far as possible in both directions.
*/
- FaceCount newFace = new FaceCount(0, null, renderFan);
+ final FaceCount newFace = new FaceCount(0, null, renderFan);
jogamp.opengl.glu.tessellator.GLUface trail = null;
jogamp.opengl.glu.tessellator.GLUhalfEdge e;
@@ -223,11 +223,11 @@ class Render {
}
- private static boolean IsEven(long n) {
+ private static boolean IsEven(final long n) {
return (n & 0x1L) == 0;
}
- static FaceCount MaximumStrip(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig) {
+ static FaceCount MaximumStrip(final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig) {
/* Here we are looking for a maximal strip that contains the vertices
* eOrig.Org, eOrig.Dst, eOrig.Lnext.Dst (in that order or the
* reverse, such that all triangles are oriented CCW).
@@ -238,7 +238,7 @@ class Render {
* We walk the strip starting on a side with an even number of triangles;
* if both side have an odd number, we are forced to shorten one side.
*/
- FaceCount newFace = new FaceCount(0, null, renderStrip);
+ final FaceCount newFace = new FaceCount(0, null, renderStrip);
long headSize = 0, tailSize = 0;
jogamp.opengl.glu.tessellator.GLUface trail = null;
jogamp.opengl.glu.tessellator.GLUhalfEdge e, eTail, eHead;
@@ -280,7 +280,7 @@ class Render {
private static class RenderTriangle implements renderCallBack {
@Override
- public void render(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
+ public void render(final GLUtessellatorImpl tess, final jogamp.opengl.glu.tessellator.GLUhalfEdge e, final long size) {
/* Just add the triangle to a triangle list, so we can render all
* the separate triangles at once.
*/
@@ -290,7 +290,7 @@ class Render {
}
- static void RenderLonelyTriangles(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUface f) {
+ static void RenderLonelyTriangles(final GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUface f) {
/* Now we render all the separate triangles which could not be
* grouped into a triangle fan or strip.
*/
@@ -325,7 +325,7 @@ class Render {
private static class RenderFan implements renderCallBack {
@Override
- public void render(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
+ public void render(final GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
/* Render as many CCW triangles as possible in a fan starting from
* edge "e". The fan *should* contain exactly "size" triangles
* (otherwise we've goofed up somewhere).
@@ -348,7 +348,7 @@ class Render {
private static class RenderStrip implements renderCallBack {
@Override
- public void render(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
+ public void render(final GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
/* Render as many CCW triangles as possible in a strip starting from
* edge "e". The strip *should* contain exactly "size" triangles
* (otherwise we've goofed up somewhere).
@@ -381,7 +381,7 @@ class Render {
* contour for each face marked "inside". The rendering output is
* provided as callbacks (see the api).
*/
- public static void __gl_renderBoundary(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+ public static void __gl_renderBoundary(final GLUtessellatorImpl tess, final jogamp.opengl.glu.tessellator.GLUmesh mesh) {
jogamp.opengl.glu.tessellator.GLUface f;
jogamp.opengl.glu.tessellator.GLUhalfEdge e;
@@ -403,7 +403,7 @@ class Render {
private static final int SIGN_INCONSISTENT = 2;
- static int ComputeNormal(GLUtessellatorImpl tess, double[] norm, boolean check)
+ static int ComputeNormal(final GLUtessellatorImpl tess, final double[] norm, final boolean check)
/*
* If check==false, we compute the polygon normal and place it in norm[].
* If check==true, we check that each triangle in the fan from v0 has a
@@ -412,13 +412,13 @@ class Render {
* are degenerate return 0; otherwise (no consistent orientation) return
* SIGN_INCONSISTENT.
*/ {
- jogamp.opengl.glu.tessellator.CachedVertex[] v = tess.cache;
+ final jogamp.opengl.glu.tessellator.CachedVertex[] v = tess.cache;
// CachedVertex vn = v0 + tess.cacheCount;
- int vn = tess.cacheCount;
+ final int vn = tess.cacheCount;
// CachedVertex vc;
int vc;
double dot, xc, yc, zc, xp, yp, zp;
- double[] n = new double[3];
+ final double[] n = new double[3];
int sign = 0;
/* Find the polygon normal. It is important to get a reasonable
@@ -490,13 +490,13 @@ class Render {
* Returns true if the polygon was successfully rendered. The rendering
* output is provided as callbacks (see the api).
*/
- public static boolean __gl_renderCache(GLUtessellatorImpl tess) {
- jogamp.opengl.glu.tessellator.CachedVertex[] v = tess.cache;
+ public static boolean __gl_renderCache(final GLUtessellatorImpl tess) {
+ final jogamp.opengl.glu.tessellator.CachedVertex[] v = tess.cache;
// CachedVertex vn = v0 + tess.cacheCount;
- int vn = tess.cacheCount;
+ final int vn = tess.cacheCount;
// CachedVertex vc;
int vc;
- double[] norm = new double[3];
+ final double[] norm = new double[3];
int sign;
if (tess.cacheCount < 3) {
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java
index d2c0db61e..9cf05378c 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java
@@ -62,7 +62,7 @@ class Sweep {
// #ifdef FOR_TRITE_TEST_PROGRAM
// extern void DebugEvent( GLUtessellator *tess );
// #else
- private static void DebugEvent(GLUtessellatorImpl tess) {
+ private static void DebugEvent(final GLUtessellatorImpl tess) {
}
// #endif
@@ -100,21 +100,21 @@ class Sweep {
/* When we merge two edges into one, we need to compute the combined
* winding of the new edge.
*/
- private static void AddWinding(GLUhalfEdge eDst, GLUhalfEdge eSrc) {
+ private static void AddWinding(final GLUhalfEdge eDst, final GLUhalfEdge eSrc) {
eDst.winding += eSrc.winding;
eDst.Sym.winding += eSrc.Sym.winding;
}
- private static ActiveRegion RegionBelow(ActiveRegion r) {
+ private static ActiveRegion RegionBelow(final ActiveRegion r) {
return ((ActiveRegion) Dict.dictKey(Dict.dictPred(r.nodeUp)));
}
- private static ActiveRegion RegionAbove(ActiveRegion r) {
+ private static ActiveRegion RegionAbove(final ActiveRegion r) {
return ((ActiveRegion) Dict.dictKey(Dict.dictSucc(r.nodeUp)));
}
- static boolean EdgeLeq(GLUtessellatorImpl tess, ActiveRegion reg1, ActiveRegion reg2)
+ static boolean EdgeLeq(final GLUtessellatorImpl tess, final ActiveRegion reg1, final ActiveRegion reg2)
/*
* Both edges must be directed from right to left (this is the canonical
* direction for the upper edge of each region).
@@ -126,7 +126,7 @@ class Sweep {
* Special case: if both edge destinations are at the sweep event,
* we sort the edges by slope (they would otherwise compare equally).
*/ {
- GLUvertex event = tess.event;
+ final GLUvertex event = tess.event;
GLUhalfEdge e1, e2;
double t1, t2;
@@ -156,7 +156,7 @@ class Sweep {
}
- static void DeleteRegion(GLUtessellatorImpl tess, ActiveRegion reg) {
+ static void DeleteRegion(final GLUtessellatorImpl tess, final ActiveRegion reg) {
if (reg.fixUpperEdge) {
/* It was created with zero winding number, so it better be
* deleted with zero winding number (ie. it better not get merged
@@ -169,7 +169,7 @@ class Sweep {
}
- static boolean FixUpperEdge(ActiveRegion reg, GLUhalfEdge newEdge)
+ static boolean FixUpperEdge(final ActiveRegion reg, final GLUhalfEdge newEdge)
/*
* Replace an upper edge which needs fixing (see ConnectRightVertex).
*/ {
@@ -183,7 +183,7 @@ class Sweep {
}
static ActiveRegion TopLeftRegion(ActiveRegion reg) {
- GLUvertex org = reg.eUp.Org;
+ final GLUvertex org = reg.eUp.Org;
GLUhalfEdge e;
/* Find the region above the uppermost edge with the same origin */
@@ -204,7 +204,7 @@ class Sweep {
}
static ActiveRegion TopRightRegion(ActiveRegion reg) {
- GLUvertex dst = reg.eUp.Sym.Org;
+ final GLUvertex dst = reg.eUp.Sym.Org;
/* Find the region above the uppermost edge with the same destination */
do {
@@ -213,16 +213,16 @@ class Sweep {
return reg;
}
- static ActiveRegion AddRegionBelow(GLUtessellatorImpl tess,
- ActiveRegion regAbove,
- GLUhalfEdge eNewUp)
+ static ActiveRegion AddRegionBelow(final GLUtessellatorImpl tess,
+ final ActiveRegion regAbove,
+ final GLUhalfEdge eNewUp)
/*
* Add a new active region to the sweep line, *somewhere* below "regAbove"
* (according to where the new edge belongs in the sweep-line dictionary).
* The upper edge of the new region will be "eNewUp".
* Winding number and "inside" flag are not updated.
*/ {
- ActiveRegion regNew = new ActiveRegion();
+ final ActiveRegion regNew = new ActiveRegion();
if (regNew == null) throw new RuntimeException();
regNew.eUp = eNewUp;
@@ -237,7 +237,7 @@ class Sweep {
return regNew;
}
- static boolean IsWindingInside(GLUtessellatorImpl tess, int n) {
+ static boolean IsWindingInside(final GLUtessellatorImpl tess, final int n) {
switch (tess.windingRule) {
case GLU.GLU_TESS_WINDING_ODD:
return (n & 1) != 0;
@@ -257,13 +257,13 @@ class Sweep {
}
- static void ComputeWinding(GLUtessellatorImpl tess, ActiveRegion reg) {
+ static void ComputeWinding(final GLUtessellatorImpl tess, final ActiveRegion reg) {
reg.windingNumber = RegionAbove(reg).windingNumber + reg.eUp.winding;
reg.inside = IsWindingInside(tess, reg.windingNumber);
}
- static void FinishRegion(GLUtessellatorImpl tess, ActiveRegion reg)
+ static void FinishRegion(final GLUtessellatorImpl tess, final ActiveRegion reg)
/*
* Delete a region from the sweep line. This happens when the upper
* and lower chains of a region meet (at a vertex on the sweep line).
@@ -271,8 +271,8 @@ class Sweep {
* not do this before -- since the structure of the mesh is always
* changing, this face may not have even existed until now).
*/ {
- GLUhalfEdge e = reg.eUp;
- GLUface f = e.Lface;
+ final GLUhalfEdge e = reg.eUp;
+ final GLUface f = e.Lface;
f.inside = reg.inside;
f.anEdge = e; /* optimization for __gl_meshTessellateMonoRegion() */
@@ -280,8 +280,8 @@ class Sweep {
}
- static GLUhalfEdge FinishLeftRegions(GLUtessellatorImpl tess,
- ActiveRegion regFirst, ActiveRegion regLast)
+ static GLUhalfEdge FinishLeftRegions(final GLUtessellatorImpl tess,
+ final ActiveRegion regFirst, final ActiveRegion regLast)
/*
* We are given a vertex with one or more left-going edges. All affected
* edges should be in the edge dictionary. Starting at regFirst.eUp,
@@ -335,9 +335,9 @@ class Sweep {
}
- static void AddRightEdges(GLUtessellatorImpl tess, ActiveRegion regUp,
- GLUhalfEdge eFirst, GLUhalfEdge eLast, GLUhalfEdge eTopLeft,
- boolean cleanUp)
+ static void AddRightEdges(final GLUtessellatorImpl tess, final ActiveRegion regUp,
+ final GLUhalfEdge eFirst, final GLUhalfEdge eLast, GLUhalfEdge eTopLeft,
+ final boolean cleanUp)
/*
* Purpose: insert right-going edges into the edge dictionary, and update
* winding numbers and mesh connectivity appropriately. All right-going
@@ -406,16 +406,16 @@ class Sweep {
}
- static void CallCombine(GLUtessellatorImpl tess, GLUvertex isect,
- Object[] data, float[] weights, boolean needed) {
- double[] coords = new double[3];
+ static void CallCombine(final GLUtessellatorImpl tess, final GLUvertex isect,
+ final Object[] data, final float[] weights, final boolean needed) {
+ final double[] coords = new double[3];
/* Copy coord data in case the callback changes it. */
coords[0] = isect.coords[0];
coords[1] = isect.coords[1];
coords[2] = isect.coords[2];
- Object[] outData = new Object[1];
+ final Object[] outData = new Object[1];
tess.callCombineOrCombineData(coords, data, weights, outData);
isect.data = outData[0];
if (isect.data == null) {
@@ -432,14 +432,14 @@ class Sweep {
}
}
- static void SpliceMergeVertices(GLUtessellatorImpl tess, GLUhalfEdge e1,
- GLUhalfEdge e2)
+ static void SpliceMergeVertices(final GLUtessellatorImpl tess, final GLUhalfEdge e1,
+ final GLUhalfEdge e2)
/*
* Two vertices with idential coordinates are combined into one.
* e1.Org is kept, while e2.Org is discarded.
*/ {
- Object[] data = new Object[4];
- float[] weights = new float[]{0.5f, 0.5f, 0.0f, 0.0f};
+ final Object[] data = new Object[4];
+ final float[] weights = new float[]{0.5f, 0.5f, 0.0f, 0.0f};
data[0] = e1.Org.data;
data[1] = e2.Org.data;
@@ -447,8 +447,8 @@ class Sweep {
if (!Mesh.__gl_meshSplice(e1, e2)) throw new RuntimeException();
}
- static void VertexWeights(GLUvertex isect, GLUvertex org, GLUvertex dst,
- float[] weights)
+ static void VertexWeights(final GLUvertex isect, final GLUvertex org, final GLUvertex dst,
+ final float[] weights)
/*
* Find some weights which describe how the intersection vertex is
* a linear combination of "org" and "dest". Each of the two edges
@@ -456,8 +456,8 @@ class Sweep {
* splits the weight between its org and dst according to the
* relative distance to "isect".
*/ {
- double t1 = Geom.VertL1dist(org, isect);
- double t2 = Geom.VertL1dist(dst, isect);
+ final double t1 = Geom.VertL1dist(org, isect);
+ final double t2 = Geom.VertL1dist(dst, isect);
weights[0] = (float) (0.5 * t2 / (t1 + t2));
weights[1] = (float) (0.5 * t1 / (t1 + t2));
@@ -467,18 +467,18 @@ class Sweep {
}
- static void GetIntersectData(GLUtessellatorImpl tess, GLUvertex isect,
- GLUvertex orgUp, GLUvertex dstUp,
- GLUvertex orgLo, GLUvertex dstLo)
+ static void GetIntersectData(final GLUtessellatorImpl tess, final GLUvertex isect,
+ final GLUvertex orgUp, final GLUvertex dstUp,
+ final GLUvertex orgLo, final GLUvertex dstLo)
/*
* We've computed a new intersection point, now we need a "data" pointer
* from the user so that we can refer to this new vertex in the
* rendering callbacks.
*/ {
- Object[] data = new Object[4];
- float[] weights = new float[4];
- float[] weights1 = new float[2];
- float[] weights2 = new float[2];
+ final Object[] data = new Object[4];
+ final float[] weights = new float[4];
+ final float[] weights1 = new float[2];
+ final float[] weights2 = new float[2];
data[0] = orgUp.data;
data[1] = dstUp.data;
@@ -494,7 +494,7 @@ class Sweep {
CallCombine(tess, isect, data, weights, true);
}
- static boolean CheckForRightSplice(GLUtessellatorImpl tess, ActiveRegion regUp)
+ static boolean CheckForRightSplice(final GLUtessellatorImpl tess, final ActiveRegion regUp)
/*
* Check the upper and lower edge of "regUp", to make sure that the
* eUp.Org is above eLo, or eLo.Org is below eUp (depending on which
@@ -520,9 +520,9 @@ class Sweep {
* This is a guaranteed solution, no matter how degenerate things get.
* Basically this is a combinatorial solution to a numerical problem.
*/ {
- ActiveRegion regLo = RegionBelow(regUp);
- GLUhalfEdge eUp = regUp.eUp;
- GLUhalfEdge eLo = regLo.eUp;
+ final ActiveRegion regLo = RegionBelow(regUp);
+ final GLUhalfEdge eUp = regUp.eUp;
+ final GLUhalfEdge eLo = regLo.eUp;
if (Geom.VertLeq(eUp.Org, eLo.Org)) {
if (Geom.EdgeSign(eLo.Sym.Org, eUp.Org, eLo.Org) > 0) return false;
@@ -550,7 +550,7 @@ class Sweep {
return true;
}
- static boolean CheckForLeftSplice(GLUtessellatorImpl tess, ActiveRegion regUp)
+ static boolean CheckForLeftSplice(final GLUtessellatorImpl tess, final ActiveRegion regUp)
/*
* Check the upper and lower edge of "regUp", to make sure that the
* eUp.Sym.Org is above eLo, or eLo.Sym.Org is below eUp (depending on which
@@ -569,9 +569,9 @@ class Sweep {
* We fix the problem by just splicing the offending vertex into the
* other edge.
*/ {
- ActiveRegion regLo = RegionBelow(regUp);
- GLUhalfEdge eUp = regUp.eUp;
- GLUhalfEdge eLo = regLo.eUp;
+ final ActiveRegion regLo = RegionBelow(regUp);
+ final GLUhalfEdge eUp = regUp.eUp;
+ final GLUhalfEdge eLo = regLo.eUp;
GLUhalfEdge e;
assert (!Geom.VertEq(eUp.Sym.Org, eLo.Sym.Org));
@@ -599,7 +599,7 @@ class Sweep {
}
- static boolean CheckForIntersect(GLUtessellatorImpl tess, ActiveRegion regUp)
+ static boolean CheckForIntersect(final GLUtessellatorImpl tess, ActiveRegion regUp)
/*
* Check the upper and lower edges of the given region to see if
* they intersect. If so, create the intersection and add it
@@ -612,12 +612,12 @@ class Sweep {
ActiveRegion regLo = RegionBelow(regUp);
GLUhalfEdge eUp = regUp.eUp;
GLUhalfEdge eLo = regLo.eUp;
- GLUvertex orgUp = eUp.Org;
- GLUvertex orgLo = eLo.Org;
- GLUvertex dstUp = eUp.Sym.Org;
- GLUvertex dstLo = eLo.Sym.Org;
+ final GLUvertex orgUp = eUp.Org;
+ final GLUvertex orgLo = eLo.Org;
+ final GLUvertex dstUp = eUp.Sym.Org;
+ final GLUvertex dstLo = eLo.Sym.Org;
double tMinUp, tMaxLo;
- GLUvertex isect = new GLUvertex();
+ final GLUvertex isect = new GLUvertex();
GLUvertex orgMin;
GLUhalfEdge e;
@@ -752,7 +752,7 @@ class Sweep {
return false;
}
- static void WalkDirtyRegions(GLUtessellatorImpl tess, ActiveRegion regUp)
+ static void WalkDirtyRegions(final GLUtessellatorImpl tess, ActiveRegion regUp)
/*
* When the upper or lower edge of any region changes, the region is
* marked "dirty". This routine walks through all the dirty regions
@@ -837,7 +837,7 @@ class Sweep {
}
- static void ConnectRightVertex(GLUtessellatorImpl tess, ActiveRegion regUp,
+ static void ConnectRightVertex(final GLUtessellatorImpl tess, ActiveRegion regUp,
GLUhalfEdge eBottomLeft)
/*
* Purpose: connect a "right" vertex vEvent (one where all edges go left)
@@ -872,9 +872,9 @@ class Sweep {
*/ {
GLUhalfEdge eNew;
GLUhalfEdge eTopLeft = eBottomLeft.Onext;
- ActiveRegion regLo = RegionBelow(regUp);
- GLUhalfEdge eUp = regUp.eUp;
- GLUhalfEdge eLo = regLo.eUp;
+ final ActiveRegion regLo = RegionBelow(regUp);
+ final GLUhalfEdge eUp = regUp.eUp;
+ final GLUhalfEdge eLo = regLo.eUp;
boolean degenerate = false;
if (eUp.Sym.Org != eLo.Sym.Org) {
@@ -930,8 +930,8 @@ class Sweep {
*/
private static final boolean TOLERANCE_NONZERO = false;
- static void ConnectLeftDegenerate(GLUtessellatorImpl tess,
- ActiveRegion regUp, GLUvertex vEvent)
+ static void ConnectLeftDegenerate(final GLUtessellatorImpl tess,
+ ActiveRegion regUp, final GLUvertex vEvent)
/*
* The event vertex lies exacty on an already-processed edge or vertex.
* Adding the new vertex involves splicing it into the already-processed
@@ -989,7 +989,7 @@ class Sweep {
}
- static void ConnectLeftVertex(GLUtessellatorImpl tess, GLUvertex vEvent)
+ static void ConnectLeftVertex(final GLUtessellatorImpl tess, final GLUvertex vEvent)
/*
* Purpose: connect a "left" vertex (one where both edges go right)
* to the processed portion of the mesh. Let R be the active region
@@ -1007,7 +1007,7 @@ class Sweep {
*/ {
ActiveRegion regUp, regLo, reg;
GLUhalfEdge eUp, eLo, eNew;
- ActiveRegion tmp = new ActiveRegion();
+ final ActiveRegion tmp = new ActiveRegion();
/* assert ( vEvent.anEdge.Onext.Onext == vEvent.anEdge ); */
@@ -1035,7 +1035,7 @@ class Sweep {
eNew = Mesh.__gl_meshConnect(vEvent.anEdge.Sym, eUp.Lnext);
if (eNew == null) throw new RuntimeException();
} else {
- GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(eLo.Sym.Onext.Sym, vEvent.anEdge);
+ final GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(eLo.Sym.Onext.Sym, vEvent.anEdge);
if (tempHalfEdge == null) throw new RuntimeException();
eNew = tempHalfEdge.Sym;
@@ -1055,7 +1055,7 @@ class Sweep {
}
- static void SweepEvent(GLUtessellatorImpl tess, GLUvertex vEvent)
+ static void SweepEvent(final GLUtessellatorImpl tess, final GLUvertex vEvent)
/*
* Does everything necessary when the sweep line crosses a vertex.
* Updates the mesh and the edge dictionary.
@@ -1114,13 +1114,13 @@ class Sweep {
*/
private static final double SENTINEL_COORD = (4.0 * GLU.GLU_TESS_MAX_COORD);
- static void AddSentinel(GLUtessellatorImpl tess, double t)
+ static void AddSentinel(final GLUtessellatorImpl tess, final double t)
/*
* We add two sentinel edges above and below all other edges,
* to avoid special cases at the top and bottom.
*/ {
GLUhalfEdge e;
- ActiveRegion reg = new ActiveRegion();
+ final ActiveRegion reg = new ActiveRegion();
if (reg == null) throw new RuntimeException();
e = Mesh.__gl_meshMakeEdge(tess.mesh);
@@ -1151,7 +1151,7 @@ class Sweep {
/* __gl_dictListNewDict */
tess.dict = Dict.dictNewDict(tess, new Dict.DictLeq() {
@Override
- public boolean leq(Object frame, Object key1, Object key2) {
+ public boolean leq(final Object frame, final Object key1, final Object key2) {
return EdgeLeq(tess, (ActiveRegion) key1, (ActiveRegion) key2);
}
});
@@ -1162,7 +1162,7 @@ class Sweep {
}
- static void DoneEdgeDict(GLUtessellatorImpl tess) {
+ static void DoneEdgeDict(final GLUtessellatorImpl tess) {
ActiveRegion reg;
int fixedEdges = 0;
@@ -1185,12 +1185,12 @@ class Sweep {
}
- static void RemoveDegenerateEdges(GLUtessellatorImpl tess)
+ static void RemoveDegenerateEdges(final GLUtessellatorImpl tess)
/*
* Remove zero-length edges, and contours with fewer than 3 vertices.
*/ {
GLUhalfEdge e, eNext, eLnext;
- GLUhalfEdge eHead = tess.mesh.eHead;
+ final GLUhalfEdge eHead = tess.mesh.eHead;
/*LINTED*/
for (e = eHead.next; e != eHead; e = eNext) {
@@ -1222,7 +1222,7 @@ class Sweep {
}
}
- static boolean InitPriorityQ(GLUtessellatorImpl tess)
+ static boolean InitPriorityQ(final GLUtessellatorImpl tess)
/*
* Insert all vertices into the priority queue which determines the
* order in which vertices cross the sweep line.
@@ -1233,7 +1233,7 @@ class Sweep {
/* __gl_pqSortNewPriorityQ */
pq = tess.pq = PriorityQ.pqNewPriorityQ(new PriorityQ.Leq() {
@Override
- public boolean leq(Object key1, Object key2) {
+ public boolean leq(final Object key1, final Object key2) {
return Geom.VertLeq(((GLUvertex) key1), (GLUvertex) key2);
}
});
@@ -1254,12 +1254,12 @@ class Sweep {
}
- static void DonePriorityQ(GLUtessellatorImpl tess) {
+ static void DonePriorityQ(final GLUtessellatorImpl tess) {
tess.pq.pqDeletePriorityQ(); /* __gl_pqSortDeletePriorityQ */
}
- static boolean RemoveDegenerateFaces(GLUmesh mesh)
+ static boolean RemoveDegenerateFaces(final GLUmesh mesh)
/*
* Delete any degenerate faces with only two edges. WalkDirtyRegions()
* will catch almost all of these, but it won't catch degenerate faces
@@ -1292,7 +1292,7 @@ class Sweep {
return true;
}
- public static boolean __gl_computeInterior(GLUtessellatorImpl tess)
+ public static boolean __gl_computeInterior(final GLUtessellatorImpl tess)
/*
* __gl_computeInterior( tess ) computes the planar arrangement specified
* by the given contours, and further subdivides this arrangement
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/TessMono.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/TessMono.java
index 5db543c80..63994ba82 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/TessMono.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/TessMono.java
@@ -80,7 +80,7 @@ class TessMono {
* to the fan is a simple orientation test. By making the fan as large
* as possible, we restore the invariant (check it yourself).
*/
- static boolean __gl_meshTessellateMonoRegion(GLUface face, boolean avoidDegenerateTris) {
+ static boolean __gl_meshTessellateMonoRegion(final GLUface face, final boolean avoidDegenerateTris) {
GLUhalfEdge up, lo;
/* All edges are oriented CCW around the boundary of the region.
@@ -135,7 +135,7 @@ class TessMono {
*/
while (lo.Lnext != up && (Geom.EdgeGoesLeft(lo.Lnext)
|| Geom.EdgeSign(lo.Org, lo.Sym.Org, lo.Lnext.Sym.Org) <= 0)) {
- GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(lo.Lnext, lo);
+ final GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(lo.Lnext, lo);
mustConnect = false;
if (tempHalfEdge == null) return false;
lo = tempHalfEdge.Sym;
@@ -145,7 +145,7 @@ class TessMono {
/* lo.Org is on the left. We can make CCW triangles from up.Sym.Org. */
while (lo.Lnext != up && (Geom.EdgeGoesRight(up.Onext.Sym)
|| Geom.EdgeSign(up.Sym.Org, up.Org, up.Onext.Sym.Org) >= 0)) {
- GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(up, up.Onext.Sym);
+ final GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(up, up.Onext.Sym);
mustConnect = false;
if (tempHalfEdge == null) return false;
up = tempHalfEdge.Sym;
@@ -159,7 +159,7 @@ class TessMono {
*/
assert (lo.Lnext != up);
while (lo.Lnext.Lnext != up) {
- GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(lo.Lnext, lo);
+ final GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(lo.Lnext, lo);
if (tempHalfEdge == null) return false;
lo = tempHalfEdge.Sym;
}
@@ -172,7 +172,7 @@ class TessMono {
* the mesh which is marked "inside" the polygon. Each such region
* must be monotone.
*/
- public static boolean __gl_meshTessellateInterior(GLUmesh mesh, boolean avoidDegenerateTris) {
+ public static boolean __gl_meshTessellateInterior(final GLUmesh mesh, final boolean avoidDegenerateTris) {
GLUface f, next;
/*LINTED*/
@@ -193,7 +193,7 @@ class TessMono {
* on NULL faces are not allowed, the main purpose is to clean up the
* mesh so that exterior loops are not represented in the data structure.
*/
- public static void __gl_meshDiscardExterior(GLUmesh mesh) {
+ public static void __gl_meshDiscardExterior(final GLUmesh mesh) {
GLUface f, next;
/*LINTED*/
@@ -216,7 +216,7 @@ class TessMono {
* If keepOnlyBoundary is TRUE, it also deletes all edges which do not
* separate an interior region from an exterior one.
*/
- public static boolean __gl_meshSetWindingNumber(GLUmesh mesh, int value, boolean keepOnlyBoundary) {
+ public static boolean __gl_meshSetWindingNumber(final GLUmesh mesh, final int value, final boolean keepOnlyBoundary) {
GLUhalfEdge e, eNext;
for (e = mesh.eHead.next; e != mesh.eHead; e = eNext) {