javax.media.j3d
Class TextureUnitState

java.lang.Object
  extended by javax.media.j3d.SceneGraphObject
      extended by javax.media.j3d.NodeComponent
          extended by javax.media.j3d.TextureUnitState

public class TextureUnitState
extends NodeComponent

The TextureUnitState object defines all texture mapping state for a single texture unit. An appearance object contains an array of texture unit state objects to define the state for multiple texture mapping units. The texture unit state consists of the following:

Since:
Java 3D 1.2
See Also:
Appearance, Texture, TextureAttributes, TexCoordGeneration

Field Summary
static int ALLOW_STATE_READ
          Specifies that this TextureUnitState object allows reading its texture, texture attribute, or texture coordinate generation component information.
static int ALLOW_STATE_WRITE
          Specifies that this TextureUnitState object allows writing its texture, texture attribute, or texture coordinate generation component information.
 
Constructor Summary
TextureUnitState()
          Constructs a TextureUnitState component object using defaults for all state variables.
TextureUnitState(Texture texture, TextureAttributes textureAttributes, TexCoordGeneration texCoordGeneration)
          Constructs a TextureUnitState component object using the specified component objects.
 
Method Summary
 NodeComponent cloneNodeComponent()
          Deprecated. replaced with cloneNodeComponent(boolean forceDuplicate)
 void duplicateNodeComponent(NodeComponent originalNodeComponent)
          Deprecated. replaced with duplicateNodeComponent( NodeComponent originalNodeComponent, boolean forceDuplicate)
 TexCoordGeneration getTexCoordGeneration()
          Retrieves the current texCoordGeneration object.
 Texture getTexture()
          Retrieves the current texture object.
 TextureAttributes getTextureAttributes()
          Retrieves the current textureAttributes object.
 void set(Texture texture, TextureAttributes textureAttributes, TexCoordGeneration texCoordGeneration)
          Sets the texture, texture attributes, and texture coordinate generation components in this TextureUnitState object to the specified component objects.
 void setTexCoordGeneration(TexCoordGeneration texCoordGeneration)
          Sets the texCoordGeneration object to the specified object.
 void setTexture(Texture texture)
          Sets the texture object to the specified object.
 void setTextureAttributes(TextureAttributes textureAttributes)
          Sets the textureAttributes object to the specified object.
 
Methods inherited from class javax.media.j3d.NodeComponent
cloneNodeComponent, duplicateNodeComponent, getDuplicateOnCloneTree, setDuplicateOnCloneTree
 
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setUserData, updateNodeReferences
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALLOW_STATE_READ

public static final int ALLOW_STATE_READ
Specifies that this TextureUnitState object allows reading its texture, texture attribute, or texture coordinate generation component information.

See Also:
Constant Field Values

ALLOW_STATE_WRITE

public static final int ALLOW_STATE_WRITE
Specifies that this TextureUnitState object allows writing its texture, texture attribute, or texture coordinate generation component information.

See Also:
Constant Field Values
Constructor Detail

TextureUnitState

public TextureUnitState()
Constructs a TextureUnitState component object using defaults for all state variables. All component object references are initialized to null.


TextureUnitState

public TextureUnitState(Texture texture,
                        TextureAttributes textureAttributes,
                        TexCoordGeneration texCoordGeneration)
Constructs a TextureUnitState component object using the specified component objects.

Parameters:
texture - object that specifies the desired texture map and texture parameters
textureAttributes - object that specifies the desired texture attributes
texCoordGeneration - object that specifies the texture coordinate generation parameters
Method Detail

set

public void set(Texture texture,
                TextureAttributes textureAttributes,
                TexCoordGeneration texCoordGeneration)
Sets the texture, texture attributes, and texture coordinate generation components in this TextureUnitState object to the specified component objects.

Parameters:
texture - object that specifies the desired texture map and texture parameters
textureAttributes - object that specifies the desired texture attributes
texCoordGeneration - object that specifies the texture coordinate generation parameters

setTexture

public void setTexture(Texture texture)
Sets the texture object to the specified object. Setting it to null disables texture mapping for the texture unit corresponding to this TextureUnitState object.

Parameters:
texture - object that specifies the desired texture map and texture parameters
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

getTexture

public Texture getTexture()
Retrieves the current texture object.

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

setTextureAttributes

public void setTextureAttributes(TextureAttributes textureAttributes)
Sets the textureAttributes object to the specified object. Setting it to null will result in default attribute usage for the. texture unit corresponding to this TextureUnitState object.

Parameters:
textureAttributes - object that specifies the desired texture attributes
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

getTextureAttributes

public TextureAttributes getTextureAttributes()
Retrieves the current textureAttributes object.

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

setTexCoordGeneration

public void setTexCoordGeneration(TexCoordGeneration texCoordGeneration)
Sets the texCoordGeneration object to the specified object. Setting it to null disables texture coordinate generation for the texture unit corresponding to this TextureUnitState object.

Parameters:
texCoordGeneration - object that specifies the texture coordinate generation parameters
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

getTexCoordGeneration

public TexCoordGeneration getTexCoordGeneration()
Retrieves the current texCoordGeneration object.

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

cloneNodeComponent

public NodeComponent cloneNodeComponent()
Deprecated. replaced with cloneNodeComponent(boolean forceDuplicate)

Overrides:
cloneNodeComponent in class NodeComponent

duplicateNodeComponent

public void duplicateNodeComponent(NodeComponent originalNodeComponent)
Deprecated. replaced with duplicateNodeComponent( NodeComponent originalNodeComponent, boolean forceDuplicate)

NOTE: Applications should not call this method directly. It should only be called by the cloneNode method.

Overrides:
duplicateNodeComponent in class NodeComponent