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, vfWidth
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
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 TypeMethodDescriptionvoid
Notification that the rendering of the event model is complete and that rendering is about to begin.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.void
areaExit()
Invoked when the tracked object exits then area.org.j3d.aviatrix3d.SceneGraphObject
Get the OpenGL scene graph object representation of this node.int[]
Get the secondary type of this node.void
setContent
(String mimetype, Object content) Set the content of this node to the given object.protected void
setEnabled
(boolean enabled) Set the sensor enabled or disabled.protected void
setHeight
(float height) Set the image height scale.void
setRepresents
(VRMLNodeType node) Set the node that should be used for the represents field.void
Notification that the construction phase of this node has finished.protected void
setWidth
(float width) Set the image width scale.void
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.void
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.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.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, setWorldUrl
Methods 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, 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.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, 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, 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:
allEventsComplete
in interfaceFrameStateListener
- Overrides:
allEventsComplete
in 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:
getSceneGraphObject
in 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:
getSecondaryType
in interfaceVRMLNode
- Overrides:
getSecondaryType
in 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:
setupFinished
in interfaceVRMLNodeType
- Overrides:
setupFinished
in classBaseScreenMarker
-
updateNodeBoundsChanges
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.- Specified by:
updateNodeBoundsChanges
in 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:
updateNodeDataChanges
in 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:
areaEntry
in 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:
userPositionChanged
in 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:
areaExit
in 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:
setContent
in interfaceVRMLSingleExternalNodeType
- Overrides:
setContent
in 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:
setEnabled
in classBaseScreenMarker
- Parameters:
enabled
- The new enabled value
-
setWidth
protected void setWidth(float width) Set the image width scale.- Overrides:
setWidth
in classBaseScreenMarker
- Parameters:
width
- The image width scale.
-
setHeight
protected void setHeight(float height) Set the image height scale.- Overrides:
setHeight
in 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:
setRepresents
in classBaseScreenMarker
- Parameters:
node
- The new node instance to be used.- Throws:
InvalidFieldValueException
- The node does not match the required type.
-