org.xith3d.scenegraph
Class RenderingAttributes

java.lang.Object
  extended by org.xith3d.scenegraph.SceneGraphObject
      extended by org.xith3d.scenegraph.NodeComponent
          extended by org.xith3d.scenegraph.RenderingAttributes
All Implemented Interfaces:
java.lang.Comparable<RenderingAttributes>, org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, StateTrackable<RenderingAttributes>

public class RenderingAttributes
extends NodeComponent
implements StateTrackable<RenderingAttributes>

RenderingAttributes defines attributes that apply to .


Field Summary
static org.jagatoo.opengl.enums.TestFunction ALWAYS
          Indicates pixels are always drawn irrespective of the alpha value.
static int COLOR_WRITE_MASK_ALL
           
static org.jagatoo.opengl.enums.StencilOperation DECREMENT
           
static org.jagatoo.opengl.enums.TestFunction EQUAL
           
static org.jagatoo.opengl.enums.TestFunction GREATER
           
static org.jagatoo.opengl.enums.TestFunction GREATER_OR_EQUAL
           
static org.jagatoo.opengl.enums.StencilOperation INCREMENT
           
static org.jagatoo.opengl.enums.StencilOperation INVERT
           
static org.jagatoo.opengl.enums.StencilOperation KEEP
           
static org.jagatoo.opengl.enums.TestFunction LESS
           
static org.jagatoo.opengl.enums.TestFunction LESS_OR_EQUAL
           
static org.jagatoo.opengl.enums.TestFunction NEVER
          Indicates pixels are never drawn irrespective of the alpha value.
static org.jagatoo.opengl.enums.TestFunction NOT_EQUAL
           
static org.jagatoo.opengl.enums.StencilOperation REPLACE
           
static org.jagatoo.opengl.enums.StencilOperation ZERO
           
 
Fields inherited from class org.xith3d.scenegraph.SceneGraphObject
XITH3D_USERDATAKEY_OLDUSERDATA
 
Constructor Summary
RenderingAttributes()
          Constructs a new RenderingAttributes object.
RenderingAttributes(boolean depthBufferEnabled, boolean depthBufferWriteEnabled, float alphaTestValue, org.jagatoo.opengl.enums.TestFunction alphaTestFunction)
          Constructs a new RenderingAttributes object.
RenderingAttributes(boolean depthBufferEnabled, boolean depthBufferWriteEnabled, org.jagatoo.opengl.enums.TestFunction depthTestFunction, float alphaTestValue, org.jagatoo.opengl.enums.TestFunction alphaTestFunction, boolean ignoreVertexColors, boolean stencilEnabled, org.jagatoo.opengl.enums.StencilOperation stencilOpFail, org.jagatoo.opengl.enums.StencilOperation stencilOpZFail, org.jagatoo.opengl.enums.StencilOperation stencilOpZPass, org.jagatoo.opengl.enums.TestFunction stencilTestFunction, int stencilRef, int stencilMask)
           
RenderingAttributes(boolean depthBufferEnabled, boolean depthBufferWriteEnabled, org.jagatoo.opengl.enums.TestFunction depthTestFunction, float alphaTestValue, org.jagatoo.opengl.enums.TestFunction alphaTestFunction, boolean ignoreVertexColors, boolean stencilEnabled, org.jagatoo.opengl.enums.StencilOperation stencilOpFail, org.jagatoo.opengl.enums.StencilOperation stencilOpZFail, org.jagatoo.opengl.enums.StencilOperation stencilOpZPass, org.jagatoo.opengl.enums.TestFunction stencilTestFunction, int stencilRef, int stencilMask, boolean enableRedWrite, boolean enableGreenWrite, boolean enableBlueWrite, boolean enableAlphaWrite)
           
 
Method Summary
 RenderingAttributes cloneNodeComponent(boolean forceDuplicate)
          
 int compareTo(RenderingAttributes o)
          
