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, vfURLFields 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, vrmlMinorVersionFields 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.SceneGraphObjectGet the OpenGL scene graph object representation of this node.voidsetContent(String mimetype, Object content) Set the content of this node to the given object.voidsetTexture(int index, org.j3d.aviatrix3d.Texture tex) Set the Aviatrix3D texture representation back into the node implementation.voidSet the URL to a new value.voidSet 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, setWorldUrlMethods inherited from class org.web3d.vrml.renderer.common.nodes.BaseTexture2DNode
copy, getImage, getRepeatS, getRepeatT, getTextureProperties, getTextureType, setTextureProperties, setupFinished, setValueMethods inherited from class org.web3d.vrml.renderer.common.nodes.BaseTextureNode
addTextureListener, fireTextureImageChanged, fireTextureParamsChanged, removeTextureListenerMethods 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, 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
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersionMethods 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, updateRefCountMethods 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:
setUrlin interfaceVRMLSingleExternalNodeType- Overrides:
setUrlin 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:
setContentin interfaceVRMLSingleExternalNodeType- Overrides:
setContentin 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:
getCacheStringin interfaceVRMLTextureNodeType- Overrides:
getCacheStringin 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:
setTexturein 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:OGLVRMLNodeGet 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:
getSceneGraphObjectin 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:
setValuein interfaceVRMLNodeType- Overrides:
setValuein 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
-