Top Description Fields Constructors Methods
jogamp.opengl.glu.gl2.nurbs

public Class GLUgl2nurbsImpl

extends Object
implements GLUnurbs
Class Inheritance
All Implemented Interfaces
com.jogamp.opengl.glu.GLUnurbs
Imports
jogamp.opengl.glu.nurbs.*, java.lang.reflect.Method, com.jogamp.opengl.GL2, com.jogamp.opengl.glu.GLUnurbs

Base object for working with NURBS curves and surfaces
Author
Tomas Hrasky

Field Summary

Modifier and TypeField and Description
private final boolean
autoloadmode

Matrixes autoloading

public static final int
CT_NONE

Curve type - no type

public static final int
CT_NPWLCURVE

Curve type - picewise linear curve

public static final int
CT_NURBSCURVE

Curve type - NURBS curve

private O_curve
currentCurve

Current curve

private O_surface
currentSurface

Current processed surface

private int
inCurve

Are we in the middle of curve processing

private int
inSurface

Are we in the middle of surface processing

private boolean
inTrim

Are we in trim

private int
isDataValid

Indicates validity of data

pack-priv Maplist
maplist

List of map definitions

private O_curve
nextCurve

Next curve in linked list

private O_nurbscurve
nextNurbscurve

Next trimming NURBS curve in linked list

private O_trim
nextTrim

Next trimming curve

private int
numTrims

Nurber of trmims of processed surface

private boolean
playBack

Are we playbacking curve/surface rendering

private final Renderhints
renderhints

Object holding rendering settings

private final Subdivider
subdivider

Object for subdividing curves and surfaces

Constructor Summary

AccessConstructor and Description
public
GLUgl2nurbsImpl()

Initializes default GLUgl2nurbs object

Method Summary

Modifier and TypeMethod and Description
public void
bgncurve()

Begins new NURBS curve

private void
bgnrender()

Begin rendering

public void
bgnsurface()

Begin new surface

public void
defineMap(final int
map type
type
,
final int
is rational
rational
,
final int
number of control point coordinates
ncoords
)

Define a map of given properties

public void
do_bgncurve(final O_curve
curve object
o_curve
)

Begins a NURBS curve

public void
do_bgnsurface(final O_surface
surface object
o_surface
)

Begins new surface

public boolean

Returns:

knot vector is / is not valid
do_check_knots
(final Knotvector
knot vector
knots
,
final String
error message
msg
)

Check knot vector specification

public void
do_endcurve()

Ends a curve

public void
do_endsurface()

Ends surface

public void
do_nurbscurve(final O_nurbscurve
NURBS curve object
o_nurbscurve
)

Draw a curve

private void
do_nurbserror(final int
error code
i
)

Method for handling error codes

public void
do_nurbssurface(final O_nurbssurface
NURBS surface object
o_nurbssurface
)

Draw NURBS surface

public void
do_setnurbsproperty(final Property
property to be set
prop
)

Set given property to rendering hints

public void
do_setnurbsproperty2(final Property
property
prop
)

Set parameters of existing property

public void
endcurve()

End a curve

private void
endrender()

End rendering

public void
endsurface()

End current surface

private void
endtrim()

End surface trimming

private void
loadGLMatrices()

Load matrices from OpenGL state machine

public void
nurbscurve(final int
number of knots in knot vector
nknots
,
final float[]
knot vector
knot
,
final int
number of control points coordinates
stride
,
final float[]
control points
ctlarray
,
final int
order of the curve
order
,
final int
type of the curve
realType
)

Make a NURBS curve

public void
nurbssurface(final int
number of knots in s direction
sknot_count
,
final float[]
knot vector in s direction
sknot
,
final int
number of knots in t direction
tknot_count
,
final float[]
knot vector in t direction
tknot
,
final int
number of coords of control points in s direction
s_stride
,
final int
number of coords of control points in t direction
t_stride
,
final float[]
control points
ctlarray
,
final int
order of curve in s direction
sorder
,
final int
order of curve in t direction
torder
,
final int
NURBS surface type (rational,...)
type
)

Make NURBS surface

public void
redefineMaps()

(Re)Inicialize maps

private void
set_domain_distance_u_rate(final double
distance
d
)

Sets domain distance for dom.dist.

private void
set_domain_distance_v_rate(final double
distance
d
)

Sets domain distance for dom.dist.

public void
set_is_domain_distance_sampling(final int
domain distance sampling flag
i
)

Sets wheteher we use domain distance sampling

public void
setnurbsproperty(final int
property type
type
,
final int
property tag
tag
,
final float
property value
value
)

Set NURBS property

private void
thread(final String
name of a method to be called
name
,
final Object
parameter to be passed to called method
arg
)

Calls a method with given name and passes argumet

private void
thread2(final String
name of a method to be called
name
)

Calls a method with given name

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

autoloadmodeback to summary
private final boolean autoloadmode

Matrixes autoloading

CT_NONEback to summary
public static final int CT_NONE

Curve type - no type

CT_NPWLCURVEback to summary
public static final int CT_NPWLCURVE

Curve type - picewise linear curve

CT_NURBSCURVEback to summary
public static final int CT_NURBSCURVE

Curve type - NURBS curve

currentCurveback to summary
private O_curve currentCurve

Current curve

currentSurfaceback to summary
private O_surface currentSurface

Current processed surface

inCurveback to summary
private int inCurve

Are we in the middle of curve processing

inSurfaceback to summary
private int inSurface

