Class OGLScreenMarker
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.marker.BaseScreenMarker
org.web3d.vrml.renderer.ogl.nodes.marker.OGLScreenMarker
- All Implemented Interfaces:
org.j3d.aviatrix3d.NodeUpdateListener,VRMLNode,FrameStateListener,VRMLExternalNodeType,VRMLNodeType,VRMLSingleExternalNodeType,VRMLWorldRootChildNodeType,AreaListener,OGLAreaListener,OGLVRMLNode
public class OGLScreenMarker
extends BaseScreenMarker
implements OGLVRMLNode, OGLAreaListener, org.j3d.aviatrix3d.NodeUpdateListener
OpenGL-renderer implementation of a ScreenMarker node.
- Version:
- $Revision: 1.8 $
- Author:
- Rex Melton
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.marker.BaseScreenMarker
BAD_NODE_MSG, BAD_PROTO_MSG, FIELD_ENABLED, FIELD_HEIGHT, FIELD_ICON_URL, FIELD_REPRESENTS, FIELD_WIDTH, LAST_SCREENMARKER_INDEX, loadedURI, loadState, NUM_FIELDS, pRepresents, vfEnabled, vfHeight, vfRepresents, vfURL, vfWidthFields 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.OGLScreenMarker(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.voidareaEntry(javax.vecmath.Point3f position, javax.vecmath.Vector3f orientation, javax.vecmath.Matrix4f vpMatrix, javax.vecmath.Matrix4f localPosition) Invoked when the user enters an area.voidareaExit()Invoked when the tracked object exits then area.org.j3d.aviatrix3d.SceneGraphObjectGet the OpenGL scene graph object representation of this node.int[]Get the secondary type of this node.voidsetContent(String mimetype, Object content) Set the content of this node to the given object.protected voidsetEnabled(boolean enabled) Set the sensor enabled or disabled.protected voidsetHeight(float height) Set the image height scale.voidsetRepresents(VRMLNodeType node) Set the node that should be used for the represents field.voidNotification that the construction phase of this node has finished.protected voidsetWidth(float width) Set the image width scale.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.voiduserPositionChanged(javax.vecmath.Point3f position, javax.vecmath.Vector3f orientation, javax.vecmath.Matrix4f vpMatrix, javax.vecmath.Matrix4f localPosition) Notification that the user is still in the area, but that the viewer reference point has changed.Methods inherited from class org.web3d.vrml.renderer.common.nodes.marker.BaseScreenMarker
addContentStateListener, addUrlListener, checkValidContentType, fireContentStateChanged, fireUrlChanged, getFieldDeclaration, getFieldIndex, getFieldValue, getLoadState, getNodeFieldIndices, getNumFields, getPrimaryType, getUrl, getWorldUrl, removeContentStateListener, removeUrlListener, sendRoute, setLoadedURI, setLoadState, setUrl, setValue, setValue, setValue, setValue, setValue, 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, 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.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, 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
-
OGLScreenMarker
public OGLScreenMarker()Construct a default instance of this node. -
OGLScreenMarker
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 a Collision node
-
-
Method Details
-
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
-
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.- Specified by:
getSceneGraphObjectin interfaceOGLVRMLNode- Returns:
- The OGL representation.
-
getSecondaryType
public int[] getSecondaryType()Get the secondary type of this node. Replaces the instanceof mechanism for use in switch statements.- Specified by:
getSecondaryTypein interfaceVRMLNode- Overrides:
getSecondaryTypein classAbstractNode- Returns:
- The secondary type
-
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 classBaseScreenMarker
-
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.
-
areaEntry
public void areaEntry(javax.vecmath.Point3f position, javax.vecmath.Vector3f orientation, javax.vecmath.Matrix4f vpMatrix, javax.vecmath.Matrix4f localPosition) Invoked when the user enters an area.- Specified by:
areaEntryin interfaceOGLAreaListener- Parameters:
position- The new position of the userorientation- The orientation of the user therevpMatrix-localPosition- The vworld transform object for the class that implemented this listener
-
userPositionChanged
public void userPositionChanged(javax.vecmath.Point3f position, javax.vecmath.Vector3f orientation, javax.vecmath.Matrix4f vpMatrix, javax.vecmath.Matrix4f localPosition) Notification that the user is still in the area, but that the viewer reference point has changed.- Specified by:
userPositionChangedin interfaceOGLAreaListener- Parameters:
position- The new position of the userorientation- The orientation of the uservpMatrix-localPosition- The vworld transform object for the class that implemented this listener
-
areaExit
public void areaExit()Invoked when the tracked object exits then area.- Specified by:
areaExitin interfaceOGLAreaListener
-
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 classBaseScreenMarker- Parameters:
mimetype- The mime type of this object if knowncontent- The content of the object- Throws:
IllegalArgumentException- The content object is not supported
-
setEnabled
protected void setEnabled(boolean enabled) Set the sensor enabled or disabled.- Overrides:
setEnabledin classBaseScreenMarker- Parameters:
enabled- The new enabled value
-
setWidth
protected void setWidth(float width) Set the image width scale.- Overrides:
setWidthin classBaseScreenMarker- Parameters:
width- The image width scale.
-
setHeight
protected void setHeight(float height) Set the image height scale.- Overrides:
setHeightin classBaseScreenMarker- Parameters:
height- The image height scale.
-
setRepresents
Set the node that should be used for the represents field. Setting a value of null will clear the current represents value.- Overrides:
setRepresentsin classBaseScreenMarker- Parameters:
node- The new node instance to be used.- Throws:
InvalidFieldValueException- The node does not match the required type.
-