Class OGLDISEntityManager
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.dis.BaseDISEntityManager
org.web3d.vrml.renderer.ogl.nodes.dis.OGLDISEntityManager
- All Implemented Interfaces:
VRMLNode
,FrameStateListener
,VRMLChildNodeType
,VRMLDISManagerNodeType
,VRMLDISNodeType
,VRMLExternalNodeType
,VRMLNetworkInterfaceNodeType
,VRMLNodeType
,VRMLSingleExternalNodeType
,VRMLWorldRootChildNodeType
,OGLVRMLNode
public class OGLDISEntityManager
extends BaseDISEntityManager
implements OGLVRMLNode, VRMLSingleExternalNodeType
OGL renderer implementation of a DISEntityManager node.
This node is purely informational within the scene graph. It does not have a renderable representation.
- Version:
- $Revision: 1.3 $
- Author:
- Alan Hudson, Vivian Gottesman
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.dis.BaseDISEntityManager
FIELD_ADDED_ENTITIES, FIELD_ADDRESS, FIELD_APPLICATION_ID, FIELD_MAPPING, FIELD_PORT, FIELD_REMOVED_ENTITIES, FIELD_SITE_ID, LAST_ENTITY_MANAGER_INDEX, nodeFactory, NUM_FIELDS, PROTOCOL, vfAddedEntities, vfAddress, vfApplicationID, vfMapping, vfPort, vfRemovedEntities, vfSiteID
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
Fields inherited from interface org.web3d.vrml.nodes.VRMLNetworkInterfaceNodeType
ROLE_INACTIVE, ROLE_MANAGER, ROLE_READER, ROLE_WRITER
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a default node with an empty info array any the title set to the empty string.Construct a new instance of this node based on the details from the given node. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a listener to this node instance for the content state changes.void
Add a listener to this node instance for URL changes.void
Notification that the rendering of the event model is complete and that rendering is about to begin.boolean
checkValidContentType
(String mimetype) Check to see if the given MIME type is one that would be supported as content coming into this node.void
entityArrived
(edu.nps.moves.dis7.pdus.EntityStatePdu espdu) A new entity has arrived.void
entityRemoved
(VRMLDISNodeType node) An entity has been removed from the simulation.int
Ask the state of the load of this node.org.j3d.aviatrix3d.SceneGraphObject
Get the OpenGL scene graph object representation of this node.int[]
Get the secondary types of this node.String[]
getUrl()
Get the list of URLs requested by this node.Get the world URL so set for this node.void
Remove a listener from this node instance for the content state changes.void
Remove a listener from this node instance for URL changes.void
setContent
(String mimetype, Object content) Set the content of this node to the given object.void
setLoadedURI
(String uri) Notify the node which URL was used to load the content.void
setLoadState
(int state) Set the load state of the node.void
Notification that the construction phase of this node has finished.void
Replace the existing set of URLs with this new set.void
setWorldUrl
(String url) Set the world URL so that any relative URLs may be corrected to the fully qualified version.Methods inherited from class org.web3d.vrml.renderer.common.nodes.dis.BaseDISEntityManager
addNetworkRoleListener, getAddress, getAppID, getAuthServer, getEntityID, getFieldDeclaration, getFieldIndex, getFieldValue, getMucRoom, getMucServer, getNodeFieldIndices, getNumFields, getPassword, getPort, getPrimaryType, getProtocol, getRole, getSiteID, getState, getUsername, packetArrived, removeNetworkRoleListener, sendRoute, setIsActive, setValue, setValue, setValue, setValue, valuesToWrite
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, 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
-
OGLDISEntityManager
public OGLDISEntityManager()Construct a default node with an empty info array any the title set to the empty string. -
OGLDISEntityManager
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()Description copied from interface:OGLVRMLNode
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 OpenGL representation.
-
getSecondaryType
public int[] getSecondaryType()Description copied from interface:VRMLNode
Get the secondary types of this node. Replaces the instanceof mechanism for use in switch statements. If there are no secondary types, it will return a zero-length array.- Specified by:
getSecondaryType
in interfaceVRMLNode
- Overrides:
getSecondaryType
in classAbstractNode
- Returns:
- The secondary type
-
setupFinished
public void setupFinished()Description copied from interface:VRMLNodeType
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. It is then responsible for calling its children's setupFinished.- Specified by:
setupFinished
in interfaceVRMLNodeType
- Overrides:
setupFinished
in classBaseDISEntityManager
-
allEventsComplete
public void allEventsComplete()Description copied from interface:FrameStateListener
Notification that the rendering of the event model is complete and that rendering is about to begin. If the node needs to update itself for this frame, it should do so now before the render pass takes place.- Specified by:
allEventsComplete
in interfaceFrameStateListener
- Overrides:
allEventsComplete
in classBaseDISEntityManager
-
entityRemoved
Description copied from interface:VRMLDISManagerNodeType
An entity has been removed from the simulation.- Specified by:
entityRemoved
in interfaceVRMLDISManagerNodeType
- Parameters:
node
- The entity being removed
-
entityArrived
public void entityArrived(edu.nps.moves.dis7.pdus.EntityStatePdu espdu) Description copied from interface:VRMLDISManagerNodeType
A new entity has arrived.- Specified by:
entityArrived
in interfaceVRMLDISManagerNodeType
- Parameters:
espdu
- The new entity.
-
getLoadState
public int getLoadState()Description copied from interface:VRMLSingleExternalNodeType
Ask the state of the load of this node. The value will be one of the constants defined above.- Specified by:
getLoadState
in interfaceVRMLSingleExternalNodeType
- Returns:
- The current load state of the node
-
setLoadState
public void setLoadState(int state) Description copied from interface:VRMLSingleExternalNodeType
Set the load state of the node. The value must be one of the constants defined above.- Specified by:
setLoadState
in interfaceVRMLSingleExternalNodeType
- Parameters:
state
- The new state of the node
-
setWorldUrl
Description copied from interface:VRMLExternalNodeType
Set the world URL so that any relative URLs may be corrected to the fully qualified version. Guaranteed to be non-null.- Specified by:
setWorldUrl
in interfaceVRMLExternalNodeType
- Parameters:
url
- The world URL.
-
getWorldUrl
Description copied from interface:VRMLExternalNodeType
Get the world URL so set for this node.- Specified by:
getWorldUrl
in interfaceVRMLExternalNodeType
- Returns:
- url The world URL.
-
setUrl
Description copied from interface:VRMLSingleExternalNodeType
Replace the existing set of URLs with this new set. If the array is null or zero length, it will clear the existing values.- Specified by:
setUrl
in interfaceVRMLSingleExternalNodeType
- Parameters:
newURL
- The list of new instances to usenumValid
- The number of valid values to copy from the array
-
getUrl
Description copied from interface:VRMLSingleExternalNodeType
Get the list of URLs requested by this node. If there are no URLs supplied in the text file then this will return a zero length array.- Specified by:
getUrl
in interfaceVRMLSingleExternalNodeType
- Returns:
- The list of URLs to attempt to load
-
checkValidContentType
Description copied from interface:VRMLSingleExternalNodeType
Check to see if the given MIME type is one that would be supported as content coming into this node.- Specified by:
checkValidContentType
in interfaceVRMLSingleExternalNodeType
- Parameters:
mimetype
- The type to check for- Returns:
- true if this is OK, false if not
-
setContent
Description copied from interface:VRMLSingleExternalNodeType
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
- Parameters:
mimetype
- The mime type of this object if knowncontent
- The content of the object- Throws:
IllegalArgumentException
-
setLoadedURI
Description copied from interface:VRMLSingleExternalNodeType
Notify the node which URL was used to load the content. It will be the complete URI with path, query and references parts. This method will be called before setContent.- Specified by:
setLoadedURI
in interfaceVRMLSingleExternalNodeType
- Parameters:
uri
- The URI used to load this content
-
addUrlListener
Description copied from interface:VRMLExternalNodeType
Add a listener to this node instance for URL changes. If the listener is already added or null the request is silently ignored.- Specified by:
addUrlListener
in interfaceVRMLExternalNodeType
- Parameters:
ul
- The listener instance to add
-
removeUrlListener
Description copied from interface:VRMLExternalNodeType
Remove a listener from this node instance for URL changes. If the listener is null or not registered, the request is silently ignored.- Specified by:
removeUrlListener
in interfaceVRMLExternalNodeType
- Parameters:
ul
- The listener to be removed
-
addContentStateListener
Description copied from interface:VRMLExternalNodeType
Add a listener to this node instance for the content state changes. If the listener is already added or null the request is silently ignored.- Specified by:
addContentStateListener
in interfaceVRMLExternalNodeType
- Parameters:
l
- The listener instance to add
-
removeContentStateListener
Description copied from interface:VRMLExternalNodeType
Remove a listener from this node instance for the content state changes. If the listener is null or not registered, the request is silently ignored.- Specified by:
removeContentStateListener
in interfaceVRMLExternalNodeType
- Parameters:
l
- The listener to be removed
-