Class OGLTextureTransform
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.texture.BaseTextureTransform
org.web3d.vrml.renderer.ogl.nodes.texture.OGLTextureTransform
- All Implemented Interfaces:
VRMLNode
,FrameStateListener
,VRMLAppearanceChildNodeType
,VRMLNodeType
,VRMLTextureCoordinateTransformNodeType
,VRMLTextureTransformNodeType
,OGLTextureCoordinateTransformNodeType
,OGLVRMLNode
public class OGLTextureTransform
extends BaseTextureTransform
implements OGLTextureCoordinateTransformNodeType
OpenGL renderer implementation of a texture transform.
- Version:
- $Revision: 1.9 $
- Author:
- Alan Hudson
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.texture.BaseTextureTransform
al, C, FIELD_CENTER, FIELD_ROTATION, FIELD_SCALE, FIELD_TRANSLATION, fieldDecl, fieldMap, LAST_TEXTURETRANSFORM_INDEX, matrix, R, S, T, v1, v2, v3, vfCenter, vfRotation, vfScale, vfTranslation
Fields inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
errorReporter, FIELD_METADATA, fieldLocalData, hasChanged, inSetup, isDEF, isStatic, LAST_NODE_INDEX, layerIds, nodeName, pMetadata, refCounts, removedLayerIds, stateManager, STATIC_SCENE_GRAPH, vfMetadata, vrmlMajorVersion, vrmlMinorVersion
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new default instance of this class.Construct a new instance of this node based on the details from the given node. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a listener for textureTransform changesorg.j3d.aviatrix3d.SceneGraphObject
Get the OpenGL scene graph object representation of this node.javax.vecmath.Matrix4f[]
Request the Transformation used to represent a texture transformation.void
Remove a listener for textureTransform changesvoid
Notification that the construction phase of this node has finished.void
setValue
(int index, float value) Set the value of the field at the given index as a float.void
setValue
(int index, float[] value, int numValid) Set the value of the field at the given index as an array of floats.void
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.void
Notification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.Methods inherited from class org.web3d.vrml.renderer.common.nodes.texture.BaseTextureTransform
getCenter, getFieldDeclaration, getFieldIndex, getFieldValue, getNodeFieldIndices, getNumFields, getPrimaryType, getRotation, getScale, getTranslation, sendRoute, setCenter, setRotation, setScale, setTranslation, updateTransform
Methods inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
addNodeListener, allEventsComplete, checkNodeType, checkSecondaryType, checkSecondaryType, clearRemovedLayerIds, fireFieldChanged, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, getSecondaryType, getUserData, getVRMLNodeName, hasFieldChanged, isDEF, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, setDEF, setErrorReporter, setFrameStateManager, setMetadataObject, setUserData, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setVersion, throwInitOnlyWriteException, throwInputOnlyWriteException, throwInvalidNodeException, throwInvalidProtoException, throwOutputOnlyWriteException, updateRefCount, updateRefs
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.web3d.vrml.nodes.FrameStateListener
allEventsComplete
Methods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersion
Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getFieldValue, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
-
Constructor Details
-
OGLTextureTransform
public OGLTextureTransform()Construct a new default instance of this class. -
OGLTextureTransform
Construct a new instance of this node based on the details from the given node. If the node is not the same type, an exception will be thrown.- Parameters:
node
- The node to copy- Throws:
IllegalArgumentException
- The node is not the same type
-
-
Method Details
-
getSceneGraphObject
public org.j3d.aviatrix3d.SceneGraphObject getSceneGraphObject()Get the OpenGL scene graph object representation of this node. This will need to be cast to the appropriate parent type when being used. Default implementation returns null.- Specified by:
getSceneGraphObject
in interfaceOGLVRMLNode
- Returns:
- The OpenGL representation.
-
setupFinished
public void setupFinished()Notification that the construction phase of this node has finished. If the node would like to do any internal processing, such as setting up geometry, then go for it now.- Specified by:
setupFinished
in interfaceVRMLNodeType
- Overrides:
setupFinished
in classAbstractNode
-
updateNodeBoundsChanges
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.- Parameters:
src
- The node or Node Component that is to be updated.
-
updateNodeDataChanges
Notification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.- Parameters:
src
- The node or Node Component that is to be updated.
-
setValue
public void setValue(int index, float value) throws InvalidFieldException, InvalidFieldValueException Set the value of the field at the given index as a float. This would be used to set SFFloat field types.- Specified by:
setValue
in interfaceVRMLNodeType
- Overrides:
setValue
in classBaseTextureTransform
- Parameters:
index
- The index of destination field to setvalue
- The new value to use for the node- Throws:
InvalidFieldException
- The index does not match a known fieldInvalidFieldValueException
- The value provided is out of range for the field type.
-
setValue
public void setValue(int index, float[] value, int numValid) throws InvalidFieldException, InvalidFieldValueException Set the value of the field at the given index as an array of floats. This would be used to set SFColor and SFVec3f field types.- Specified by:
setValue
in interfaceVRMLNodeType
- Overrides:
setValue
in classBaseTextureTransform
- Parameters:
index
- The index of destination field to setvalue
- The new value to use for the nodenumValid
- The number of valid values to copy from the array- Throws:
InvalidFieldException
- The index does not match a known fieldInvalidFieldValueException
- The value provided is out of range for the field type.
-
getTransformMatrix
public javax.vecmath.Matrix4f[] getTransformMatrix()Request the Transformation used to represent a texture transformation. The transform will contain all of the warp, scale and rotation- Specified by:
getTransformMatrix
in interfaceOGLTextureCoordinateTransformNodeType
- Returns:
- The transform used to modify this texture
-
addTransformListener
Add a listener for textureTransform changes- Specified by:
addTransformListener
in interfaceOGLTextureCoordinateTransformNodeType
- Parameters:
tl
- The listener to add
-
removeTransformListener
Remove a listener for textureTransform changes- Specified by:
removeTransformListener
in interfaceOGLTextureCoordinateTransformNodeType
- Parameters:
tl
- The listener to remove
-