javax.media.j3d
Class RenderingAttributesRetained

java.lang.Object
  extended by javax.media.j3d.IndexedObject
      extended by javax.media.j3d.SceneGraphObjectRetained
          extended by javax.media.j3d.NodeComponentRetained
              extended by javax.media.j3d.RenderingAttributesRetained
All Implemented Interfaces:
java.lang.Cloneable

 class RenderingAttributesRetained
extends NodeComponentRetained

The RenderingAttributes object defines all rendering state that can be set as a component object of a Shape3D node.


Field Summary
(package private) static int ALPHA_TEST_FUNC
           
(package private) static int ALPHA_TEST_VALUE
           
(package private)  int alphaTestFunction
           
(package private)  float alphaTestValue
           
(package private) static int DEPTH_ENABLE
           
(package private) static int DEPTH_TEST_FUNC
           
(package private) static int DEPTH_WRITE_ENABLE
           
(package private)  boolean depthBufferEnable
           
(package private)  boolean depthBufferWriteEnable
           
(package private)  int depthTestFunction
           
(package private) static int IGNORE_VCOLOR
           
(package private)  boolean ignoreVertexColors
           
(package private) static int LEQUAL
           
(package private) static int LESS
           
(package private) static int RASTER_OP_ENABLE
           
(package private) static int RASTER_OP_VALUE
           
(package private)  int rasterOp
           
(package private)  boolean rasterOpEnable
           
(package private) static int STENCIL_ENABLE
           
(package private) static int STENCIL_FUNC
           
(package private) static int STENCIL_OP_VALUES
           
(package private) static int STENCIL_WRITE_MASK
           
(package private)  int stencilCompareMask
           
(package private)  boolean stencilEnable
           
(package private)  int stencilFailOp
           
(package private)  int stencilFunction
           
(package private)  int stencilReferenceValue
           
(package private)  int stencilWriteMask
           
(package private)  int stencilZFailOp
           
(package private)  int stencilZPassOp
           
(package private)  boolean visible
           
(package private) static int VISIBLE
           
 
Fields inherited from class javax.media.j3d.NodeComponentRetained
changedFrequent, compChanged, duplicateOnCloneTree, mirror, refCnt, refCount, users
 
Fields inherited from class javax.media.j3d.SceneGraphObjectRetained
DONT_MERGE, inBackgroundGroup, inSetLive, MERGE, MERGE_DONE, mergeFlag, onUpdateList, source
 
Fields inherited from class javax.media.j3d.IndexedObject
listIdx
 
Constructor Summary
RenderingAttributesRetained()
           
 
Method Summary
(package private)  void createMirrorObject()
          Creates and initializes a mirror object, point the mirror object to the retained object if the object is not editable
(package private)  boolean equivalent(RenderingAttributesRetained rr)
           
(package private)  int getAlphaTestFunction()
          Retrieves current alpha test function.
(package private)  float getAlphaTestValue()
          Retrieves the alpha test value.
(package private)  boolean getDepthBufferEnable()
          Retrieves the state of zBuffer Enable flag
(package private)  boolean getDepthBufferWriteEnable()
          Retrieves the state of Depth Buffer Write Enable flag
(package private)  int getDepthTestFunction()
          Retrieves current depth test function.
(package private)  boolean getIgnoreVertexColors()
          Retrieves the state of vertex color Enable flag
(package private)  int getRasterOp()
          Retrieves the current raster op value.
(package private)  boolean getRasterOpEnable()
          Retrieves the current raster op enable flag.
(package private)  boolean getStencilEnable()
          Retrieves the current stencil enable state.
(package private)  void getStencilFunction(int[] params)
          Retrieves the current stencil op.
(package private)  void getStencilOp(int[] stencilOps)
          Retrieves the current stencil op.
(package private)  int getStencilWriteMask()
          Retrieves the current stencil write mask
(package private)  boolean getVisible()
          Retrieves the visibility flag for this RenderingAttributes object.
(package private)  void handleFrequencyChange(int bit)
           
(package private)  void initAlphaTestFunction(int function)
          Set alpha test function.
(package private)  void initAlphaTestValue(float value)
          Set alpha test value used by alpha test function.
(package private)  void initDepthBufferEnable(boolean state)
          Enables or disables depth buffer mode for this RenderAttributes component object.
(package private)  void initDepthBufferWriteEnable(boolean state)
          Enables or disables writing the depth buffer for this object.
(package private)  void initDepthTestFunction(int function)
          Set depth test function.
(package private)  void initIgnoreVertexColors(boolean state)
          Enables or disables vertex colors for this RenderAttributes component object.
(package private)  void initMirrorObject()
          Initializes a mirror object, point the mirror object to the retained object if the object is not editable
