|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.aviatrix3d.SceneGraphObject org.j3d.aviatrix3d.BufferState org.j3d.aviatrix3d.StencilBufferState
public class StencilBufferState
Describes attributes used when interacting with the stencil buffer.
Including this state class in the global setup automatically enables stencil testing and the stencil buffer.
The default setup for this class is:
Internationalisation Resource Names
Field Summary | |
---|---|
static int |
FUNCTION_ALWAYS
Comparison function that always passes. |
static int |
FUNCTION_EQUAL
Comparison function that passes if (ref & mask) == (stencil & mask). |
static int |
FUNCTION_GREATER
Comparison function that passes if (ref & mask) > (stencil & mask). |
static int |
FUNCTION_GREATER_OR_EQUAL
Comparison function that passes if (ref & mask) >= (stencil & mask). |
static int |
FUNCTION_LESS
Comparison function that passes if (ref & mask) < (stencil & mask). |
static int |
FUNCTION_LESS_OR_EQUAL
Comparison function that passes if (ref & mask) <= (stencil & mask). |
static int |
FUNCTION_NEVER
Comparison function that always fails. |
static int |
FUNCTION_NOTEQUAL
Comparison function that passes if (ref & mask) not equal to (stencil & mask). |
static short |
STENCIL_DECREMENT
When the stencil function matches, decrement the stencil value. |
static short |
STENCIL_INCREMENT
When the stencil function matches, increment the stencil value. |
static short |
STENCIL_INVERT
When the stencil function matches, bitwise invert the stencil value. |
static short |
STENCIL_KEEP
When the stencil function matches, keep the current stencil value. |
static short |
STENCIL_REPLACE
When the stencil function matches, set the stencil value to the reference value. |
static short |
STENCIL_ZERO
When the stencil function matches, set the stencil value to zero. |
Fields inherited from class org.j3d.aviatrix3d.BufferState |
---|
lastParent, liveCount, parentList |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler |
Fields inherited from interface org.j3d.aviatrix3d.rendering.BufferStateRenderable |
---|
ACCUMULATION_BUFFER, COLOR_BUFFER, DEPTH_BUFFER, GENERAL_BUFFER, STENCIL_BUFFER |
Constructor Summary | |
---|---|
StencilBufferState()
Constructs a state set with default values. |
Method Summary | |
---|---|
boolean |
checkClearBufferState()
Check to see if this buffer should be cleared at the start of this run. |
void |
clearBufferState(javax.media.opengl.GL gl)
Restore all state to the default values. |
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order. |
int |
compareTo(StencilBufferState sbs)
Compares this object with the specified object for order. |
boolean |
equals(java.lang.Object o)
Compare this object for equality to the given object. |
boolean |
equals(StencilBufferState sbs)
Compares this object with the specified object to check for equivalence. |
int |
getBufferBitMask()
Get the GL buffer bit flag that this state class represents. |
int |
getBufferType()
Get the type of buffer this state represents. |
int |
getClearMask()
Get the current function comparison mask. |
int |
getDepthFailOperation()
Get the current operation used when the stencil test passes, but depth test fails. |
int |
getDepthPassOperation()
Get the current operation used when the stencil and depth tests pass. |
int |
getFunctionCompareMask()
Get the current function comparison mask. |
int |
getFunctionReferenceValue()
Get the current stencil reference value for use in the stencil function setup. |
int |
getStencilFailOperation()
Get the current function comparison mask. |
int |
getStencilFunction()
Get the function type used when the stencil and depth tests pass. |
int |
getStencilWriteMask()
Get the current write mask. |
void |
setBufferState(javax.media.opengl.GL gl)
Issue ogl commands needed for this buffer to set the initial state, including the initial enabling. |
void |
setClearBufferState(boolean clear)
Set the flag for whether the buffer state should be cleared when this state object is executed. |
void |
setClearMask(int mask)
Set the bitmask used during the clear of the buffer. |
void |
setDepthFailOperation(int op)
Set the operation that should be performed if the stencil test passes but the depth test fails. |
void |
setDepthPassOperation(int op)
Set the operation that should be performed if the stencil and depth tests pass. |
void |
setFunctionCompareMask(int mask)
Set the bitmask used for the stencil comparison operation. |
void |
setFunctionReferenceValue(int value)
Set the reference value used for the stencil comparison operation. |
void |
setStencilFailOperation(int op)
Set the operation that should be performed if the stencil test fails. |
void |
setStencilFunction(int func)
Set the operation that should be performed if the stencil and depth tests pass. |
void |
setStencilWriteMask(int mask)
Set the bitmask used for the stencil write operation. |
void |
updateBufferState(javax.media.opengl.GL gl)
Issue ogl commands needed for this component to change the state, assuming that it is already enabled. |
Methods inherited from class org.j3d.aviatrix3d.BufferState |
---|
addParent, getParents, numParents, removeParent |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
checkForCyclicChild, checkForCyclicParent, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setLive, setUpdateHandler, setUserData |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final short STENCIL_INCREMENT
public static final short STENCIL_DECREMENT
public static final short STENCIL_KEEP
public static final short STENCIL_INVERT
public static final short STENCIL_ZERO
public static final short STENCIL_REPLACE
public static final int FUNCTION_NEVER
public static final int FUNCTION_LESS
public static final int FUNCTION_LESS_OR_EQUAL
public static final int FUNCTION_GREATER
public static final int FUNCTION_GREATER_OR_EQUAL
public static final int FUNCTION_EQUAL
public static final int FUNCTION_NOTEQUAL
public static final int FUNCTION_ALWAYS
Constructor Detail |
---|
public StencilBufferState()
Method Detail |
---|
public int getBufferType()
getBufferType
in interface BufferStateRenderable
public int getBufferBitMask()
getBufferBitMask
in interface BufferStateRenderable
public boolean checkClearBufferState()
checkClearBufferState
in interface BufferStateRenderable
public void setBufferState(javax.media.opengl.GL gl)
setBufferState
in interface BufferStateRenderable
gl
- The gl context to draw withpublic void updateBufferState(javax.media.opengl.GL gl)
updateBufferState
in interface BufferStateRenderable
gl
- The gl context to draw withpublic void clearBufferState(javax.media.opengl.GL gl)
clearBufferState
in interface BufferStateRenderable
gl
- The gl context to draw withpublic int compareTo(java.lang.Object o) throws java.lang.ClassCastException
compareTo
in interface java.lang.Comparable
o
- The objec to be compared
java.lang.ClassCastException
- The specified object's type prevents it from
being compared to this Objectpublic boolean equals(java.lang.Object o)
equals
in interface Renderable
equals
in class java.lang.Object
o
- The object to be compared
public void setClearBufferState(boolean clear) throws InvalidWriteTimingException
clear
- True if the buffer should be cleared when this is the first
state to be used in the current operation
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic void setClearMask(int mask) throws InvalidWriteTimingException
mask
- The bit mask of plane values to set during clear
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int getClearMask()
public void setFunctionCompareMask(int mask) throws InvalidWriteTimingException
mask
- The bit mask of planes to compare
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int getFunctionCompareMask()
public void setStencilWriteMask(int mask) throws InvalidWriteTimingException
mask
- The bit mask of planes to write when operations succeed
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int getStencilWriteMask()
public void setFunctionReferenceValue(int value) throws InvalidWriteTimingException
value
- A value to compare for the depth testing
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int getFunctionReferenceValue()
public void setStencilFailOperation(int op) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
op
- One of the STENCIL_ constants
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback method
java.lang.IllegalArgumentException
- The operation value was not one of the
valid types.public int getStencilFailOperation()
public void setDepthFailOperation(int op) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
op
- One of the STENCIL_ constants
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback method
java.lang.IllegalArgumentException
- The operation value was not one of the
valid types.public int getDepthFailOperation()
public void setDepthPassOperation(int op) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
op
- One of the STENCIL_ constants
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback method
java.lang.IllegalArgumentException
- The operation value was not one of the
valid types.public int getDepthPassOperation()
public void setStencilFunction(int func) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
func
- One of the FUNCTION_ constants
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback method
java.lang.IllegalArgumentException
- The operation value was not one of the
valid types.public int getStencilFunction()
public int compareTo(StencilBufferState sbs)
sbs
- The attributes instance to be comsbsred
public boolean equals(StencilBufferState sbs)
sbs
- The attributes instance to be compared
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |