Class OGLBackground
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.BaseBindableNode
org.web3d.vrml.renderer.common.nodes.enveffects.BaseBackground
org.web3d.vrml.renderer.ogl.nodes.enveffects.OGLBackground
- All Implemented Interfaces:
VRMLNode
,FrameStateListener
,VRMLBackgroundNodeType
,VRMLBindableNodeType
,VRMLChildNodeType
,VRMLExternalNodeType
,VRMLMultiExternalNodeType
,VRMLNodeType
,VRMLTimeDependentNodeType
,VRMLWorldRootChildNodeType
,OGLBackgroundNodeType
,OGLVRMLNode
OGL implementation of a Background node
- Version:
- $Revision: 1.15 $
- Author:
- Justin Couch
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.enveffects.BaseBackground
BACK, BOTTOM, EMPTY_LIST, FIELD_BACK_URL, FIELD_BOTTOM_URL, FIELD_FRONT_URL, FIELD_GROUND_ANGLE, FIELD_GROUND_COLOR, FIELD_LEFT_URL, FIELD_RIGHT_URL, FIELD_SKY_ANGLE, FIELD_SKY_COLOR, FIELD_TOP_URL, FIELD_TRANSPARENCY, FRONT, GROUND_SPHERE, isVersionPost_3_2, LAST_BACKGROUND_INDEX, LEFT, loadedUri, loadState, NUM_BG_OBJECTS, NUM_FIELDS, numGroundAngle, numGroundColor, numSkyAngle, numSkyColor, RIGHT, SKY_SPHERE, TOP, urlFieldIndexList, urlRelativeCheck, vfBackUrl, vfBottomUrl, vfFrontUrl, vfGroundAngle, vfGroundColor, vfLeftUrl, vfRightUrl, vfSkyAngle, vfSkyColor, vfTopUrl, vfTransparency, worldURL
Fields inherited from class org.web3d.vrml.renderer.common.nodes.BaseBindableNode
FIELD_BIND, FIELD_BIND_TIME, FIELD_IS_BOUND, isOnStack, LAST_BINDABLE_INDEX, vfBindTime, vfIsBound
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
ConstructorsConstructorDescriptionDefault constructor for a OGLBackgroundOGLBackground
(VRMLNodeType node) Construct a new instance of this node based on the details from the given node. -
Method Summary
Modifier and TypeMethodDescriptionorg.j3d.aviatrix3d.Texture2D[]
Get the list of textures defined for this background.boolean
getChangedTextures
(org.j3d.aviatrix3d.Texture2D[] textures, boolean[] changes) Get the list of textures defined for this background that have changed since the last frame.protected int
getFormat
(NIOBufferImage image) From the image information, generate the appropriate TextureComponent type.org.j3d.aviatrix3d.SceneGraphObject
Get the OpenGL scene graph object representation of this node.void
setContent
(int index, String mimetype, Object content) Set the content of this node to the given object.Methods inherited from class org.web3d.vrml.renderer.common.nodes.enveffects.BaseBackground
addContentStateListener, addUrlListener, checkValidContentType, fireContentStateChanged, fireUrlChanged, getFieldDeclaration, getFieldIndex, getFieldValue, getGroundValues, getLoadState, getNodeFieldIndices, getNumFields, getNumGroundColors, getNumSkyColors, getPreferredClassTypes, getPrimaryType, getSecondaryType, getSkyValues, getTransparency, getUrl, getUrlFieldIndexes, getWorldUrl, removeContentStateListener, removeUrlListener, sendRoute, setLoadedURI, setLoadState, setTransparency, setupFinished, setValue, setValue, setValue, setVersion, setWorldUrl
Methods inherited from class org.web3d.vrml.renderer.common.nodes.BaseBindableNode
addBindableNodeListener, copy, fireIsBoundChanged, getBindTime, getIsBound, removeBindableNodeListener, setBind, setOnStack, setValue, setVRMLClock
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, setValue, 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.nodes.VRMLBackgroundNodeType
getGroundValues, getNumGroundColors, getNumSkyColors, getSkyValues, getTransparency, setTransparency
Methods inherited from interface org.web3d.vrml.nodes.VRMLBindableNodeType
addBindableNodeListener, getBindTime, getIsBound, removeBindableNodeListener, setBind, setOnStack
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, setValue, updateRefCount
-
Constructor Details
-
OGLBackground
public OGLBackground()Default constructor for a OGLBackground -
OGLBackground
Construct a new instance of this node based on the details from the given node.- Parameters:
node
- The node to copy- Throws:
IllegalArgumentException
- The node is not the right type.
-
-
Method Details
-
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.
-
setContent
Description copied from interface:VRMLMultiExternalNodeType
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 interfaceVRMLMultiExternalNodeType
- Parameters:
index
- The field index to set the content formimetype
- The mime type of this object if knowncontent
- The content of the object- Throws:
IllegalArgumentException
- The content object is not supported
-
getChangedTextures
public boolean getChangedTextures(org.j3d.aviatrix3d.Texture2D[] textures, boolean[] changes) Description copied from interface:OGLBackgroundNodeType
Get the list of textures defined for this background that have changed since the last frame. The array contains the textures in the order back, front, left, right, top, bottom. If the texture hasn't changed is no texture defined, then that array element is null.- Specified by:
getChangedTextures
in interfaceOGLBackgroundNodeType
- Parameters:
textures
- The list of textures that have changed for this background.changes
- An array to copy in the flags of the individual textures that have changed- Returns:
- true if anything changed since the last time
-
getBackgroundTextures
public org.j3d.aviatrix3d.Texture2D[] getBackgroundTextures()Description copied from interface:OGLBackgroundNodeType
Get the list of textures defined for this background. The array contains the textures in the order front, back, left, right, top, bottom. If there is no texture defined, then that array element is null.- Specified by:
getBackgroundTextures
in interfaceOGLBackgroundNodeType
- Returns:
- The list of textures for this background.
-
getFormat
From the image information, generate the appropriate TextureComponent type.- Parameters:
image
- The image component to get the value from- Returns:
- The appropriate corresponding texture format value
-