(package private)  void initRasterOp(int op)
          Initialize the raster op value
(package private)  void initRasterOpEnable(boolean flag)
          Initialize the raster op enable flag
(package private)  void initStencilEnable(boolean state)
          Initialize the stencil enable state
(package private)  void initStencilFunction(int function, int refValue, int compareMask)
          Initialize the stencil function value
(package private)  void initStencilOp(int failOp, int zFailOp, int zPassOp)
          Initialize the stencil op.
(package private)  void initStencilWriteMask(int mask)
          Initialize the stencil write mask
(package private)  void initVisible(boolean state)
          Sets the visibility flag for this RenderingAttributes component object.
(package private)  void sendMessage(int attrMask, java.lang.Object attr)
           
protected  void set(RenderingAttributesRetained ra)
           
(package private)  void setAlphaTestFunction(int function)
          Set alpha test function and sends a message notifying the interested structures of the change.
(package private)  void setAlphaTestValue(float value)
          Set alpha test value used by alpha test function and sends a message notifying the interested structures of the change.
(package private)  void setDepthBufferEnable(boolean state)
          Enables or disables depth buffer mode for this RenderAttributes component object and sends a message notifying the interested structures of the change.
(package private)  void setDepthBufferWriteEnable(boolean state)
          Enables or disables writing the depth buffer for this object and sends a message notifying the interested structures of the change.
(package private)  void setDepthTestFunction(int function)
          Set depth test function.
(package private)  void setIgnoreVertexColors(boolean state)
          Enables or disables vertex colors for this RenderAttributes component object and sends a message notifying the interested structures of the change.
(package private)  void setRasterOp(int op)
          Set the raster op value
(package private)  void setRasterOpEnable(boolean flag)
          Set the raster op enable flag
(package private)  void setStencilEnable(boolean state)
          Set the stencil enable state
(package private)  void setStencilFunction(int function, int refValue, int compareMask)
          Set the stencil function value
(package private)  void setStencilOp(int failOp, int zFailOp, int zPassOp)
          Set the stencil op.
(package private)  void setStencilWriteMask(int mask)
          Set the stencil write mask
(package private)  void setVisible(boolean state)
          Sets the visibility flag for this RenderingAttributes component object.
(package private)  void updateMirrorObject(int component, java.lang.Object value)
          Update the "component" field of the mirror object with the given "value"
(package private)  void updateNative(Canvas3D c3d, boolean depthBufferWriteEnableOverride, boolean depthBufferEnableOverride)
          Updates the native context.
 
Methods inherited from class javax.media.j3d.NodeComponentRetained
addAMirrorUser, addUser, clearLive, clone, copyMirrorUsers, decRefCnt, doSetLive, getDuplicateOnCloneTree, getInImmCtx, incRefCnt, notifyUsers, removeAMirrorUser, removeMirrorUsers, removeUser, set, setDuplicateOnCloneTree, setFrequencyChangeMask, setInImmCtx, setLive
 
Methods inherited from class javax.media.j3d.SceneGraphObjectRetained
clearLive, clearLive, compile, doSetLive, doSetLive, getSource, getVirtualUniverse, isInSetLive, isStatic, markAsLive, merge, mergeTransform, setCompiled, setLive, setLive, setSource, traverse
 
Methods inherited from class javax.media.j3d.IndexedObject
getIdxUsed, incIdxUsed
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEPTH_ENABLE

static final int DEPTH_ENABLE
See Also:
Constant Field Values

DEPTH_WRITE_ENABLE

static final int DEPTH_WRITE_ENABLE
See Also:
Constant Field Values

ALPHA_TEST_VALUE

static final int ALPHA_TEST_VALUE
See Also:
Constant Field Values

ALPHA_TEST_FUNC

static final int ALPHA_TEST_FUNC
See Also:
Constant Field Values

VISIBLE

static final int VISIBLE
See Also:
Constant Field Values

IGNORE_VCOLOR

static final int IGNORE_VCOLOR
See Also:
Constant Field Values

RASTER_OP_ENABLE

static final int RASTER_OP_ENABLE
See Also:
Constant Field Values

RASTER_OP_VALUE

static final int RASTER_OP_VALUE
See Also:
Constant Field Values

DEPTH_TEST_FUNC

static final int DEPTH_TEST_FUNC
See Also:
Constant Field Values

STENCIL_ENABLE

static final int STENCIL_ENABLE
See Also:
Constant Field Values

STENCIL_OP_VALUES

static final int STENCIL_OP_VALUES
See Also:
Constant Field Values

STENCIL_FUNC

static final int STENCIL_FUNC
See Also:
Constant Field Values

STENCIL_WRITE_MASK

static final int STENCIL_WRITE_MASK
See Also:
Constant Field Values

depthBufferEnable