protected  void duplicateNodeComponent(NodeComponent originalNodeComponent, boolean forceDuplicate)
          
 boolean equals(java.lang.Object o)
          
 void freeOpenGLResources(CanvasPeer canvasPeer)
          This method frees OpenGL resources (names) for all this NodeComponent and all child-components.
 org.jagatoo.opengl.enums.TestFunction getAlphaTestFunction()
          Gets the alpha test function
 float getAlphaTestValue()
          Gets the alpha test value
 int getColorWriteMask()
           
 RenderingAttributes getCopy()
           
 org.jagatoo.opengl.enums.TestFunction getDepthTestFunction()
           
 boolean getIgnoreVertexColors()
           
 long getStateId()
           
 StateNode getStateNode()
           
 StencilFuncSeparate getStencilFuncSeparate()
           
 int getStencilMask()
           
 StencilMaskSeparate getStencilMaskSeparate()
           
 org.jagatoo.opengl.enums.StencilOperation getStencilOpFail()
           
 StencilOpSeparate getStencilOpSeparate()
           
 org.jagatoo.opengl.enums.StencilOperation getStencilOpZFail()
           
 org.jagatoo.opengl.enums.StencilOperation getStencilOpZPass()
           
 int getStencilRef()
           
 org.jagatoo.opengl.enums.TestFunction getStencilTestFunction()
           
 boolean hasColorWriteMask()
           
 boolean isAlphaWriteEnabled()
           
 boolean isBlueWriteEnabled()
           
 boolean isDepthBufferEnabled()
          Is the depth buffer enabled/disabled
 boolean isDepthBufferWriteEnabled()
          Is the depth buffer write enabled/disabled
 boolean isGreenWriteEnabled()
           
 boolean isRedWriteEnabled()
           
 boolean isStencilEnabled()
           
 void setAlphaTestFunction(org.jagatoo.opengl.enums.TestFunction func)
          Sets the alpha test function
 void setAlphaTestValue(float val)
          Sets the alpha test value
 void setAlphaWriteEnabled(boolean value)
           
 void setBlueWriteEnabled(boolean value)
           
 void setColorWriteMask(boolean valueR, boolean valueG, boolean valueB, boolean valueA)
           
 void setColorWriteMask(int mask)
           
 void setDepthBufferEnabled(boolean state)
          Enables/disables the depth buffer
 void setDepthBufferWriteEnabled(boolean state)
          Enables/Disables writing to the depth buffer
 void setDepthTestFunction(org.jagatoo.opengl.enums.TestFunction depthTestFunction)
          Sets the depth function for comparing against the z-buffer.
 void setGreenWriteEnabled(boolean value)
           
 void setIgnoreVertexColors(boolean ignoreVertexColors)
           
 void setRedWriteEnabled(boolean value)
           
 void setStateNode(StateNode node)
          Used by the render engine to set the state id for the node.
 void setStencilEnabled(boolean value)
           
 void setStencilFuncSeparate(StencilFuncSeparate funcSep)
           
 void setStencilMask(int value)
           
 void setStencilMaskSeparate(StencilMaskSeparate funcSep)
           
 void setStencilOp(org.jagatoo.opengl.enums.StencilOperation fail, org.jagatoo.opengl.enums.StencilOperation zfail, org.jagatoo.opengl.enums.StencilOperation zpass)
           
 void setStencilOpFail(org.jagatoo.opengl.enums.StencilOperation value)
           
 void setStencilOpSeparate(StencilOpSeparate funcSep)
           
 void setStencilOpZFail(org.jagatoo.opengl.enums.StencilOperation value)
           
 void setStencilOpZPass(org.jagatoo.opengl.enums.StencilOperation value)
           
 void setStencilRef(int value)
           
 void setStencilTestFunction(org.jagatoo.opengl.enums.TestFunction value)
           
 void setStencilTestFunction(org.jagatoo.opengl.enums.TestFunction func, int ref, int mask)
           
 
Methods inherited from class org.xith3d.scenegraph.NodeComponent
freeOpenGLResources, getDuplicateOnCloneTree, getModListener, isChanged, isChanged2, setChanged, setDuplicateOnCloneTree, setModListener
 
Methods inherited from class org.xith3d.scenegraph.SceneGraphObject
getName, getUserData, getUserData, getUserDataMap, isLive, setLive, setName, setUserData, setUserData, setUserDataRecursive, setUserDataRecursive, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALWAYS

public static final org.jagatoo.opengl.enums.TestFunction ALWAYS
Indicates pixels are always drawn irrespective of the alpha value. This effectively disables alpha testing.


NEVER

public static final org.jagatoo.opengl.enums.TestFunction NEVER
Indicates pixels are never drawn irrespective of the alpha value.


EQUAL

public static final org.jagatoo.opengl.enums.TestFunction EQUAL
See Also:
TestFunction.EQUAL

NOT_EQUAL

public static final org.jagatoo.opengl.enums.TestFunction NOT_EQUAL
See Also:
TestFunction.NOT_EQUAL

LESS

public static final org.jagatoo.opengl.enums.TestFunction LESS
See Also:
TestFunction.LESS

LESS_OR_EQUAL

public static final org.jagatoo.opengl.enums.TestFunction LESS_OR_EQUAL
See Also:
TestFunction.LESS_OR_EQUAL

GREATER

public static final org.jagatoo.opengl.enums.TestFunction GREATER
See Also:
TestFunction.GREATER

