org.xith3d.scenegraph
Class ColoringAttributes

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

public class ColoringAttributes
extends NodeComponent
implements StateTrackable<ColoringAttributes>

ColoringAttributes defines attributes that apply to color mapping. Coloring attributes also may define some of the material colors if used in conjunction with lit objects and materials with color target set to something else than NONE.


Field Summary
static org.jagatoo.opengl.enums.ShadeModel FASTEST
           
static org.jagatoo.opengl.enums.ShadeModel NICEST
           
static org.jagatoo.opengl.enums.ShadeModel SHADE_FLAT
           
static org.jagatoo.opengl.enums.ShadeModel SHADE_GOURAUD
           
 
Fields inherited from class org.xith3d.scenegraph.SceneGraphObject
XITH3D_USERDATAKEY_OLDUSERDATA
 
Constructor Summary
ColoringAttributes()
          Constructs a new ColoringAttributes object.
ColoringAttributes(org.openmali.vecmath2.Colorf color)
          Constructs a new ColoringAttributes object with the specified color.
ColoringAttributes(org.openmali.vecmath2.Colorf color, org.jagatoo.opengl.enums.ShadeModel shadeModel)
          Constructs a new ColoringAttributes object with the specified color.
ColoringAttributes(float r, float g, float b)
          Constructs a new ColoringAttributes object with the specified color.
ColoringAttributes(float r, float g, float b, org.jagatoo.opengl.enums.ShadeModel shadeModel)
          Constructs a new ColoringAttributes object with the specified color.
ColoringAttributes(org.jagatoo.opengl.enums.ShadeModel shadeModel)
          Constructs a new ColoringAttributes object with the specified color.
 
Method Summary
 ColoringAttributes cloneNodeComponent(boolean forceDuplicate)
          
 int compareTo(ColoringAttributes 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.
 org.openmali.vecmath2.Colorf getColor()
           
 org.openmali.vecmath2.Colorf getColor(org.openmali.vecmath2.Colorf color)
           
 ColoringAttributes getCopy()
           
 org.jagatoo.opengl.enums.ShadeModel getShadeModel()
           
 long getStateId()
           
 StateNode getStateNode()
           
 void setColor(org.openmali.vecmath2.Colorf color)
          Sets the color.
 void setColor(float r, float g, float b)
          Sets the color.
 void setShadeModel(org.jagatoo.opengl.enums.ShadeModel model)
          Sets the shade model.
 void setStateNode(StateNode node)
          Used by the render engine to set the state id for the node.
 
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

SHADE_FLAT

public static final org.jagatoo.opengl.enums.ShadeModel SHADE_FLAT
See Also:
ShadeModel.FLAT

SHADE_GOURAUD

public static final org.jagatoo.opengl.enums.ShadeModel SHADE_GOURAUD
See Also:
ShadeModel.GOURAUD

FASTEST

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

NICEST

public static final org.jagatoo.opengl.enums.ShadeModel NICEST
See Also:
ShadeModel.NICEST
Constructor Detail

ColoringAttributes

public ColoringAttributes()
Constructs a new ColoringAttributes object.


ColoringAttributes

public ColoringAttributes(float r,
                          float g,
                          float b,
                          org.jagatoo.opengl.enums.ShadeModel shadeModel)
Constructs a new ColoringAttributes object with the specified color.


ColoringAttributes

public ColoringAttributes(float r,
                          float g,
                          float b)
Constructs a new ColoringAttributes object with the specified color.


ColoringAttributes

public ColoringAttributes(org.openmali.vecmath2.Colorf color,
                          org.jagatoo.opengl.enums.ShadeModel shadeModel)
Constructs a new ColoringAttributes object with the specified color.


ColoringAttributes

public ColoringAttributes(org.openmali.vecmath2.Colorf color)
Constructs a new ColoringAttributes object with the specified color.


ColoringAttributes

public ColoringAttributes(org.jagatoo.opengl.enums.ShadeModel shadeModel)
Constructs a new ColoringAttributes object with the specified color.

Method Detail

setColor

public final void setColor(float r,
                           float g,
                           float b)
Sets the color.


setColor

public final void setColor(org.openmali.vecmath2.Colorf color)
Sets the color.


getColor

public final org.openmali.vecmath2.Colorf getColor(org.openmali.vecmath2.Colorf color)
Returns:
the color.

getColor

public final org.openmali.vecmath2.Colorf getColor()
Returns:
the color.

setShadeModel

public final void setShadeModel(org.jagatoo.opengl.enums.ShadeModel model)
Sets the shade model.


getShadeModel

public final org.jagatoo.opengl.enums.ShadeModel getShadeModel()
Returns:
the shade model.

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

getStateNode

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

getStateId

public final long getStateId()

getCopy

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

duplicateNodeComponent

protected void duplicateNodeComponent(NodeComponent original,
                                      boolean forceDuplicate)

Overrides:
duplicateNodeComponent in class NodeComponent

cloneNodeComponent

public ColoringAttributes 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