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, vfSiteIDFields 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_LOADEDFields 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 TypeMethodDescriptionvoidAdd a listener to this node instance for the content state changes.voidAdd a listener to this node instance for URL changes.voidNotification that the rendering of the event model is complete and that rendering is about to begin.booleancheckValidContentType(String mimetype) Check to see if the given MIME type is one that would be supported as content coming into this node.voidentityArrived(edu.nps.moves.dis7.pdus.EntityStatePdu espdu) A new entity has arrived.voidentityRemoved(VRMLDISNodeType node) An entity has been removed from the simulation.intAsk the state of the load of this node.org.j3d.aviatrix3d.SceneGraphObjectGet 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.voidRemove a listener from this node instance for the content state changes.voidRemove a listener from this node instance for URL changes.voidsetContent(String mimetype, Object content) Set the content of this node to the given object.voidsetLoadedURI(String uri) Notify the node which URL was used to load the content.voidsetLoadState(int state) Set the load state of the node.voidNotification that the construction phase of this node has finished.voidReplace the existing set of URLs with this new set.voidsetWorldUrl(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, valuesToWriteMethods 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, 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
-
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:OGLVRMLNodeGet 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 OpenGL representation.
-
getSecondaryType
public int[] getSecondaryType()Description copied from interface:VRMLNodeGet 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:
getSecondaryTypein interfaceVRMLNode- Overrides:
getSecondaryTypein classAbstractNode- Returns:
- The secondary type
-
setupFinished
public void setupFinished()Description copied from interface:VRMLNodeTypeNotification 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:
setupFinishedin interfaceVRMLNodeType- Overrides:
setupFinishedin classBaseDISEntityManager
-
allEventsComplete
public void allEventsComplete()Description copied from interface:FrameStateListenerNotification 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:
allEventsCompletein interfaceFrameStateListener- Overrides:
allEventsCompletein classBaseDISEntityManager
-
entityRemoved
Description copied from interface:VRMLDISManagerNodeTypeAn entity has been removed from the simulation.- Specified by:
entityRemovedin interfaceVRMLDISManagerNodeType- Parameters:
node- The entity being removed
-
entityArrived
public void entityArrived(edu.nps.moves.dis7.pdus.EntityStatePdu espdu) Description copied from interface:VRMLDISManagerNodeTypeA new entity has arrived.- Specified by:
entityArrivedin interfaceVRMLDISManagerNodeType- Parameters:
espdu- The new entity.
-
getLoadState
public int getLoadState()Description copied from interface:VRMLSingleExternalNodeTypeAsk the state of the load of this node. The value will be one of the constants defined above.- Specified by:
getLoadStatein interfaceVRMLSingleExternalNodeType- Returns:
- The current load state of the node
-
setLoadState
public void setLoadState(int state) Description copied from interface:VRMLSingleExternalNodeTypeSet the load state of the node. The value must be one of the constants defined above.- Specified by:
setLoadStatein interfaceVRMLSingleExternalNodeType- Parameters:
state- The new state of the node
-
setWorldUrl
Description copied from interface:VRMLExternalNodeTypeSet the world URL so that any relative URLs may be corrected to the fully qualified version. Guaranteed to be non-null.- Specified by:
setWorldUrlin interfaceVRMLExternalNodeType- Parameters:
url- The world URL.
-
getWorldUrl
Description copied from interface:VRMLExternalNodeTypeGet the world URL so set for this node.- Specified by:
getWorldUrlin interfaceVRMLExternalNodeType- Returns:
- url The world URL.
-
setUrl
Description copied from interface:VRMLSingleExternalNodeTypeReplace 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:
setUrlin 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:VRMLSingleExternalNodeTypeGet 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:
getUrlin interfaceVRMLSingleExternalNodeType- Returns:
- The list of URLs to attempt to load
-
checkValidContentType
Description copied from interface:VRMLSingleExternalNodeTypeCheck to see if the given MIME type is one that would be supported as content coming into this node.- Specified by:
checkValidContentTypein interfaceVRMLSingleExternalNodeType- Parameters:
mimetype- The type to check for- Returns:
- true if this is OK, false if not
-
setContent
Description copied from interface:VRMLSingleExternalNodeTypeSet 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- Parameters:
mimetype- The mime type of this object if knowncontent- The content of the object- Throws:
IllegalArgumentException
-
setLoadedURI
Description copied from interface:VRMLSingleExternalNodeTypeNotify 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:
setLoadedURIin interfaceVRMLSingleExternalNodeType- Parameters:
uri- The URI used to load this content
-
addUrlListener
Description copied from interface:VRMLExternalNodeTypeAdd a listener to this node instance for URL changes. If the listener is already added or null the request is silently ignored.- Specified by:
addUrlListenerin interfaceVRMLExternalNodeType- Parameters:
ul- The listener instance to add
-
removeUrlListener
Description copied from interface:VRMLExternalNodeTypeRemove a listener from this node instance for URL changes. If the listener is null or not registered, the request is silently ignored.- Specified by:
removeUrlListenerin interfaceVRMLExternalNodeType- Parameters:
ul- The listener to be removed
-
addContentStateListener
Description copied from interface:VRMLExternalNodeTypeAdd 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:
addContentStateListenerin interfaceVRMLExternalNodeType- Parameters:
l- The listener instance to add
-
removeContentStateListener
Description copied from interface:VRMLExternalNodeTypeRemove 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:
removeContentStateListenerin interfaceVRMLExternalNodeType- Parameters:
l- The listener to be removed
-