Are we in the middle of surface processing

inTrimback to summary
private boolean inTrim

Are we in trim

isDataValidback to summary
private int isDataValid

Indicates validity of data

maplistback to summary
pack-priv Maplist maplist

List of map definitions

nextCurveback to summary
private O_curve nextCurve

Next curve in linked list

nextNurbscurveback to summary
private O_nurbscurve nextNurbscurve

Next trimming NURBS curve in linked list

nextTrimback to summary
private O_trim nextTrim

Next trimming curve

numTrimsback to summary
private int numTrims

Nurber of trmims of processed surface

playBackback to summary
private boolean playBack

Are we playbacking curve/surface rendering

renderhintsback to summary
private final Renderhints renderhints

Object holding rendering settings

subdividerback to summary
private final Subdivider subdivider

Object for subdividing curves and surfaces

Constructor Detail

GLUgl2nurbsImplback to summary
public GLUgl2nurbsImpl()

Initializes default GLUgl2nurbs object

Method Detail

bgncurveback to summary
public void bgncurve()

Begins new NURBS curve

bgnrenderback to summary
private void bgnrender()

Begin rendering

bgnsurfaceback to summary
public void bgnsurface()

Begin new surface

defineMapback to summary
public void defineMap(final int type, final int rational, final int ncoords)

Define a map of given properties

Parameters
type:int

map type

rational:int

is rational

ncoords:int

number of control point coordinates

do_bgncurveback to summary
public void do_bgncurve(final O_curve o_curve)

Begins a NURBS curve

Parameters
o_curve:O_curve

curve object

do_bgnsurfaceback to summary
public void do_bgnsurface(final O_surface o_surface)

Begins new surface

Parameters
o_surface:O_surface

surface object

do_check_knotsback to summary
public boolean do_check_knots(final Knotvector knots, final String msg)

Check knot vector specification

Parameters
knots:Knotvector

knot vector

msg:String

error message

Returns:boolean

knot vector is / is not valid

do_endcurveback to summary
public void do_endcurve()

Ends a curve

do_endsurfaceback to summary
public void do_endsurface()

Ends surface

do_nurbscurveback to summary
public void do_nurbscurve(final O_nurbscurve o_nurbscurve)

Draw a curve

Parameters
o_nurbscurve:O_nurbscurve

NURBS curve object

do_nurbserrorback to summary
private void do_nurbserror(final int i)

Method for handling error codes

Parameters
i:int

error code

do_nurbssurfaceback to summary
public void do_nurbssurface(final O_nurbssurface o_nurbssurface)

Draw NURBS surface

Parameters
o_nurbssurface:O_nurbssurface

NURBS surface object

do_setnurbspropertyback to summary
public void do_setnurbsproperty(final Property prop)

Set given property to rendering hints

Parameters
prop:Property

property to be set

do_setnurbsproperty2back to summary
public void do_setnurbsproperty2(final Property prop)

Set parameters of existing property

Parameters
prop:Property

property

endcurveback to summary
public void endcurve()

End a curve

endrenderback to summary
private void endrender()

End rendering

endsurfaceback to summary
public void endsurface()

End current surface

endtrimback to summary
private void endtrim()

End surface trimming

loadGLMatricesback to summary
private void loadGLMatrices()

Load matrices from OpenGL state machine

nurbscurveback to summary
public void nurbscurve(final int nknots, final float[] knot, final int stride, final float[] ctlarray, final int order, final int realType)

Make a NURBS curve

Parameters
nknots:int

number of knots in knot vector

knot:float[]

knot vector

stride:int

number of control points coordinates

ctlarray:float[]

control points

order:int

order of the curve

realType:int

type of the curve

nurbssurfaceback to summary
public void nurbssurface(final int sknot_count, final float[] sknot, final int tknot_count, final float[] tknot, final int s_stride, final int t_stride, final float[] ctlarray, final int sorder, final int torder, final int type)

Make NURBS surface

Parameters
sknot_count:int

number of knots in s direction

sknot:float[]

knot vector in s direction

tknot_count:int

number of knots in t direction

tknot:float[]

knot vector in t direction

s_stride:int

number of coords of control points in s direction

t_stride:int

number of coords of control points in t direction

ctlarray:float[]

control points

sorder:int

order of curve in s direction

torder:int

order of curve in t direction

type:int

NURBS surface type (rational,...)

redefineMapsback to summary
public void redefineMaps()

(Re)Inicialize maps

set_domain_distance_u_rateback to summary
private void set_domain_distance_u_rate(final double d)

Sets domain distance for dom.dist. sampling in u direction

Parameters
d:double

distance

set_domain_distance_v_rateback to summary
private void set_domain_distance_v_rate(final double d)

Sets domain distance for dom.dist. sampling in v direction

Parameters
d:double

distance

set_is_domain_distance_samplingback to summary
public void set_is_domain_distance_sampling(final int i)

Sets wheteher we use domain distance sampling

Parameters
i:int

domain distance sampling flag

setnurbspropertyback to summary
public void setnurbsproperty(final int type, final int tag, final float value)

Set NURBS property

Parameters
type:int

property type

tag:int

property tag

value:float

property value

threadback to summary
private void thread(final String name, final Object arg)

Calls a method with given name and passes argumet

Parameters
name:String

name of a method to be called

arg:Object

parameter to be passed to called method

thread2back to summary
private void thread2(final String name)

Calls a method with given name

Parameters
name:String

name of a method to be called