org.xith3d.scenegraph
Class TransparencyAttributes

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

public class TransparencyAttributes
extends NodeComponent
implements org.jagatoo.datatypes.Enableable, StateTrackable<TransparencyAttributes>

TransparencyAttributes defines attributes that apply to .


Field Summary
static org.jagatoo.opengl.enums.BlendFunction BLEND_ONE
           
static org.jagatoo.opengl.enums.BlendFunction BLEND_ONE_MINUS_SRC_ALPHA
           
static org.jagatoo.opengl.enums.BlendFunction BLEND_SRC_ALPHA
           
static org.jagatoo.opengl.enums.BlendFunction BLEND_ZERO
           
static org.jagatoo.opengl.enums.BlendMode BLENDED
           
static org.jagatoo.opengl.enums.BlendMode FASTEST
           
static org.jagatoo.opengl.enums.BlendMode NICEST
           
static org.jagatoo.opengl.enums.BlendMode NONE
           
static org.jagatoo.opengl.enums.BlendMode SCREEN_DOOR
           
 
Fields inherited from class org.xith3d.scenegraph.SceneGraphObject
XITH3D_USERDATAKEY_OLDUSERDATA
 
Constructor Summary
TransparencyAttributes()
          Constructs a new TransparencyAttributes object.
TransparencyAttributes(org.jagatoo.opengl.enums.BlendMode mode, float tval)
          Constructs a new TransparencyAttributes object.
TransparencyAttributes(org.jagatoo.opengl.enums.BlendMode mode, float tval, org.jagatoo.opengl.enums.BlendFunction srcBlendFunction, org.jagatoo.opengl.enums.BlendFunction dstBlendFunction)
           
TransparencyAttributes(org.jagatoo.opengl.enums.BlendMode mode, float tval, org.jagatoo.opengl.enums.BlendFunction srcBlendFunction, org.jagatoo.opengl.enums.BlendFunction dstBlendFunction, boolean sortEnabled, boolean enabled)
           
TransparencyAttributes(float tval)
          Constructs a new TransparencyAttributes object.
 
Method Summary
 TransparencyAttributes cloneNodeComponent(boolean forceDuplicate)
          
 int compareTo(TransparencyAttributes o)
           
