Class OGLInline
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.networking.BaseInline
org.web3d.vrml.renderer.ogl.nodes.networking.OGLInline
- All Implemented Interfaces:
org.j3d.aviatrix3d.NodeUpdateListener,VRMLExecutionSpace,VRMLNode,FrameStateListener,VRMLBoundedNodeType,VRMLChildNodeType,VRMLExternalNodeType,VRMLInlineNodeType,VRMLNodeType,VRMLSingleExternalNodeType,VRMLWorldRootChildNodeType,OGLVRMLNode
public class OGLInline
extends BaseInline
implements OGLVRMLNode, org.j3d.aviatrix3d.NodeUpdateListener
A node that can handle inlined content from other VRML worlds.
This implementation does not care whether the source world came from a UTF8 or XML encoded file.
While the node is awaiting content to be downloaded, it will put a wireframe box around the suggested bounds of the content. If no bounds are set then a 1x1x1 box is placed at the local origin. If the URL given is null, then the outline box will not be shown.
TODO:
- Implement a scheme to allow the updating of the contents at runtime when
the URL changes. It currently removes the old content, but does not
inform any ContentLoadManager to fetch it's new values.
- Version:
- $Revision: 1.12 $
- Author:
- Justin Couch
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.networking.BaseInline
FIELD_BBOX_CENTER, FIELD_BBOX_DISPLAY, FIELD_BBOX_SIZE, FIELD_LOAD, FIELD_URL, FIELD_VISIBLE, fieldDecl, fieldMap, LAST_INLINE_INDEX, loadedURI, loadState, scene, urlRelativeCheck, vfBboxCenter, vfBboxDisplay, vfBboxSize, vfLoad, vfUrl, vfVisible, worldURLFields 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
ConstructorsConstructorDescriptionCreate a new, default instance of this class.OGLInline(VRMLNodeType node) Construct a new instance of this node based on the details from the given node. -
Method Summary
Modifier and TypeMethodDescriptionvoidNotification that the rendering of the event model is complete and that rendering is about to begin.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.protected voidsetLoad(boolean value) Convenience method to handle the load field value.voidNotification that the construction phase of this node has finished.voidNotification that its safe to update the node now with any operations that could potentially effect the node's bounds.voidNotification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.Methods inherited from class org.web3d.vrml.renderer.common.nodes.networking.BaseInline
addContentStateListener, addUrlListener, checkValidContentType, fireContentStateChanged, fireUrlChanged, getBboxCenter, getBboxDisplay, getBboxSize, getContainedScene, getFieldDeclaration, getFieldIndex, getFieldValue, getLoadState, getNodeFieldIndices, getNumFields, getParentSpace, getPrimaryType, getSecondaryType, getUrl, getVisible, getWorldUrl, isShared, removeContentStateListener, removeUrlListener, sendRoute, setBboxCenter, setBboxDisplay, setBboxSize, setErrorReporter, setImportNodes, setLoadedURI, setLoadState, setParentSpace, setShared, setUrl, setValue, setValue, setValue, setVisible, setWorldUrlMethods inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
addNodeListener, checkNodeType, checkSecondaryType, checkSecondaryType, clearRemovedLayerIds, fireFieldChanged, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, getUserData, getVRMLNodeName, hasFieldChanged, isDEF, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, setDEF, setFrameStateManager, setMetadataObject, setUserData, setValue, 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.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, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
-
Constructor Details
-
OGLInline
public OGLInline()Create a new, default instance of this class. -
OGLInline
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
-
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 classBaseInline
-
getSceneGraphObject
public org.j3d.aviatrix3d.SceneGraphObject getSceneGraphObject()Get the OpenGL scene graph object representation of this node. This will need to be cast to the appropriate parent type when being used. Default implementation returns null.- Specified by:
getSceneGraphObjectin interfaceOGLVRMLNode- Returns:
- The OpenGL representation.
-
allEventsComplete
public void allEventsComplete()Notification that the rendering of the event model is complete and that rendering is about to begin. Used to update the scene graph with the loaded scene structure at the end of the frame to avoid issues with multiple access to the scene graph.- Specified by:
allEventsCompletein interfaceFrameStateListener- Overrides:
allEventsCompletein classAbstractNode
-
updateNodeBoundsChanges
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.- Specified by:
updateNodeBoundsChangesin interfaceorg.j3d.aviatrix3d.NodeUpdateListener- Parameters:
src- The node or Node Component that is to be updated.
-
updateNodeDataChanges
Notification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.- Specified by:
updateNodeDataChangesin interfaceorg.j3d.aviatrix3d.NodeUpdateListener- Parameters:
src- The node or Node Component that is to be updated.
-
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 classBaseInline- Parameters:
mimetype- The mime type of this object if knowncontent- The content of the object- Throws:
IllegalArgumentException- The content object is not supported
-
setLoad
Convenience method to handle the load field value. When value istruereplace the new URL with the old value by placing it immediately on the load queue. If the value isfalsethen it should immediately remove the content. The derived classes should make sure they override this method and handle the content removal. The derived class should do all it's work before calling this method.- Overrides:
setLoadin classBaseInline- Parameters:
value- The new load field state- Throws:
InvalidFieldException
-