GREATER_OR_EQUAL

public static final org.jagatoo.opengl.enums.TestFunction GREATER_OR_EQUAL
See Also:
TestFunction.GREATER_OR_EQUAL

KEEP

public static final org.jagatoo.opengl.enums.StencilOperation KEEP
See Also:
StencilOperation.KEEP

ZERO

public static final org.jagatoo.opengl.enums.StencilOperation ZERO
See Also:
StencilOperation.ZERO

REPLACE

public static final org.jagatoo.opengl.enums.StencilOperation REPLACE
See Also:
StencilOperation.REPLACE

INCREMENT

public static final org.jagatoo.opengl.enums.StencilOperation INCREMENT
See Also:
StencilOperation.INCREMENT

DECREMENT

public static final org.jagatoo.opengl.enums.StencilOperation DECREMENT
See Also:
StencilOperation.DECREMENT

INVERT

public static final org.jagatoo.opengl.enums.StencilOperation INVERT
See Also:
StencilOperation.INVERT

COLOR_WRITE_MASK_ALL

public static final int COLOR_WRITE_MASK_ALL
See Also:
Constant Field Values
Constructor Detail

RenderingAttributes

public RenderingAttributes()
Constructs a new RenderingAttributes object.


RenderingAttributes

public RenderingAttributes(boolean depthBufferEnabled,
                           boolean depthBufferWriteEnabled,
                           float alphaTestValue,
                           org.jagatoo.opengl.enums.TestFunction alphaTestFunction)
Constructs a new RenderingAttributes object.


RenderingAttributes

public RenderingAttributes(boolean depthBufferEnabled,
                           boolean depthBufferWriteEnabled,
                           org.jagatoo.opengl.enums.TestFunction depthTestFunction,
                           float alphaTestValue,
                           org.jagatoo.opengl.enums.TestFunction alphaTestFunction,
                           boolean ignoreVertexColors,
                           boolean stencilEnabled,
                           org.jagatoo.opengl.enums.StencilOperation stencilOpFail,
                           org.jagatoo.opengl.enums.StencilOperation stencilOpZFail,
                           org.jagatoo.opengl.enums.StencilOperation stencilOpZPass,
                           org.jagatoo.opengl.enums.TestFunction stencilTestFunction,
                           int stencilRef,
                           int stencilMask)

RenderingAttributes

public RenderingAttributes(boolean depthBufferEnabled,
                           boolean depthBufferWriteEnabled,
                           org.jagatoo.opengl.enums.TestFunction depthTestFunction,
                           float alphaTestValue,
                           org.jagatoo.opengl.enums.TestFunction alphaTestFunction,
                           boolean ignoreVertexColors,
                           boolean stencilEnabled,
                           org.jagatoo.opengl.enums.StencilOperation stencilOpFail,
                           org.jagatoo.opengl.enums.StencilOperation stencilOpZFail,
                           org.jagatoo.opengl.enums.StencilOperation stencilOpZPass,
                           org.jagatoo.opengl.enums.TestFunction stencilTestFunction,
                           int stencilRef,
                           int stencilMask,
                           boolean enableRedWrite,
                           boolean enableGreenWrite,
                           boolean enableBlueWrite,
                           boolean enableAlphaWrite)
Method Detail

setDepthTestFunction

public void setDepthTestFunction(org.jagatoo.opengl.enums.TestFunction depthTestFunction)
Sets the depth function for comparing against the z-buffer. Normal operation is LESS, but for coplanar geometry you need to use LESS_OR_EQUAL


getDepthTestFunction

public org.jagatoo.opengl.enums.TestFunction getDepthTestFunction()

setDepthBufferEnabled

public final void setDepthBufferEnabled(boolean state)
Enables/disables the depth buffer


isDepthBufferEnabled

public final boolean isDepthBufferEnabled()
Is the depth buffer enabled/disabled


setDepthBufferWriteEnabled

public final void setDepthBufferWriteEnabled(boolean state)
Enables/Disables writing to the depth buffer


isDepthBufferWriteEnabled

public final boolean isDepthBufferWriteEnabled()
Is the depth buffer write enabled/disabled


setAlphaTestValue

public final void setAlphaTestValue(float val)
Sets the alpha test value


getAlphaTestValue

public final float getAlphaTestValue()
Gets the alpha test value


setAlphaTestFunction

public final void setAlphaTestFunction(org.jagatoo.opengl.enums.TestFunction func)
Sets the alpha test function


getAlphaTestFunction

public final org.jagatoo.opengl.enums.TestFunction getAlphaTestFunction()
Gets the alpha test function


