aboutsummaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2007-10-09 07:38:10 +0000
committerKenneth Russel <[email protected]>2007-10-09 07:38:10 +0000
commitc92573e5f90bfefdfa6697a3f628a263c2f211f9 (patch)
tree53258db2dae2d3a54f9c2f30cd1a55fe163ba958 /make
parentf7b664564d2dcdf674660b5d1fc38c7f2ac25b76 (diff)
Integration of Tomas Hrasky's port of basic GLU NURBS functionality
from C++ to Java, plus example applications, done as part of his Bachelor of Science degree at the University of Hradec Králové, Faculty of Informatics and Management. Current state of code is documented in src/classes/com/sun/opengl/impl/nurbs/README.txt. Example applications require Java 1.5 and are not currently built by default. Specify -Djogl.nurbs=1 during jogl-demos build with a 1.5 javac on the PATH to build them. Dependent jars are copied to build output directory. Deleted old partially-complete GLU NURBS port. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@1389 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'make')
-rw-r--r--make/build.xml3
-rw-r--r--make/glu-CustomJavaCode.java143
-rw-r--r--make/glu-common.cfg6
3 files changed, 149 insertions, 3 deletions
diff --git a/make/build.xml b/make/build.xml
index 18e280ab6..5e8e3085d 100644
--- a/make/build.xml
+++ b/make/build.xml
@@ -701,7 +701,8 @@
<target name="java.compile.secondpass" depends="java.generate.composable.pipeline">
<!-- Perform the second pass Java compile; everything. -->
<javac destdir="${classes}"
- excludes="${java.excludes.platform},com/sun/opengl/impl/nurbs/**" source="${jogl.sourcelevel}"
+ excludes="${java.excludes.platform}"
+ source="${jogl.sourcelevel}"
classpath="${gluegen-rt.jar}"
fork="yes"
memoryMaximumSize="128m"
diff --git a/make/glu-CustomJavaCode.java b/make/glu-CustomJavaCode.java
index 17e1169c1..fcf01871f 100644
--- a/make/glu-CustomJavaCode.java
+++ b/make/glu-CustomJavaCode.java
@@ -1430,6 +1430,149 @@ public int gluScaleImage(int format, int wIn, int hIn, int typeIn, java.nio.Buff
}
//----------------------------------------------------------------------
+// NURBS functionality
+//
+
+/**
+ * Sets a property on a NURBS object. (NOTE: this function is not currently implemented.)
+ *
+ * @param r
+ * GLUnurbs object holding NURBS to which a property should be
+ * set
+ * @param property
+ * property id
+ * @param value
+ * property value
+ */
+public void gluNurbsProperty(GLUnurbs r, int property, float value) {
+ // TODO glunurbsproperty
+ float nurbsValue;
+ switch (property) {
+ default:
+ // System.out.println("TODO gluwnurbs.glunurbsproperty");
+ break;
+ }
+}
+
+/**
+ * Creates a new GLUnurbs object.
+ *
+ * @return GLUnurbs object
+ */
+public GLUnurbs gluNewNurbsRenderer() {
+ // DONE
+ return new GLUnurbsImpl();
+}
+
+/**
+ * Begins a curve definition.
+ *
+ * @param r
+ * GLUnurbs object to specify curve to
+ */
+public void gluBeginCurve(GLUnurbs r) {
+ // DONE
+ ((GLUnurbsImpl) r).bgncurve();
+}
+
+/**
+ * Begins a surface definition.
+ *
+ * @param r
+ * GLUnurbs object to specify surface to
+ */
+public void gluBeginSurface(GLUnurbs r) {
+ // DONE
+ ((GLUnurbsImpl) r).bgnsurface();
+}
+
+/**
+ * Ends a surface.
+ *
+ * @param r
+ * GLUnurbs object holding surface
+ */
+public void gluEndSurface(GLUnurbs r) {
+ // DONE
+ ((GLUnurbsImpl) r).endsurface();
+}
+
+/**
+ * Makes a NURBS surface.
+ *
+ * @param r
+ * GLUnurbs object holding the surface
+ * @param sknot_count
+ * number of knots in s direction
+ * @param sknot
+ * knots in s direction
+ * @param tknot_count
+ * number of knots in t direction
+ * @param tknot
+ * knots in t direction
+ * @param s_stride
+ * number of control points coordinates in s direction
+ * @param t_stride
+ * number of control points coordinates in t direction
+ * @param ctlarray
+ * control points
+ * @param sorder
+ * order of surface in s direction
+ * @param torder
+ * order of surface in t direction
+ * @param type
+ * surface type
+ */
+public void gluNurbsSurface(GLUnurbs r, int sknot_count, float[] sknot,
+ int tknot_count, float[] tknot, int s_stride, int t_stride,
+ float[] ctlarray, int sorder, int torder, int type) {
+ // DONE
+ ((GLUnurbsImpl) r).nurbssurface(sknot_count, sknot, tknot_count, tknot, s_stride,
+ t_stride, ctlarray, sorder, torder, type);
+}
+
+/**
+ * Make a NURBS curve.
+ *
+ * @param r
+ * GLUnurbs object holding the curve
+ * @param nknots
+ * number of knots
+ * @param knot
+ * knot vector
+ * @param stride
+ * number of control point coordinates
+ * @param ctlarray
+ * control points
+ * @param order
+ * order of the curve
+ * @param type
+ * curve type
+ */
+public void gluNurbsCurve(GLUnurbs r, int nknots, float[] knot, int stride,
+ float[] ctlarray, int order, int type) {
+ int realType;
+ switch (type) {
+ // TODO GLU_MAP1_TRIM_2 etc.
+ default:
+ realType = type;
+ break;
+ }
+ ((GLUnurbsImpl) r).nurbscurve(nknots, knot, stride, ctlarray, order, realType);
+}
+
+/**
+ * Ends a curve definition.
+ *
+ * @param r
+ * GLUnurbs object holding the curve
+ */
+public void gluEndCurve(GLUnurbs r) {
+ //DONE
+ ((GLUnurbsImpl) r).endcurve();
+}
+
+//----------------------------------------------------------------------
// GLUProcAddressTable handling
//
diff --git a/make/glu-common.cfg b/make/glu-common.cfg
index 3c41dbfdf..679e4aef4 100644
--- a/make/glu-common.cfg
+++ b/make/glu-common.cfg
@@ -23,12 +23,14 @@ Import javax.media.opengl.*
Import javax.media.opengl.glu.*
Import com.sun.opengl.impl.*
-# GLU needs access to the GLUtesselatorImpl class for GLUtesselator
-# and to the Mipmap class for scaling and mipmap generation
+# GLU needs access to the GLUtesselatorImpl class for GLUtesselator,
+# to the Mipmap class for scaling and mipmap generation,
+# and to the nurbs.* package for the NURBS functionality
Import com.sun.opengl.impl.tessellator.GLUtessellatorImpl
Import com.sun.opengl.impl.error.Error
Import com.sun.opengl.impl.mipmap.Mipmap
Import com.sun.opengl.impl.registry.Registry
+Import com.sun.opengl.impl.nurbs.*
Import com.sun.opengl.util.*
Import java.security.*