Class OGLLayer
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.layering.BaseLayer
org.web3d.vrml.renderer.ogl.nodes.layering.OGLLayer
- All Implemented Interfaces:
org.j3d.aviatrix3d.NodeUpdateListener,VRMLNode,FrameStateListener,VRMLLayerNodeType,VRMLNodeType,OGLVRMLNode
public class OGLLayer
extends BaseLayer
implements OGLVRMLNode, org.j3d.aviatrix3d.NodeUpdateListener
OpenGL Implementation of the Layer node.
- Version:
- $Revision: 1.3 $
- Author:
- Justin Couch
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.layering.BaseLayer
FIELD_ADDCHILDREN, FIELD_CHILDREN, FIELD_IS_PICKABLE, FIELD_REMOVECHILDREN, FIELD_VIEWPORT, LAST_LAYER_INDEX, layerId, layerListeners, NUM_FIELDS, pViewport, vfChildren, vfIsPickable, vfViewport, VIEWPORT_NODE_MSG, VIEWPORT_PROTO_MSGFields 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
ConstructorsConstructorDescriptionOGLLayer()Initialise the time dependent node and it's fields that are held locally.OGLLayer(VRMLNodeType node) Construct a new instance of this node based on the details from the given node. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddChildNode(VRMLNodeType node) Add a single child node to the list of available children.voidNotification that the rendering of the event model is complete and that rendering is about to begin.protected voidClear the child node list of all children - both VRML and OpenGL.org.j3d.aviatrix3d.SceneGraphObjectGet the OpenGL scene graph object representation of this node.voidnotifyExternProtoLoaded(int index, VRMLNodeType node) Notify a node that an ExternProto has resolved.protected voidremoveChildNode(VRMLNodeType node) Remove the given node from this grouping node.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.layering.BaseLayer
addLayerListener, getFieldDeclaration, getFieldIndex, getFieldValue, getLayerId, getNodeFieldIndices, getNumFields, getPrimaryType, getViewport, getViewportType, isPickable, removeLayerListener, sendRoute, setLayerId, setPickable, setValue, setValue, setValue, setViewportMethods inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
addNodeListener, checkNodeType, checkSecondaryType, checkSecondaryType, clearRemovedLayerIds, fireFieldChanged, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, getSecondaryType, getUserData, getVRMLNodeName, hasFieldChanged, isDEF, isSetupFinished, removeNodeListener, setDEF, setErrorReporter, 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, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
-
Constructor Details
-
OGLLayer
public OGLLayer()Initialise the time dependent node and it's fields that are held locally. -
OGLLayer
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- The node is not the same type
-
-
Method Details
-
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.
-
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.
-
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 transformation matrix only once per frame.- Specified by:
allEventsCompletein interfaceFrameStateListener- Overrides:
allEventsCompletein classAbstractNode
-
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 classBaseLayer
-
notifyExternProtoLoaded
Description copied from interface:VRMLNodeTypeNotify a node that an ExternProto has resolved. This will verify the objects type and add it to the render sceneGraph.- Specified by:
notifyExternProtoLoadedin interfaceVRMLNodeType- Overrides:
notifyExternProtoLoadedin classAbstractNode- Parameters:
index- The field indexnode- The node resolved
-
clearChildren
protected void clearChildren()Clear the child node list of all children - both VRML and OpenGL.- Overrides:
clearChildrenin classBaseLayer
-
addChildNode
Add a single child node to the list of available children. This auto matically deals with DEF/USE and adds links and branchgroups where appropriate. When nodes are null, we do not add them to the GL representation, only to the vfChildren list.- Overrides:
addChildNodein classBaseLayer- Parameters:
node- The node to view- Throws:
InvalidFieldValueException- This is a bindable node shared
-
removeChildNode
Remove the given node from this grouping node. If the node is not a child of this node, the request is silently ignored.- Overrides:
removeChildNodein classBaseLayer- Parameters:
node- The node to remove
-