setIgnoreVertexColors

public void setIgnoreVertexColors(boolean ignoreVertexColors)

getIgnoreVertexColors

public final boolean getIgnoreVertexColors()

setStencilEnabled

public void setStencilEnabled(boolean value)

isStencilEnabled

public final boolean isStencilEnabled()

setStencilOpFail

public void setStencilOpFail(org.jagatoo.opengl.enums.StencilOperation value)

getStencilOpFail

public final org.jagatoo.opengl.enums.StencilOperation getStencilOpFail()

setStencilOpZFail

public void setStencilOpZFail(org.jagatoo.opengl.enums.StencilOperation value)

getStencilOpZFail

public final org.jagatoo.opengl.enums.StencilOperation getStencilOpZFail()

setStencilOpZPass

public void setStencilOpZPass(org.jagatoo.opengl.enums.StencilOperation value)

getStencilOpZPass

public final org.jagatoo.opengl.enums.StencilOperation getStencilOpZPass()

setStencilOp

public void setStencilOp(org.jagatoo.opengl.enums.StencilOperation fail,
                         org.jagatoo.opengl.enums.StencilOperation zfail,
                         org.jagatoo.opengl.enums.StencilOperation zpass)

setStencilTestFunction

public void setStencilTestFunction(org.jagatoo.opengl.enums.TestFunction value)

getStencilTestFunction

public final org.jagatoo.opengl.enums.TestFunction getStencilTestFunction()

setStencilRef

public void setStencilRef(int value)

getStencilRef

public final int getStencilRef()

setStencilMask

public void setStencilMask(int value)

getStencilMask

public final int getStencilMask()

setStencilTestFunction

public void setStencilTestFunction(org.jagatoo.opengl.enums.TestFunction func,
                                   int ref,
                                   int mask)

setColorWriteMask

public void setColorWriteMask(int mask)

hasColorWriteMask

public final boolean hasColorWriteMask()

getColorWriteMask

public final int getColorWriteMask()

setRedWriteEnabled

public void setRedWriteEnabled(boolean value)

isRedWriteEnabled

public final boolean isRedWriteEnabled()

setGreenWriteEnabled

public void setGreenWriteEnabled(boolean value)

isGreenWriteEnabled

public final boolean isGreenWriteEnabled()

setBlueWriteEnabled

public void setBlueWriteEnabled(boolean value)

isBlueWriteEnabled

public final boolean isBlueWriteEnabled()

setAlphaWriteEnabled

public void setAlphaWriteEnabled(boolean value)

isAlphaWriteEnabled

public final boolean isAlphaWriteEnabled()

setColorWriteMask

public void setColorWriteMask(boolean valueR,
                              boolean valueG,
                              boolean valueB,
                              boolean valueA)

setStencilFuncSeparate

public final void setStencilFuncSeparate(StencilFuncSeparate funcSep)

getStencilFuncSeparate

public final StencilFuncSeparate getStencilFuncSeparate()

setStencilOpSeparate

public final void setStencilOpSeparate(StencilOpSeparate funcSep)

getStencilOpSeparate

public final StencilOpSeparate getStencilOpSeparate()

setStencilMaskSeparate

public final void setStencilMaskSeparate(StencilMaskSeparate funcSep)

getStencilMaskSeparate

public final StencilMaskSeparate getStencilMaskSeparate()

freeOpenGLResources

public void freeOpenGLResources(CanvasPeer canvasPeer)
This method frees OpenGL resources (names) for all this NodeComponent and all child-components.

Specified by:
freeOpenGLResources in class NodeComponent

setStateNode

public final void setStateNode(StateNode node)
Description copied from interface: StateTrackable
Used by the render engine to set the state id for the node.

Specified by:
setStateNode in interface StateTrackable<RenderingAttributes>

getStateNode

public final StateNode getStateNode()
Specified by:
getStateNode in interface StateTrackable<RenderingAttributes>
Returns:
the id of the object. This should return -1 if there is no assigned id.

getStateId

public final long getStateId()

duplicateNodeComponent

protected void duplicateNodeComponent(NodeComponent originalNodeComponent,
                                      boolean forceDuplicate)

Overrides:
duplicateNodeComponent in class NodeComponent

cloneNodeComponent

public RenderingAttributes cloneNodeComponent(boolean forceDuplicate)

Specified by:
cloneNodeComponent in class NodeComponent

getCopy

public RenderingAttributes getCopy()
Specified by:
getCopy in interface StateTrackable<RenderingAttributes>
Returns:
a copy of the state of the referenced trackable object.

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(RenderingAttributes o)

Specified by:
compareTo in interface java.lang.Comparable<RenderingAttributes>