Class BaseRenderedTexture
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.BaseTextureNode
org.web3d.vrml.renderer.common.nodes.BaseTexture2DNode
org.web3d.vrml.renderer.common.nodes.texture.BaseRenderedTexture
- All Implemented Interfaces:
VRMLNode,FrameStateListener,VRMLAppearanceChildNodeType,VRMLNodeType,VRMLTexture2DNodeType,VRMLTextureNodeType
- Direct Known Subclasses:
NRRenderedTexture,OGLRenderedTexture
public abstract class BaseRenderedTexture
extends BaseTexture2DNode
implements VRMLTexture2DNodeType
RenderedTexture node implementation.
- Version:
- $Revision: 1.10 $
- Author:
- Justin Couch
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringMessage for when the node in setValue() is not a Backgroundprotected static final StringMessage for when the proto is not a Backgroundprotected static final intIndex of background fieldprotected static final intIndex of dimensions fieldprotected static final intIndex of fog fieldprotected static final intIndex of scene fieldprotected static final intIndex of update fieldprotected static final intIndex of viewpoint fieldprotected static VRMLFieldDeclaration[]Array of VRMLFieldDeclarationsHashmap between a field name and its indexprotected static final StringMessage for when the node in setValue() is not a Fogprotected static final StringMessage for when the proto is not a Fogprotected static final intThe last field index used by this classprotected static final intNumber of fields implementedprotected VRMLProtoInstanceThe proto version of the backgroundprotected VRMLProtoInstanceThe proto version of the fogprotected VRMLProtoInstanceThe proto version of the sceneprotected VRMLProtoInstanceThe proto version of the viewpointprotected static final StringMessage for when the node in setValue() is not a Sceneprotected static final StringMessage for when the proto is not a Sceneprotected static final intInternal ID for updating every frameprotected static final intInternal ID for updating this next frameprotected static final intInternal ID for no updatesprotected intThe current update type as a constantMapping of the justify field string to the internal int typeprotected VRMLBackgroundNodeTypeexposedField SFNode background NULLprotected int[]field MFInt32 dimensionsprotected VRMLFogNodeTypeexposedField SFNode fog NULLprotected VRMLGroupingNodeTypeexposedField SFNode scene NULLprotected StringexposedField SFBool update FALSEprotected VRMLViewpointNodeTypeexposedField SFNode viewpoint NULLprotected static final StringMessage for when the node in setValue() is not a Viewpointprotected static final StringMessage for when the proto is not a ViewpointFields inherited from class org.web3d.vrml.renderer.common.nodes.BaseTexture2DNode
FIELD_DESCRIPTION, FIELD_REPEATS, FIELD_REPEATT, FIELD_TEXTURE_PROPERTIES, implImage, LAST_TEXTURENODETYPE_INDEX, pTextureProperties, TEXPROPS_VERSION_MSG, TEXTURE_PROPS_NODE_MSG, TEXTURE_PROPS_PROTO_MSG, vfDescription, vfRepeatS, vfRepeatT, vfTexturePropertiesFields inherited from class org.web3d.vrml.renderer.common.nodes.BaseTextureNode
listenerListFields 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
ConstructorsConstructorDescriptionConstructor creates a default movietexture node.Construct a new instance of this node based on the details from the given node. -
Method Summary
Modifier and TypeMethodDescriptiongetFieldDeclaration(int index) Get the declaration of the field at the given index.intgetFieldIndex(String fieldName) Get the index of the given field name.getFieldValue(int index) Get the value of a field.int[]Get the list of indices that correspond to fields that contain nodes ie MFNode and SFNode).intGet the number of fields.intGet the primary type of this node.intGet the texture type of this texture.voidsendRoute(double time, int srcIndex, VRMLNodeType destNode, int destIndex) Send a routed value from this node to the given destination node.protected voidSet new value to be used for the background field.protected voidsetFog(VRMLNodeType fog) Set new value to be used for the fog field.protected voidsetScene(VRMLNodeType scn) Set new value to be used for the scene field.protected voidThe update state has changed.voidNotification that the construction phase of this node has finished.voidsetValue(int index, int[] value, int numValid) Set the value of the field at the given index as a float.voidSet the value of the field at the given index as a float.voidsetValue(int index, VRMLNodeType child) Set the value of the field at the given index as a node.protected voidSet new value to be used for the viewpoint field.Methods inherited from class org.web3d.vrml.renderer.common.nodes.BaseTexture2DNode
copy, getDescription, getImage, getRepeatS, getRepeatT, getTextureProperties, setTextureProperties, setValueMethods inherited from class org.web3d.vrml.renderer.common.nodes.BaseTextureNode
addTextureListener, fireTextureImageChanged, fireTextureParamsChanged, getCacheString, removeTextureListenerMethods 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, setVersion, throwInitOnlyWriteException, throwInputOnlyWriteException, throwInvalidNodeException, throwInvalidProtoException, throwOutputOnlyWriteException, updateRefCount, updateRefsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.web3d.vrml.nodes.FrameStateListener
allEventsCompleteMethods inherited from interface org.web3d.vrml.lang.VRMLNode
getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersionMethods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, setDEF, setFrameStateManager, setMetadataObject, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCountMethods inherited from interface org.web3d.vrml.nodes.VRMLTexture2DNodeType
getDescription, getImage, getRepeatS, getRepeatT, getTextureProperties, setTexturePropertiesMethods inherited from interface org.web3d.vrml.nodes.VRMLTextureNodeType
addTextureListener, getCacheString, removeTextureListener
-
Field Details
-
FIELD_UPDATE
protected static final int FIELD_UPDATEIndex of update field- See Also:
-
FIELD_DIMENSIONS
protected static final int FIELD_DIMENSIONSIndex of dimensions field- See Also:
-
FIELD_BACKGROUND
protected static final int FIELD_BACKGROUNDIndex of background field- See Also:
-
FIELD_FOG
protected static final int FIELD_FOGIndex of fog field- See Also:
-
FIELD_VIEWPOINT
protected static final int FIELD_VIEWPOINTIndex of viewpoint field- See Also:
-
FIELD_SCENE
protected static final int FIELD_SCENEIndex of scene field- See Also:
-
LAST_RENDERED_INDEX
protected static final int LAST_RENDERED_INDEXThe last field index used by this class- See Also:
-
NUM_FIELDS
protected static final int NUM_FIELDSNumber of fields implemented- See Also:
-
BACKGROUND_PROTO_MSG
Message for when the proto is not a Background- See Also:
-
BACKGROUND_NODE_MSG
Message for when the node in setValue() is not a Background- See Also:
-
FOG_PROTO_MSG
-
FOG_NODE_MSG
Message for when the node in setValue() is not a Fog- See Also:
-
VIEWPOINT_PROTO_MSG
Message for when the proto is not a Viewpoint- See Also:
-
VIEWPOINT_NODE_MSG
Message for when the node in setValue() is not a Viewpoint- See Also:
-
SCENE_PROTO_MSG
-
SCENE_NODE_MSG
Message for when the node in setValue() is not a Scene- See Also:
-
UPDATE_NONE
protected static final int UPDATE_NONEInternal ID for no updates- See Also:
-
UPDATE_NEXT
protected static final int UPDATE_NEXTInternal ID for updating this next frame- See Also:
-
UPDATE_ALWAYS
protected static final int UPDATE_ALWAYSInternal ID for updating every frame- See Also:
-
fieldDecl
Array of VRMLFieldDeclarations -
fieldMap
-
updateMap
-
vfUpdate
exposedField SFBool update FALSE -
updateFlag
protected int updateFlagThe current update type as a constant -
vfDimensions
protected int[] vfDimensionsfield MFInt32 dimensions -
vfBackground
exposedField SFNode background NULL -
pBackground
The proto version of the background -
vfViewpoint
exposedField SFNode viewpoint NULL -
pViewpoint
The proto version of the viewpoint -
vfFog
exposedField SFNode fog NULL -
pFog
The proto version of the fog -
vfScene
exposedField SFNode scene NULL -
pScene
The proto version of the scene
-
-
Constructor Details
-
BaseRenderedTexture
public BaseRenderedTexture()Constructor creates a default movietexture node. -
BaseRenderedTexture
Construct a new instance of this node based on the details from the given node. If the node is not a Box node, an exception will be thrown.- Parameters:
node- The node to copy- Throws:
IllegalArgumentException- The node is not a Group node
-
-
Method Details
-
getTextureType
public int getTextureType()Get the texture type of this texture. Valid entries are defined in the vrml.lang.TextureConstants.- Specified by:
getTextureTypein interfaceVRMLTextureNodeType- Overrides:
getTextureTypein classBaseTexture2DNode- Returns:
- the texture type of this texture
-
getFieldIndex
Get the index of the given field name. If the name does not exist for this node then return a value of -1.- Specified by:
getFieldIndexin interfaceVRMLNode- Parameters:
fieldName- The name of the field we want the index from- Returns:
- The index of the field name or -1
-
getPrimaryType
public int getPrimaryType()Get the primary type of this node. Replaces the instanceof mechanism for use in switch statements.- Specified by:
getPrimaryTypein interfaceVRMLNode- Returns:
- The primary type
-
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:
setupFinishedin interfaceVRMLNodeType- Overrides:
setupFinishedin classBaseTexture2DNode
-
getNodeFieldIndices
public int[] getNodeFieldIndices()Get the list of indices that correspond to fields that contain nodes ie MFNode and SFNode). Used for blind scene graph traversal without needing to spend time querying for all fields etc. If a node does not have any fields that contain nodes, this shall return null. The field list covers all field types, regardless of whether they are readable or not at the VRML-level.- Specified by:
getNodeFieldIndicesin interfaceVRMLNode- Returns:
- The list of field indices that correspond to SF/MFnode fields or null if none
-
getFieldDeclaration
Get the declaration of the field at the given index. This allows for reverse lookup if needed. If the field does not exist, this will give a value of null.- Specified by:
getFieldDeclarationin interfaceVRMLNode- Parameters:
index- The index of the field to get information- Returns:
- A representation of this field's information
-
getNumFields
public int getNumFields()Get the number of fields.- Specified by:
getNumFieldsin interfaceVRMLNode- Returns:
- The number of fields.
-
getFieldValue
Get the value of a field. If the field is a primitive type, it will return a class representing the value. For arrays or nodes it will return the instance directly.- Specified by:
getFieldValuein interfaceVRMLNodeType- Overrides:
getFieldValuein classBaseTexture2DNode- Parameters:
index- The index of the field to change.- Returns:
- The class representing the field value
- Throws:
InvalidFieldException- The field index is not known
-
sendRoute
Send a routed value from this node to the given destination node. The route should use the appropriate setValue() method of the destination node. It should not attempt to cast the node up to a higher level. Routing should also follow the standard rules for the loop breaking and other appropriate rules for the specification.- Specified by:
sendRoutein interfaceVRMLNodeType- Overrides:
sendRoutein classBaseTexture2DNode- Parameters:
time- The time that this route occurred (not necessarily epoch time. Should be treated as a relative value only)srcIndex- The index of the field in this node that the value should be sent fromdestNode- The node reference that we will be sending the value todestIndex- The index of the field in the destination node that the value should be sent to.
-
setValue
public void setValue(int index, String value) throws InvalidFieldException, InvalidFieldValueException Set the value of the field at the given index as a float. This would be used to set SFBool field types.- Specified by:
setValuein interfaceVRMLNodeType- Overrides:
setValuein classBaseTexture2DNode- Parameters:
index- The index of destination field to setvalue- The new value to use for the node- Throws:
InvalidFieldException- The field index is not knowInvalidFieldValueException- The value provided is not in range or not appropriate for this field
-
setValue
public void setValue(int index, int[] value, int numValid) throws InvalidFieldException, InvalidFieldValueException, InvalidFieldAccessException Set the value of the field at the given index as a float. This would be used to set MFInt32/SFImage/MFImage field types.- Specified by:
setValuein interfaceVRMLNodeType- Overrides:
setValuein classAbstractNode- 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 field index is not knownInvalidFieldValueException- The value provided is out of range for the field type.InvalidFieldAccessException- The call is attempting to write to a field that does not permit writing now
-
setValue
public void setValue(int index, VRMLNodeType child) throws InvalidFieldException, InvalidFieldValueException Set the value of the field at the given index as a node. This would be used to set SFNode field types.- Specified by:
setValuein interfaceVRMLNodeType- Overrides:
setValuein classBaseTexture2DNode- Parameters:
index- The index of destination field to setchild- The new value to use for the node- Throws:
InvalidFieldException- The field index is not knownInvalidFieldValueException- The value provided is out of range for the field type.
-
setUpdate
The update state has changed. Override if need be for any renderer-specific needs.- Parameters:
state- The new state for updates
-
setBackground
Set new value to be used for the background field.- Parameters:
bg- The new background. null will act like delete- Throws:
InvalidFieldValueException- The node does not match the required type.
-
setFog
Set new value to be used for the fog field.- Parameters:
fog- The new fog. null will act like delete- Throws:
InvalidFieldValueException- The node does not match the required type.
-
setViewpoint
Set new value to be used for the viewpoint field.- Parameters:
vp- The new viewpoint. null will act like delete- Throws:
InvalidFieldValueException- The node does not match the required type.
-
setScene
Set new value to be used for the scene field.- Parameters:
scn- The new scene. null will act like delete- Throws:
InvalidFieldValueException- The node does not match the required type.
-