Class OGLImageTexture
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.BaseImageTexture
org.web3d.vrml.renderer.ogl.nodes.texture.OGLImageTexture
- All Implemented Interfaces:
VRMLNode
,FrameStateListener
,VRMLAppearanceChildNodeType
,VRMLExternalNodeType
,VRMLNodeType
,VRMLSingleExternalNodeType
,VRMLTexture2DNodeType
,VRMLTextureNodeType
,OGLTextureNodeType
,OGLVRMLNode
OGL implementation of a ImageTexture node.
- Version:
- $Revision: 2.5 $
- Author:
- Alan Hudson, Justin Couch
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.texture.BaseImageTexture
FIELD_AUTOREFRESH, FIELD_AUTOREFRESHTIMELIMIT, FIELD_LOAD, FIELD_URL, loadedURI, loadState, vfAutoRefresh, vfAutoRefreshTimeLimit, vfLoad, vfURL
Fields 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, vfTextureProperties
Fields 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
Fields inherited from interface org.web3d.vrml.nodes.VRMLExternalNodeType
LOAD_COMPLETE, LOAD_FAILED, LOADING, NOT_LOADED
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a default instance of this node.OGLImageTexture
(VRMLNodeType node) Construct a new instance of this node based on the details from the given node. -
Method Summary
Modifier and TypeMethodDescriptiongetCacheString
(int stage) Get a string for caching this object.org.j3d.aviatrix3d.SceneGraphObject
Get the OpenGL scene graph object representation of this node.void
setContent
(String mimetype, Object content) Set the content of this node to the given object.void
setTexture
(int index, org.j3d.aviatrix3d.Texture tex) Set the Aviatrix3D texture representation back into the node implementation.void
Set the URL to a new value.void
Set the value of the field at the given index as an array of strings.Methods inherited from class org.web3d.vrml.renderer.common.nodes.texture.BaseImageTexture
addContentStateListener, addUrlListener, checkValidContentType, fireContentStateChanged, fireUrlChanged, getAutoRefresh, getAutoRefreshTimeLimit, getDescription, getFieldDeclaration, getFieldIndex, getFieldValue, getLoad, getLoadState, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUrl, getWorldUrl, removeContentStateListener, removeUrlListener, sendRoute, setAutoRefresh, setAutoRefreshTimeLimit, setDescription, setLoad, setLoadedURI, setLoadState, setValue, setValue, setValue, setWorldUrl
Methods inherited from class org.web3d.vrml.renderer.common.nodes.BaseTexture2DNode
copy, getImage, getRepeatS, getRepeatT, getTextureProperties, getTextureType, setTextureProperties, setupFinished, setValue
Methods inherited from class org.web3d.vrml.renderer.common.nodes.BaseTextureNode
addTextureListener, fireTextureImageChanged, fireTextureParamsChanged, removeTextureListener
Methods inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
addNodeListener, allEventsComplete, checkNodeType, checkSecondaryType, checkSecondaryType, clearRemovedLayerIds, fireFieldChanged, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, getUserData, getVRMLNodeName, hasFieldChanged, isDEF, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, setDEF, setErrorReporter, setFrameStateManager, setMetadataObject, setUserData, 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, 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, removeTextureListener
-
Constructor Details
-
OGLImageTexture
public OGLImageTexture()Construct a default instance of this node. -
OGLImageTexture
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
- Incorrect Node Type
-
-
Method Details
-
setUrl
Set the URL to a new value. If the value is null, it removes the old contents (if set) and treats it as though there is no content.- Specified by:
setUrl
in interfaceVRMLSingleExternalNodeType
- Overrides:
setUrl
in classBaseImageTexture
- Parameters:
newURL
- The list of urls to set or nullnumValid
- The number of valid values to copy from the array
-
setContent
Set the content of this node to the given object. The object is then cast by the internal representation to the form it needs. This assumes at least some amount of intelligence on the part of the caller, but we also know that we should not pass something dumb to it when we can check what sort of content types it likes to handle. We assume the loader thread is operating in the same context as the one that created the node in the first place and thus knows the general types of items to pass through.- Specified by:
setContent
in interfaceVRMLSingleExternalNodeType
- Overrides:
setContent
in classBaseImageTexture
- Parameters:
mimetype
- The mime type of this object if knowncontent
- The content of the object- Throws:
IllegalArgumentException
- The content object is not supported
-
getCacheString
Get a string for caching this object. Null means do not cache this texture.- Specified by:
getCacheString
in interfaceVRMLTextureNodeType
- Overrides:
getCacheString
in classBaseImageTexture
- Parameters:
stage
- The stage number, 0 for all single stage textures.- Returns:
- A string to use in lookups. Typically the url loaded.
-
setTexture
public void setTexture(int index, org.j3d.aviatrix3d.Texture tex) Set the Aviatrix3D texture representation back into the node implementation.- Specified by:
setTexture
in interfaceOGLTextureNodeType
- Parameters:
index
- The index of the texture (for multitexture)tex
- The texture object to set
-
getSceneGraphObject
public org.j3d.aviatrix3d.SceneGraphObject getSceneGraphObject()Description copied from interface:OGLVRMLNode
Get the OpenGL scene graph object representation of this node. This will need to be cast to the appropriate parent type when being used.- Specified by:
getSceneGraphObject
in interfaceOGLVRMLNode
- Returns:
- The OpenGL representation.
-
setValue
public void setValue(int index, String[] value, int numValid) throws InvalidFieldException, InvalidFieldValueException Set the value of the field at the given index as an array of strings. This would be used to set MFString field types.- Specified by:
setValue
in interfaceVRMLNodeType
- Overrides:
setValue
in classBaseImageTexture
- 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 knowInvalidFieldValueException
- The value provided is not in range or not appropriate for this field
-