protected  void duplicateNodeComponent(NodeComponent original, 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.
 TransparencyAttributes getCopy()
           
 org.jagatoo.opengl.enums.BlendFunction getDstBlendFunction()
           
 org.jagatoo.opengl.enums.BlendMode getMode()
           
 org.jagatoo.opengl.enums.BlendFunction getSrcBlendFunction()
           
 long getStateId()
           
 StateNode getStateNode()
           
 float getTransparency()
          Gets the transparency level.
 boolean isEnabled()
           
 boolean isSortEnabled()
           
 void setDstBlendFunction(org.jagatoo.opengl.enums.BlendFunction dstBlendFunction)
           
 void setEnabled(boolean enabled)
          Enables/disables actual transparency rendering on renderer level.
 void setMode(org.jagatoo.opengl.enums.BlendMode mode)
           
 void setSortEnabled(boolean sortEnabled)
          Enables or disables transparency sorting for this shape.
 void setSrcBlendFunction(org.jagatoo.opengl.enums.BlendFunction srcBlendFunction)
           
 void setStateNode(StateNode node)
          Used by the render engine to set the state id for the node.
 void setTransparency(float tval)
          Sets the tranparency level 0=opaque, 1=fully transparent.
 java.lang.String toString()
          
 
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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

public static final org.jagatoo.opengl.enums.BlendMode NONE
See Also:
BlendMode.NONE

BLENDED

public static final org.jagatoo.opengl.enums.BlendMode BLENDED
See Also:
BlendMode.BLENDED

NICEST

public static final org.jagatoo.opengl.enums.BlendMode NICEST
See Also:
BlendMode.NICEST

FASTEST

public static final org.jagatoo.opengl.enums.BlendMode FASTEST
See Also:
BlendMode.FASTEST

SCREEN_DOOR

public static final org.jagatoo.opengl.enums.BlendMode SCREEN_DOOR
See Also:
BlendMode.SCREEN_DOOR

BLEND_ZERO

public static final org.jagatoo.opengl.enums.BlendFunction BLEND_ZERO
See Also:
BlendFunction#BLEND_ZERO

BLEND_ONE

public static final org.jagatoo.opengl.enums.BlendFunction BLEND_ONE
See Also:
BlendFunction#BLEND_ONE

BLEND_SRC_ALPHA

public static final org.jagatoo.opengl.enums.BlendFunction BLEND_SRC_ALPHA
See Also:
BlendFunction#BLEND_SRC_ALPHA

BLEND_ONE_MINUS_SRC_ALPHA

public static final org.jagatoo.opengl.enums.BlendFunction BLEND_ONE_MINUS_SRC_ALPHA
See Also:
BlendFunction#BLEND_ONE_MINUS_SRC_ALPHA
Constructor Detail

TransparencyAttributes

public TransparencyAttributes()
Constructs a new TransparencyAttributes object.


TransparencyAttributes

public TransparencyAttributes(org.jagatoo.opengl.enums.BlendMode mode,
                              float tval)
Constructs a new TransparencyAttributes object.


TransparencyAttributes

public TransparencyAttributes(float tval)
Constructs a new TransparencyAttributes object.


TransparencyAttributes

public TransparencyAttributes(org.jagatoo.opengl.enums.BlendMode mode,
                              float tval,
                              org.jagatoo.opengl.enums.BlendFunction srcBlendFunction,
                              org.jagatoo.opengl.enums.BlendFunction dstBlendFunction)

TransparencyAttributes

public TransparencyAttributes(org.jagatoo.opengl.enums.BlendMode mode,
                              float tval,
                              org.jagatoo.opengl.enums.BlendFunction srcBlendFunction,
                              org.jagatoo.opengl.enums.BlendFunction dstBlendFunction,
                              boolean sortEnabled,
                              boolean enabled)
Method Detail

setEnabled

public void setEnabled(boolean enabled)
Enables/disables actual transparency rendering on renderer level. Setting this to false causes the object to be places on transparency rendering pass but actually disables the transparency for this object. This can be used to ensure rendering order for stencil operations and keep opaque object rendering speed high.

Specified by:
setEnabled in interface org.jagatoo.datatypes.Enableable
See Also:
OrderedGroup, setSortEnabled(boolean)

isEnabled

public final boolean isEnabled()
Specified by:
isEnabled in interface org.jagatoo.datatypes.Enableable

setSortEnabled

public void setSortEnabled(boolean sortEnabled)
Enables or disables transparency sorting for this shape.

Transparency attributes can be marked to disable sorting transparent shapes by calling of setSortEnabled(false). When this is done, transparent shape it will not be drawn during the transparent rendering pass, but will be drawn with the solids (in the opaque rendering pass), i.e. this transparent shape will be treated just like regular opaque shape.

By default, sorting is enabled.

See Also:
OrderedGroup, setEnabled(boolean)

isSortEnabled

public final boolean isSortEnabled()

setTransparency

public final void setTransparency(float tval)
Sets the tranparency level 0=opaque, 1=fully transparent.


getTransparency

public final float getTransparency()
Gets the transparency level.


setMode

public void setMode(org.jagatoo.opengl.enums.BlendMode mode)

getMode

public final org.jagatoo.opengl.enums.BlendMode getMode()

setSrcBlendFunction

public void setSrcBlendFunction(org.jagatoo.opengl.enums.BlendFunction srcBlendFunction)

getSrcBlendFunction

public final org.jagatoo.opengl.enums.BlendFunction getSrcBlendFunction()

setDstBlendFunction

public void setDstBlendFunction(org.jagatoo.opengl.enums.BlendFunction dstBlendFunction)

getDstBlendFunction

public final org.jagatoo.opengl.enums.BlendFunction getDstBlendFunction()

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<TransparencyAttributes>

getStateNode

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

getStateId

public final long getStateId()

getCopy

public TransparencyAttributes getCopy()
Specified by:
getCopy in interface StateTrackable<TransparencyAttributes>
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(TransparencyAttributes o)
Specified by:
compareTo in interface java.lang.Comparable<TransparencyAttributes>

toString

public java.lang.String toString()

Overrides:
toString in class SceneGraphObject

duplicateNodeComponent

protected void duplicateNodeComponent(NodeComponent original,
                                      boolean forceDuplicate)

Overrides:
duplicateNodeComponent in class NodeComponent

cloneNodeComponent

public TransparencyAttributes cloneNodeComponent(boolean forceDuplicate)

Specified by:
cloneNodeComponent in class NodeComponent

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