Class OGLTransform
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.BaseGroupingNode
org.web3d.vrml.renderer.common.nodes.group.BaseTransform
org.web3d.vrml.renderer.ogl.nodes.group.OGLTransform
- All Implemented Interfaces:
org.j3d.aviatrix3d.NodeUpdateListener,VRMLNode,FrameStateListener,VRMLBoundedNodeType,VRMLChildNodeType,VRMLGroupingNodeType,VRMLNodeType,VRMLWorldRootChildNodeType,OGLPickableTargetNodeType,OGLTransformNodeType,OGLVRMLNode
public class OGLTransform
extends BaseTransform
implements OGLVRMLNode, OGLPickableTargetNodeType, org.j3d.aviatrix3d.NodeUpdateListener, OGLTransformNodeType
OpenGL implementation of a Transform node.
- Version:
- $Revision: 1.32 $
- Author:
- Justin Couch
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<VRMLPointingDeviceSensorNodeType> A sensor node if we have one set.Fields inherited from class org.web3d.vrml.renderer.common.nodes.group.BaseTransform
FIELD_CENTER, FIELD_ROTATION, FIELD_SCALE, FIELD_SCALE_ORIENTATION, FIELD_TRANSLATION, LAST_TRANSFORM_INDEX, NUM_FIELDS, tmatrix, vfCenter, vfRotation, vfScale, vfScaleOrientation, vfTranslationFields inherited from class org.web3d.vrml.renderer.common.nodes.BaseGroupingNode
childCount, FIELD_ADDCHILDREN, FIELD_BBOX_CENTER, FIELD_BBOX_DISPLAY, FIELD_BBOX_SIZE, FIELD_CHILDREN, FIELD_REMOVECHILDREN, FIELD_VISIBLE, hasBindables, LAST_GROUP_INDEX, shareCount, USE_BIND_MSG, vfBboxCenter, vfBboxDisplay, vfBboxSize, vfChildren, vfVisibleFields 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
ConstructorsConstructorDescriptionConstruct a default instance of this node.OGLTransform(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 in the VRML node.org.j3d.aviatrix3d.picking.PickableObjectFetch the object that this target will pick against.org.j3d.aviatrix3d.SceneGraphObjectGet the OpenGL scene graph object representation of this node.javax.vecmath.Matrix4fGet the transform matrix for 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.voidSet the flag convertor.voidNotification that the construction phase of this node has finished.protected voidCalculate transforms needed to handle VRML semantics and place the results in the matrix variable of this class.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.group.BaseTransform
getCenter, getFieldDeclaration, getFieldIndex, getFieldValue, getNodeFieldIndices, getNumFields, getRotation, getScale, getScaleOrientation, getTranslation, sendRoute, setCenter, setRotation, setScale, setScaleOrientation, setTranslation, setValueMethods inherited from class org.web3d.vrml.renderer.common.nodes.BaseGroupingNode
addChild, containsBindableNodes, copy, getBboxCenter, getBboxDisplay, getBboxSize, getChildren, getChildrenSize, getPrimaryType, getVisible, isShared, setBboxCenter, setBboxDisplay, setBboxSize, setChildren, setChildren, setDEF, setShared, setValue, setValue, setValue, setVisible, updateRefCountMethods 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, setErrorReporter, setFrameStateManager, setMetadataObject, setUserData, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setVersion, throwInitOnlyWriteException, throwInputOnlyWriteException, throwInvalidNodeException, throwInvalidProtoException, throwOutputOnlyWriteException, 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
-
Field Details
-
sensorList
A sensor node if we have one set. Only valid during construction
-
-
Constructor Details
-
OGLTransform
public OGLTransform()Construct a default instance of this node. The defaults are set by the VRML specification. -
OGLTransform
Construct a new instance of this node based on the details from the given node. If the node is not a group node, an exception will be thrown. It does not copy the children nodes, just this node.- Parameters:
node- The node to copy- Throws:
IllegalArgumentException- The node is not a Group node
-
-
Method Details
-
setTypeConvertor
Set the flag convertor. Ignored for this node.- Specified by:
setTypeConvertorin interfaceOGLPickableTargetNodeType- Parameters:
conv- The convertor instance to use, or null
-
getPickableObject
public org.j3d.aviatrix3d.picking.PickableObject getPickableObject()Fetch the object that this target will pick against.- Specified by:
getPickableObjectin interfaceOGLPickableTargetNodeType- Returns:
- The valid branchgroup to use
-
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. If the derived class needs to propagate the changes then it should override the updateMatrix() method or this and make sure this method is called first.- Specified by:
allEventsCompletein interfaceFrameStateListener- Overrides:
allEventsCompletein classBaseTransform
-
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.
-
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 classBaseGroupingNode
-
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
-
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.
-
getTransform
public javax.vecmath.Matrix4f getTransform()Get the transform matrix for this node. A reference is ok as the users of this method will not modify the matrix.- Specified by:
getTransformin interfaceOGLTransformNodeType- Returns:
- The matrix.
-
clearChildren
protected void clearChildren()Description copied from class:BaseGroupingNodeClear the child node list of all children in the VRML node. Override to provide renderer-specific behaviour, but remember to also call this implementation too.- Overrides:
clearChildrenin classBaseGroupingNode
-
addChildNode
Description copied from class:BaseGroupingNodeAdd a single child node to the list of available children. Override to provide renderer-specific behaviour, but remember to also call this implementation too.- Overrides:
addChildNodein classBaseGroupingNode- Parameters:
node- The node to add- Throws:
InvalidFieldValueException- This is a bindable node shared
-
removeChildNode
Description copied from class:BaseGroupingNodeRemove the given node from this grouping node. If the node is not a child of this node, the request is silently ignored.- Overrides:
removeChildNodein classBaseGroupingNode- Parameters:
node- The node to remove
-
updateMatrix
protected void updateMatrix()Description copied from class:BaseTransformCalculate transforms needed to handle VRML semantics and place the results in the matrix variable of this class. formula: T x C x R x SR x S x -SR x -C- Overrides:
updateMatrixin classBaseTransform
-