boolean depthBufferEnable

depthBufferWriteEnable

boolean depthBufferWriteEnable

alphaTestValue

float alphaTestValue

alphaTestFunction

int alphaTestFunction

depthTestFunction

int depthTestFunction

visible

boolean visible

ignoreVertexColors

boolean ignoreVertexColors

rasterOpEnable

boolean rasterOpEnable

rasterOp

int rasterOp

stencilEnable

boolean stencilEnable

stencilFailOp

int stencilFailOp

stencilZFailOp

int stencilZFailOp

stencilZPassOp

int stencilZPassOp

stencilFunction

int stencilFunction

stencilReferenceValue

int stencilReferenceValue

stencilCompareMask

int stencilCompareMask

stencilWriteMask

int stencilWriteMask

LESS

static final int LESS
See Also:
Constant Field Values

LEQUAL

static final int LEQUAL
See Also:
Constant Field Values
Constructor Detail

RenderingAttributesRetained

RenderingAttributesRetained()
Method Detail

initVisible

final void initVisible(boolean state)
Sets the visibility flag for this RenderingAttributes component object.

Parameters:
visible - true or false to enable or disable visibility
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
See Also:
View.setVisibilityPolicy(int)

setVisible

final void setVisible(boolean state)
Sets the visibility flag for this RenderingAttributes component object. Invisible objects are not rendered (subject to the visibility policy for the current view), but they can be picked or collided with.

Parameters:
visible - true or false to enable or disable visibility
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
See Also:
View.setVisibilityPolicy(int)

getVisible

final boolean getVisible()
Retrieves the visibility flag for this RenderingAttributes object.

Returns:
true if the object is visible; false if the object is invisible.
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

initIgnoreVertexColors

final void initIgnoreVertexColors(boolean state)
Enables or disables vertex colors for this RenderAttributes component object.

Parameters:
state - true or false to enable or disable vertex colors

setIgnoreVertexColors

final void setIgnoreVertexColors(boolean state)
Enables or disables vertex colors for this RenderAttributes component object and sends a message notifying the interested structures of the change.

Parameters:
state - true or false to enable or disable depth vertex colors

getIgnoreVertexColors

final boolean getIgnoreVertexColors()
Retrieves the state of vertex color Enable flag

Returns:
true if vertex colors are enabled, false if vertex colors are disabled

initDepthBufferEnable

final void initDepthBufferEnable(boolean state)
Enables or disables depth buffer mode for this RenderAttributes component object.

Parameters:
state - true or false to enable or disable depth buffer mode

setDepthBufferEnable

final void setDepthBufferEnable(boolean state)
Enables or disables depth buffer mode for this RenderAttributes component object and sends a message notifying the interested structures of the change.

Parameters:
state - true or false to enable or disable depth buffer mode

getDepthBufferEnable

final boolean getDepthBufferEnable()
Retrieves the state of zBuffer Enable flag

Returns:
true if depth buffer mode is enabled, false if depth buffer mode is disabled

initDepthBufferWriteEnable

final void initDepthBufferWriteEnable(boolean state)
Enables or disables writing the depth buffer for this object. During the transparent rendering pass, this attribute can be overridden by the depthBufferFreezeTransparent attribute in the View object.

Parameters:
state - true or false to enable or disable depth buffer Write mode
See Also:
View.setDepthBufferFreezeTransparent(boolean)

setDepthBufferWriteEnable

final void setDepthBufferWriteEnable(boolean state)
Enables or disables writing the depth buffer for this object and sends a message notifying the interested structures of the change. During the transparent rendering pass, this attribute can be overridden by the depthBufferFreezeTransparent attribute in the View object.

Parameters:
state - true or false to enable or disable depth buffer Write mode
See Also:
View.setDepthBufferFreezeTransparent(boolean)

getDepthBufferWriteEnable

final boolean getDepthBufferWriteEnable()
Retrieves the state of Depth Buffer Write Enable flag

Returns:
true if depth buffer is writable, false if depth buffer is read-only

initAlphaTestValue

final void initAlphaTestValue(float value)
Set alpha test value used by alpha test function. This value is compared to the alpha value of each rendered pixel.

Parameters:
value - the alpha value

setAlphaTestValue

final void setAlphaTestValue(float value)
Set alpha test value used by alpha test function and sends a message notifying the interested structures of the change. This value is compared to the alpha value of each rendered pixel.

Parameters:
value - the alpha value

getAlphaTestValue

final float getAlphaTestValue()
Retrieves the alpha test value.

Returns:
the alpha test value.

initAlphaTestFunction

final void initAlphaTestFunction(int function)
Set alpha test function. This function is used to compare the alpha test value with each per-pixel alpha value. If the test passes, then the pixel is written otherwise the pixel is not written.

