Class BaseTexture3DNode
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.BaseTextureNode
org.web3d.vrml.renderer.common.nodes.BaseTexture3DNode
- All Implemented Interfaces:
VRMLNode
,FrameStateListener
,VRMLAppearanceChildNodeType
,VRMLNodeType
,VRMLTexture3DNodeType
,VRMLTextureNodeType
- Direct Known Subclasses:
BaseComposedTexture3D
,BaseImageTexture3D
,BasePixelTexture3D
Base implementation of a 3D texture object.
Performs the VRML field handling for REPEAT_S, REPEAT_T and REPEAT_R
The node is defined by the X3DTexture3DNode type, which is defined as:
X3DTexture3DNode : X3DTextureNode { SFNode [in,out] metadata NULL [X3DMetadataObject] SFBool [] repeatS FALSE SFBool [] repeatT FALSE SFBool [] repeatR FALSE }
- Version:
- $Revision: 1.11 $
- Author:
- Justin Couch
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final int
Index of the repeatR fieldprotected static final int
Index of the repeatS fieldprotected static final int
Index of the repeatT fieldprotected static final int
Last valid index used in this classprotected int
The number of 2D image slices that the user has definedprotected boolean
field SFBool repeatR TRUEprotected boolean
field SFBool repeatS TRUEprotected boolean
field SFBool repeatT TRUEFields inherited from class org.web3d.vrml.renderer.common.nodes.BaseTextureNode
listenerList
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
copy
(VRMLTexture3DNodeType node) Set the fields of the grouping node that has the fields set based on the fields of the passed in node.int
getDepth()
Get the depth of the texture.getFieldValue
(int index) Get the value of a field.boolean
Get the value of field repeatR.boolean
Get the value of field repeatS.boolean
Get the value of field repeatT.int
Get the texture type of this texture.void
setValue
(int index, boolean value) Set the value of the field at the given index as an boolean.Methods inherited from class org.web3d.vrml.renderer.common.nodes.BaseTextureNode
addTextureListener, fireTextureImageChanged, fireTextureParamsChanged, getCacheString, removeTextureListener
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, sendRoute, setDEF, setErrorReporter, setFrameStateManager, setMetadataObject, setupFinished, setUserData, setValue, 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, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setupFinished, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
Methods inherited from interface org.web3d.vrml.nodes.VRMLTextureNodeType
addTextureListener, getCacheString, removeTextureListener
-
Field Details
-
FIELD_REPEATS
protected static final int FIELD_REPEATSIndex of the repeatS field- See Also:
-
FIELD_REPEATT
protected static final int FIELD_REPEATTIndex of the repeatT field- See Also:
-
FIELD_REPEATR
protected static final int FIELD_REPEATRIndex of the repeatR field- See Also:
-
LAST_3DTEXTURE_INDEX
protected static final int LAST_3DTEXTURE_INDEXLast valid index used in this class- See Also:
-
vfRepeatS
protected boolean vfRepeatSfield SFBool repeatS TRUE -
vfRepeatT
protected boolean vfRepeatTfield SFBool repeatT TRUE -
vfRepeatR
protected boolean vfRepeatRfield SFBool repeatR TRUE -
textureDepth
protected int textureDepthThe number of 2D image slices that the user has defined
-
-
Constructor Details
-
BaseTexture3DNode
Default constructor for the node. The repeat flags are set to TRUE.- Parameters:
name
- The name of the type of node
-
-
Method Details
-
copy
Set the fields of the grouping node that has the fields set based on the fields of the passed in node. This will not copy any children nodes, only the local fields.- Parameters:
node
- The grouping node to copy info from
-
getDepth
public int getDepth()Get the depth of the texture. This is the number of 2D slices that are provided (by the user) and should always be a multiple of 2.- Specified by:
getDepth
in interfaceVRMLTexture3DNodeType
- Returns:
- A positive multiple of 2 or zero if none defined.
-
getTextureType
public int getTextureType()Get the texture type of this texture. Valid entries are defined in the vrml.lang.TextureConstants.- Specified by:
getTextureType
in interfaceVRMLTextureNodeType
- Returns:
- TextureConstants.TYPE_SINGLE_3D
-
getRepeatS
public boolean getRepeatS()Get the value of field repeatS. The field is not writable. Default value istrue
.- Specified by:
getRepeatS
in interfaceVRMLTexture3DNodeType
- Returns:
- The current value of repeatS
-
getRepeatT
public boolean getRepeatT()Get the value of field repeatT. The field is not writable. Default value istrue
.- Specified by:
getRepeatT
in interfaceVRMLTexture3DNodeType
- Returns:
- The current value of repeatT
-
getRepeatR
public boolean getRepeatR()Get the value of field repeatR. The field is not writable. Default value istrue
.- Specified by:
getRepeatR
in interfaceVRMLTexture3DNodeType
- Returns:
- The current value of repeatR
-
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:
getFieldValue
in interfaceVRMLNodeType
- Overrides:
getFieldValue
in classAbstractNode
- Parameters:
index
- The index of the field to change.- Returns:
- The class representing the field value
- Throws:
InvalidFieldException
- The field index is not known
-
setValue
Set the value of the field at the given index as an boolean. This would be used to set SFBool field types.- Specified by:
setValue
in interfaceVRMLNodeType
- Overrides:
setValue
in classAbstractNode
- Parameters:
index
- The index of destination field to setvalue
- The new value to use for the node- Throws:
InvalidFieldException
- The field index is not know
-