com.hermetica.magician
Class GLUNurbs

java.lang.Object
  |
  +--com.hermetica.magician.GLUNurbs

public class GLUNurbs
extends java.lang.Object

This class defines the API of a GLU NURBS object. This allows developers access to a fairly powerful high-level API for creating an manipulating NURBS objects such as surfaces and curves.

Version:
$Id: GLUNurbs.java,v 1.2 1999/06/03 23:11:48 descarte Exp $
Author:
Alligator Descartes <descarte@arcana.co.uk>
See Also:
GLU

Field Summary
static java.lang.String VERSION
          Version information
 
Constructor Summary
GLUNurbs()
          Constructs a new NURBS generator
 
Method Summary
 void beginCurve()
          Signifies the beginning of a NURBS curve
 void beginSurface()
          Signifies the beginning of a NURBS surface definition
 void beginTrim()
          Signifies the beginning of a trim curve
 void destroy()
          Destroys a NURBS object
 void endCurve()
          Signifies the end of a NURBS curve definition
 void endSurface()
          Signifies the end of a NURBS surface definition
 void endTrim()
          Signifies the end of a trim curve definition
 float getNurbsProperty(int property)
          Queries a NURBS object for the given property value
 void loadSamplingMatrices(float[] modelMatrix, float[] projMatrix, int[] viewport)
          Loads sampling matrices for NURBS manipulation
 void nurbsCurve(int uknot_count, float[] uknot, int ustride, float[][] ctlarray, int uorder, int type)
          Definition of a NURBS curve
 void nurbsProperty(int property, float value)
          Sets a NURBS property
 void nurbsSurface(int uknot_count, float[] uknot, int vknot_count, float[] vknot, int u_stride, int v_stride, float[][][] ctlarray, int uorder, int vorder, int type)
          Definition of a NURBS surface
 void pwlCurve(int count, float[][] array, int stride, int type)
          Definition of a piecewise linear curve
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
Version information
Constructor Detail

GLUNurbs

public GLUNurbs()
Constructs a new NURBS generator
Method Detail

nurbsProperty

public void nurbsProperty(int property,
                          float value)
Sets a NURBS property

Parameters:
property - The NURBS property to set
value - The value to set the property to
Throws:
OpenGLException - General OpenGL error

loadSamplingMatrices

public void loadSamplingMatrices(float[] modelMatrix,
                                 float[] projMatrix,
                                 int[] viewport)
Loads sampling matrices for NURBS manipulation

Parameters:
modelMatrix - A modelview matrix
projMatrix - A projection matrix
viewport - A viewport
Throws:
OpenGLException - General OpenGL error

getNurbsProperty

public float getNurbsProperty(int property)
Queries a NURBS object for the given property value

Parameters:
nurb - A GLUNurbs object
property - The property to query the value of
Throws:
OpenGLException - General OpenGL error

beginSurface

public void beginSurface()
Signifies the beginning of a NURBS surface definition

Throws:
OpenGLException - General OpenGL error

endSurface

public void endSurface()
Signifies the end of a NURBS surface definition

Throws:
OpenGLException - General OpenGL error

nurbsSurface

public void nurbsSurface(int uknot_count,
                         float[] uknot,
                         int vknot_count,
                         float[] vknot,
                         int u_stride,
                         int v_stride,
                         float[][][] ctlarray,
                         int uorder,
                         int vorder,
                         int type)
Definition of a NURBS surface

Parameters:
nurb - A GLUNurbs object
uknot_count - Specifies the number of knots in the parametric u direction
uknot - The knot data
vknot_count - Specifies the number of knots in the parametric v direction
vknot - The knot data
u_stride - Specifies the offset between successive control points in the parametric u direction
v_stride - Specifies the offset between successive control points in the parametric v direction
ctlarray - An array of control points
uorder - Specifies the order of the NURBS surface in the parametric u direction
vorder - Specifies the order of the NURBS surface in the parametric v direction
type - Specifies the type of the surface
Throws:
OpenGLException - General OpenGL error

beginCurve

public void beginCurve()
Signifies the beginning of a NURBS curve

Throws:
OpenGLException - General OpenGL error

endCurve

public void endCurve()
Signifies the end of a NURBS curve definition

Throws:
OpenGLException - General OpenGL error

nurbsCurve

public void nurbsCurve(int uknot_count,
                       float[] uknot,
                       int ustride,
                       float[][] ctlarray,
                       int uorder,
                       int type)
Definition of a NURBS curve

Parameters:
uknot_count - The number of knots in the curve
uknot - The knot data
ustride - Offset between successive control points
ctlarray - The control points for the curve
uorder - The order of the NURBS curve
type - Specifies the type of the curve
Throws:
OpenGLException - General OpenGL error

beginTrim

public void beginTrim()
Signifies the beginning of a trim curve

Throws:
OpenGLException - General OpenGL error

endTrim

public void endTrim()
Signifies the end of a trim curve definition

Throws:
OpenGLException - General OpenGL error

pwlCurve

public void pwlCurve(int count,
                     float[][] array,
                     int stride,
                     int type)
Definition of a piecewise linear curve

Parameters:
count - The number of points on the curve
array - Specifies an array containing the curve point
stride - Offset between each control point
type - Specifies the type of curve
Throws:
OpenGLException - General OpenGL error

destroy

public void destroy()
Destroys a NURBS object

Throws:
OpenGLException - General OpenGL error