Parameters:
function - the new alpha test function. One of: ALWAYS, NEVER, EQUAL, NOT_EQUAL, LESS, LESS_OR_EQUAL, GREATER, GREATER_OR_EQUAL.

setAlphaTestFunction

final void setAlphaTestFunction(int function)
Set alpha test function and sends a message notifying the interested structures of the change. This function is used to compare the alpha test value with each per-pixel alpha value. If the test passes, then the pixel is written otherwise the pixel is not written.

Parameters:
function - the new alpha test function. One of: ALWAYS, NEVER, EQUAL, NOT_EQUAL, LESS, LESS_OR_EQUAL, GREATER, GREATER_OR_EQUAL.

getAlphaTestFunction

final int getAlphaTestFunction()
Retrieves current alpha test function.

Returns:
the current alpha test function

initDepthTestFunction

final void initDepthTestFunction(int function)
Set depth test function. This function is used to compare the depth test value with each per-pixel alpha value. If the test passes, then the pixel is written otherwise the pixel is not written.

Parameters:
function - the new depth test function. One of: ALWAYS, NEVER, EQUAL, NOT_EQUAL, LESS, LESS_OR_EQUAL, GREATER, GREATER_OR_EQUAL. Default value is LESS_OR_EQUAL

setDepthTestFunction

final void setDepthTestFunction(int function)
Set depth test function. This function is used to compare the depth test value with each per-pixel depth value. If the test passes, the pixel is written otherwise the pixel is not written.

Parameters:
function - the new depth test function. One of ALWAYS, NEVER, EQUAL, NOT_EQUAL, LESS, LESS_OR_EQUAL, GREATER, GREATER_OR_EQUAL Default value is LESS_OR_EQUAL

getDepthTestFunction

final int getDepthTestFunction()
Retrieves current depth test function.

Returns:
the current depth test function
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

initRasterOpEnable

final void initRasterOpEnable(boolean flag)
Initialize the raster op enable flag


setRasterOpEnable

final void setRasterOpEnable(boolean flag)
Set the raster op enable flag


getRasterOpEnable

final boolean getRasterOpEnable()
Retrieves the current raster op enable flag.


initRasterOp

final void initRasterOp(int op)
Initialize the raster op value


setRasterOp

final void setRasterOp(int op)
Set the raster op value


getRasterOp

final int getRasterOp()
Retrieves the current raster op value.


initStencilEnable

final void initStencilEnable(boolean state)
Initialize the stencil enable state


setStencilEnable

final void setStencilEnable(boolean state)
Set the stencil enable state


getStencilEnable

final boolean getStencilEnable()
Retrieves the current stencil enable state.


initStencilOp

final void initStencilOp(int failOp,
                         int zFailOp,
                         int zPassOp)
Initialize the stencil op. value


setStencilOp

final void setStencilOp(int failOp,
                        int zFailOp,
                        int zPassOp)
Set the stencil op. value


getStencilOp

final void getStencilOp(int[] stencilOps)
Retrieves the current stencil op. value


initStencilFunction

final void initStencilFunction(int function,
                               int refValue,
                               int compareMask)
Initialize the stencil function value


setStencilFunction

final void setStencilFunction(int function,
                              int refValue,
                              int compareMask)
Set the stencil function value


getStencilFunction

final void getStencilFunction(int[] params)
Retrieves the current stencil op. value


initStencilWriteMask

final void initStencilWriteMask(int mask)
Initialize the stencil write mask


setStencilWriteMask

final void setStencilWriteMask(int mask)
Set the stencil write mask


getStencilWriteMask

final int getStencilWriteMask()
Retrieves the current stencil write mask


updateNative

void updateNative(Canvas3D c3d,
                  boolean depthBufferWriteEnableOverride,
                  boolean depthBufferEnableOverride)
Updates the native context.


createMirrorObject

void createMirrorObject()
Creates and initializes a mirror object, point the mirror object to the retained object if the object is not editable

Overrides:
createMirrorObject in class NodeComponentRetained

initMirrorObject

void initMirrorObject()
Initializes a mirror object, point the mirror object to the retained object if the object is not editable

Overrides:
initMirrorObject in class NodeComponentRetained

updateMirrorObject

void updateMirrorObject(int component,
                        java.lang.Object value)
Update the "component" field of the mirror object with the given "value"

Overrides:
updateMirrorObject in class NodeComponentRetained

equivalent

boolean equivalent(RenderingAttributesRetained rr)

set

protected void set(RenderingAttributesRetained ra)

sendMessage

final void sendMessage(int attrMask,
                       java.lang.Object attr)

handleFrequencyChange

void handleFrequencyChange(int bit)
Overrides:
handleFrequencyChange in class SceneGraphObjectRetained


Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.