mil.navy.nps.dis
Class EntityStatePdu

java.lang.Object
  extended bymil.navy.nps.dis.PduElement
      extended bymil.navy.nps.dis.ProtocolDataUnit
          extended bymil.navy.nps.dis.EntityStatePdu
All Implemented Interfaces:
java.lang.Cloneable, SerializationInterface

public class EntityStatePdu
extends ProtocolDataUnit

PDU which passes all physics information for an entity.

Version:
1.0
Author:
Don McGregor (http://www.npsnet.org/~mcgredo)
Location:
Web: http://www.web3d.org/WorkingGroups/vrtp/mil/navy/nps/dis/EntityStatePdu.java
or locally: ~/mil/navy/nps/dis/EntityStatePdu.java
Hierarchy Diagram:
Summary:
This Class implements an Entity State PDU which in turn stores information about an entity in a DIS format, such as velocity, orientation, dead reckoning parameter etc.
Explanation:
The entity state PDU communicates information about an entity, such as its location, its appearance, and how it appears to others. This is a subclass of the abstract ProtocolDataUnit class, and overrides the serialization, deSerialization, and clone methods. ProtocolDataUnit encompasses the PDU Header information, such as the protocol version, PDU Type, etc.

This is pretty simple stuff. You can really go to sleep writing it. It screams out for automation and an algorithm to do all this automatically. Can you say dial-a-protocol?

Note:
We have flattened the Dead Reckoning record. There are some additionnal easy to use accessor methods to modify in a simple way, fields that are nested in records and that are frequently accessed. Note that we do not define an Entity Marking Record. It is replaced by CharacterSet and by Marking. At last, we have an articulationParameter list whose accessor methods are addArticulationParameter() and articulationParameterCount().
History:
17Oct96 /Don McGregor /New
25Oct96 /Don McGregor /changed full-fledged Float objects to mere float instance variables
06Mar97 /Don McGregor /javadoc changes, swapped in entityType and altEntityType in place of individual fields
16Apr97 /Don McGregor /PrintStream passed to printValues
12Aug97 /Don McGregor /elaborated printValues 19Aug97 /Don McGregor /Made "multicast" terminology consistent
8Dec97 /Ronan Fauglas /changes for documentation templates + complements in documentation
11Dec97 /Ronan Fauglas /changed access methods: thisVariable() --> getThisVariable()
27Nov99 /David W. Laflam /changed access methods: Updated the Java Docs
References:
DIS Data Dictionary :Entity State PDU
DIS-Java-VRML Working Group: http://www.web3d.org/WorkingGroups/vrtp/dis-java-vrml/
DIS specification : IEEE 1278.1, Section 5.4.3.1, 4.4.2, 4.4.5
See Also:
ProtocolDataUnit, PduElement, SerializationInterface, CollisionPdu

Field Summary
protected  EntityType alternativeEntityType
          Alternate Entity Type - This field shall identify the entity type to be displayed by members of forces other than that of the issuing entity.
protected  java.util.Vector articulationParameters
          The number of articulation parameters and the Articulation Paramater record are being wrapped in Vectors.
protected  UnsignedInt capabilities
          A collection of boolean fields which describe the capabilities of the Entity.
protected  UnsignedByte characterSet
          This field represents the Character set used in representing the Entity Marking Record.
protected  UnsignedByte deadReckoningAlgorithm
          Dead Reckoning Algorithm - This field shall specify the dead reckoning algorithm in use by the issuing entity.
protected  byte[] deadReckoningParameters
          Other Parameters - This field shall specify other required dead reckoning parameters to be determined.
static boolean DEBUG
          Debugging flag; when set true, turns on verbose diagnostic, statements that prints in the java console.
protected  AngularVelocity entityAngularVelocity
          Entity Angular Velocity - This field shall specify an entity's angular velocity.
protected  UnsignedInt entityAppearance
          Entity Appearance - This field shall specify the dynamic changes to the entity's appearance attributes.
protected  EntityID entityID
          Entity Identification - This field shall identify the entity issuing the PDU.
protected  LinearAcceleration entityLinearAcceleration
          Entity Linear Acceleration - This field shall specify an entity's linear acceleration.
protected  LinearVelocity entityLinearVelocity
          Entity Linear Velocity - This field shall specify an entity's linear velocity.
protected  WorldCoordinate entityLocation
          Entity Location - This field shall specify an entity's physical location in the simulated world.
protected  EulerAngle entityOrientation
          Entity Orientation - This field shall specify an entity's orientation.
protected  EntityType entityType
          Entity Type - This field shall identify the entity type to be displayed by members of the same force as the issuing entity.
protected static EntityStatePdu exemplar
          An "examplar" object, which is filled out to the state that is needed most of the time.
protected  UnsignedByte forceID
          Force Identification - This field shall identify the force to which the issuing entity belongs.
protected  java.lang.String marking
          This is a String used to designate the Entity Marking.
static int sizeOf
          Constant value--size of an Entity State PDU without header.
 
Fields inherited from class mil.navy.nps.dis.ProtocolDataUnit
exerciseID, pduType, protocolFamily, protocolVersion, timeReceived, timestamp
 
Constructor Summary
EntityStatePdu()
          Default constructor--fills with zeros for all values.
 
Method Summary
 void addArticulationParameter(ArticulationParameter pParameter)
          Inserts a new articulation parameter in the list.
 UnsignedByte articulationParameterCount()
          Returns the number of articulation parameter in this Entity State PDU,accessor method.
 java.lang.Object clone()
          Returns a clone of the Entity State PDU .
protected static void debug(java.lang.String pDiagnostic)
          Debugging output.
 void deSerialize(java.io.DataInputStream dataInputStream)
          Deserialize our data from the input stream.
 EntityType getAlternativeEntityType()
          Gets the Entity Type's Alternative Type data field, whcih is a clone of the Enity ,accessor method.
 UnsignedByte getAlternativeEntityTypeCategory()
          Gets the Entity Type's Alternative Type Category, which is a clone of the Enity ,accessor method.
 UnsignedShort getAlternativeEntityTypeCountry()
          Gets the Entity Type's Alternative Type Country, which is a clone of the Enity ,accessor method.
 UnsignedByte getAlternativeEntityTypeDomain()
          Gets the Entity Type's Alternative Type Domain, which is a clone of the Enity ,accessor method.
 UnsignedByte getAlternativeEntityTypeExtra()
          Sets the Entity Type's Alternative Type Extra,accessor method.
 UnsignedByte getAlternativeEntityTypeKind()
          Gets the Entity Type's Alternative Type data field, whcih is a clone of the Enity ,accessor method.
 UnsignedByte getAlternativeEntityTypeSpecific()
          Gets the Entity Type's Alternative Type Specific,accessor method.
 UnsignedByte getAlternativeEntityTypeSubcategory()
          Gets the Entity Type's Alternative Type SubCategory, which is a clone of the Enity ,accessor method.
 ArticulationParameter getArticulationParameterAt(int pIdx)
          Returns the articulation parameter pointed at the given index.
 UnsignedInt getCapabilities()
           
 UnsignedByte getCharacterSet()
           
 UnsignedByte getDeadReckoningAlgorithm()
           
 byte[] getDeadReckoningParameters()
           
 AngularVelocity getEntityAngularVelocity()
           
 float getEntityAngularVelocityX()
           
 float getEntityAngularVelocityY()
           
 float getEntityAngularVelocityZ()
           
 UnsignedInt getEntityAppearance()
           
 EntityID getEntityID()
          This is the string value of Entity State Pdu,accessor method This field shall identify the entity issuing the PDU, and shall be represented by the PDU Header Record (see 5.2.24)
 LinearAcceleration getEntityLinearAcceleration()
           
 float getEntityLinearAccelerationX()
           
 float getEntityLinearAccelerationY()
           
 float getEntityLinearAccelerationZ()
           
 LinearVelocity getEntityLinearVelocity()
          Gets the Entity Type's Linear Velocity in meters per sec,accessor method.
 float getEntityLinearVelocityX()
          Gets the Entity Type's Linear Velocity in meters per sec in the X Direction ,accessor method.
 float getEntityLinearVelocityY()
          Gets the Entity Type's Linear Velocity in meters per sec in the Y Direction ,accessor method.
 float getEntityLinearVelocityZ()
          Gets the Entity Type's Linear Velocity in meters per sec in the Z Direction ,accessor method.
 WorldCoordinate getEntityLocation()
          Gets the Entity Type's location in World Cordinates ,accessor method.
 double getEntityLocationX()
          Gets the Entity Type'slocation in World Cordinates in the X direction ,accessor method.
 double getEntityLocationY()
          Gets the Entity Type'slocation in World Cordinates in the Y direction ,accessor method.
 double getEntityLocationZ()
          Gets the Entity Type'slocation in World Cordinates in the Z direction ,accessor method.
 EulerAngle getEntityOrientation()
          Gets the Entity Type's Orientation as a EulerAngle ,accessor method.
 float getEntityOrientationPhi()
           
 float getEntityOrientationPsi()
          Gets the Entity Type's Orientation as a EulerAngle (Psi ,accessor method.
 float getEntityOrientationTheta()
          Gets the Entity Type's Orientation as a EulerAngle (Theta ,accessor method.
 EntityType getEntityType()
          Gets the Entity State PDU type,accessor method.
 UnsignedByte getEntityTypeCategory()
          Gets the Entity Type's Category ,accessor method.
 UnsignedShort getEntityTypeCountry()
          Gets the Entity Type's Country of origin ,accessor method.
 UnsignedByte getEntityTypeDomain()
          Gets the Entity State PDU type of Domain ,accessor method.
 UnsignedByte getEntityTypeExtra()
          Gets the Entity Type's Extra data field ,accessor method.
 UnsignedByte getEntityTypeKind()
          Gets the Entity State PDU type,accessor method.
 UnsignedByte getEntityTypeSpecific()
          Gets the Entity Type's Specific Category of origin ,accessor method.
 UnsignedByte getEntityTypeSubcategory()
          Sets the Entity Type's Sub Category of origin ,accessor method.
static EntityStatePdu getExemplar()
          This gets the exemplar,accessor method
 UnsignedByte getForceID()
          Get ForceID of UnsignedByte ,accessor method.
 java.lang.String getMarking()
           
 int length()
          Calculates the length of the Entity State PDU on the fly.
 java.lang.String pduName()
          This is the string value of Entity State Pdu
 void printValues(int indentLevel, java.io.PrintStream printStream)
          This will print the values of Entity State Pdu to a stream
 void serialize(java.io.DataOutputStream outputStream)
          Serialize our data out to the stream.
 void setAlternativeEntityCountry(int pEntityCountry)
          Sets the Entity Type's Alternative Type Country, which is a clone of the Enity ,accessor method.
 void setAlternativeEntityDomain(int pEntityDomain)
          Sets the Entity Type's Alternative Type Domain, which is a clone of the Enity ,accessor method.
 void setAlternativeEntityType(EntityType pNewAltEntity)
          Sets the Entity Type's Alternative Type data field, whcih is a clone of the Enity ,accessor method.
 void setAlternativeEntityTypeCategory(int pEntityCategory)
          Sets the Entity Type's Alternative Type Category, which is a clone of the Enity ,accessor method.
 void setAlternativeEntityTypeCategory(UnsignedByte pEntityCategory)
          Sets the Entity Type's Alternative Type Category, which is a clone of the Enity ,accessor method.
 void setAlternativeEntityTypeCountry(UnsignedShort pEntityCountry)
          Sets the Entity Type's Alternative Type Country, which is a clone of the Enity ,accessor method.
 void setAlternativeEntityTypeDomain(UnsignedByte pEntityDomain)
          Sets the Entity Type's Alternative Type Domain, which is a clone of the Enity ,accessor method.
 void setAlternativeEntityTypeExtra(int pEntityExtra)
          Sets the Entity Type's Alternative Type Extra,accessor method.
 void setAlternativeEntityTypeExtra(UnsignedByte pEntityExtra)
          Sets the Entity Type's Alternative Type Extra,accessor method.
 void setAlternativeEntityTypeKind(int pEntityKind)
          Sets the Entity Type's Alternative Kind, which is the kind of Enity ,accessor method.
 void setAlternativeEntityTypeKind(UnsignedByte pEntityKind)
          Sets the Entity Type's Alternative Kind, whcih is the kind of Enity ,accessor method.
 void setAlternativeEntityTypeSpecific(int pEntitySpecific)
          Sets the Entity Type's Alternative Type Specific,accessor method.
 void setAlternativeEntityTypeSpecific(UnsignedByte pEntitySpecific)
          Sets the Entity Type's Alternative Type Specific,accessor method.
 void setAlternativeEntityTypeSubcategory(int pEntitySubcategory)
          Sets the Entity Type's Alternative Type SubCategory ,accessor method.
 void setAlternativeEntityTypeSubcategory(UnsignedByte pEntitySubcategory)
          Sets the Entity Type's Alternative Type SubCategory ,accessor method.
 void setCapabilities(int pCapabilities)
           
 void setCapabilities(UnsignedInt pCapabilities)
           
 void setCharacterSet(int pCharacterSet)
           
 void setCharacterSet(UnsignedByte pCharacterSet)
           
 void setDeadReckoningAlgorithm(int pDeadReckoningAlgorithm)
           
 void setDeadReckoningAlgorithm(UnsignedByte pDeadReckoningAlgorithm)
           
 void setDeadReckoningParameters(byte[] pDeadReckoningParameters)
           
 void setEntityAngularVelocity(AngularVelocity pAngV)
           
 void setEntityAngularVelocity(float pX, float pY, float pZ)
           
 void setEntityAngularVelocityX(float pEntityAngularVelocity)
           
 void setEntityAngularVelocityY(float pEntityAngularVelocity)
           
 void setEntityAngularVelocityZ(float pEntityAngularVelocity)
           
 void setEntityAppearance(int pEntityAppearance)
           
 void setEntityAppearance(UnsignedInt pEntityAppearance)
           
 void setEntityDomain(int pEntityDomain)
          Sets the Entity State PDU type of Domain ,accessor method.
 void setEntityID(EntityID pEntityID)
          Sets EntityID of an EntityID,accessor method.
 void setEntityID(short pSiteID, short pApplicationID, short pEntityID)
          Sets setEntityID(short pSiteID, short pApplicationID, short pEntityID),accessor method.
 void setEntityLinearAcceleration(float pX, float pY, float pZ)
           
 void setEntityLinearAcceleration(LinearAcceleration pAcceleration)
           
 void setEntityLinearAccelerationX(float pEntityAcceleration)
           
 void setEntityLinearAccelerationY(float pEntityAcceleration)
           
 void setEntityLinearAccelerationZ(float pEntityAcceleration)
           
 void setEntityLinearVelocity(LinearVelocity pVelocity)
          Sets the Entity Type's Linear Velocity in meters per sec,accessor method.
 void setEntityLinearVelocityX(float pVelocityX)
          Sets the Entity Type's Linear Velocity in meters per sec in the X Direction ,accessor method.
 void setEntityLinearVelocityY(float pVelocityY)
          Sets the Entity Type's Linear Velocity in meters per sec in the Y Direction ,accessor method.
 void setEntityLinearVelocityZ(float pVelocityZ)
          Sets the Entity Type's Linear Velocity in meters per sec in the Y Direction ,accessor method.
 void setEntityLocation(WorldCoordinate pLocation)
          Sets the Entity Type's location in World Cordinates ,accessor method.
 void setEntityLocationX(double pLocationX)
          Sets the Entity Type'slocation in World Cordinates in the X direction ,accessor method.
 void setEntityLocationY(double pLocationY)
          Sets the Entity Type'slocation in World Cordinates in the Y direction ,accessor method.
 void setEntityLocationZ(double pLocationZ)
          Sets the Entity Type'slocation in World Cordinates in the Z direction ,accessor method.
 void setEntityOrientation(EulerAngle pNewOrientation)
          Sets the Entity Type'slocation in World Cordinates in the Z direction ,accessor method.
 void setEntityOrientationPhi(float pPhi)
           
 void setEntityOrientationPsi(float pPsi)
          Sets the Entity Type'slocation in World Cordinates in the Z direction ,accessor method.
 void setEntityOrientationTheta(float pTheta)
           
 void setEntityType(EntityType pEntityType)
          Sets the Entity State PDU type,accessor method.
 void setEntityTypeCategory(int pEntityCategory)
          Sets the Entity Type's Category of origin ,accessor method.
 void setEntityTypeCategory(UnsignedByte pEntityCategory)
          Sets the Entity Type's Category of origin ,accessor method.
 void setEntityTypeCountry(int pEntityCountry)
          Sets the Entity Type's Country of origin ,accessor method.
 void setEntityTypeCountry(UnsignedShort pEntityCountry)
          Sets the Entity Type's Country of origin ,accessor method.
 void setEntityTypeDomain(UnsignedByte pEntityDomain)
          Sets the Entity State PDU type of Domain ,accessor method.
 void setEntityTypeExtra(int pEntityExtra)
          Sets the Entity Type's Extra data field ,accessor method.
 void setEntityTypeExtra(UnsignedByte pEntityExtra)
          Sets the Entity Type's Extra data field ,accessor method.
 void setEntityTypeKind(int pEntityKind)
          Sets the Entity State PDU type of a Int accessor method.
 void setEntityTypeKind(UnsignedByte pEntityKind)
          Sets the Entity State PDU type of a UnsignedByte ,accessor method.
 void setEntityTypeSpecific(int pEntitySpecific)
          Sets the Entity Type's Specific ,accessor method.
 void setEntityTypeSpecific(UnsignedByte pEntitySpecific)
          Gets the Entity Type's Specific ,accessor method.
 void setEntityTypeSubcategory(int pEntitySubcategory)
          Sets the Entity Type's Sub Category of origin ,accessor method.
 void setEntityTypeSubcategory(UnsignedByte pEntitySubcategory)
          Sets the Entity Type's Sub Category of origin ,accessor method.
static void setExemplar(EntityStatePdu newExemplar)
          This sets the exemplar,accessor method
 void setForceID(int pForceID)
          Set the ForceID with new UnsignedByte,accessor method.
 void setForceID(UnsignedByte pForceID)
          Set the ForceID with UnsignedByte,accessor method.
 void setMarking(java.lang.String pMarking)
           
 java.lang.String toString()
           
protected static void trace(java.lang.String pDiagnostic)
          Guaranteed debugging output.
 
Methods inherited from class mil.navy.nps.dis.ProtocolDataUnit
byteArrayToPdu, datagramToPdu, getExerciseID, getPaddingOfLength, getPduType, getProtocolFamily, getProtocolVersion, getRtpHeaderEnabled, getTimeReceived, getTimestamp, getVRMLTimestamp, makeTimestampCurrent, setExerciseID, setExerciseID, setPduType, setPduType, setProtocolFamily, setProtocolFamily, setProtocolVersion, setProtocolVersion, setRtpHeaderEnabled, setSimulationStartTime, setTimeReceived, setTimestamp, setTimestamp, stampTimeReceived
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEBUG

public static final boolean DEBUG
Debugging flag; when set true, turns on verbose diagnostic, statements that prints in the java console. Default is false.

See Also:
Constant Field Values

entityID

protected EntityID entityID
Entity Identification - This field shall identify the entity issuing the PDU.


forceID

protected UnsignedByte forceID
Force Identification - This field shall identify the force to which the issuing entity belongs.
Value:
Enumeration, see references below for further information.
References:
DIS Data Dictionary: Force ID Field
See Section 4 in Document IST-CR-93-19


entityType

protected EntityType entityType
Entity Type - This field shall identify the entity type to be displayed by members of the same force as the issuing entity.
References:
See Section 6 in Document IST-CR-93-19


alternativeEntityType

protected EntityType alternativeEntityType
Alternate Entity Type - This field shall identify the entity type to be displayed by members of forces other than that of the issuing entity.
References:
See Section 4 in Document IST-CR-93-19.


entityLinearVelocity

protected LinearVelocity entityLinearVelocity
Entity Linear Velocity - This field shall specify an entity's linear velocity. The coordinate system for an entities' linear velocity depends on the dead reckoning algorithm used.


entityLocation

protected WorldCoordinate entityLocation
Entity Location - This field shall specify an entity's physical location in the simulated world.


entityOrientation

protected EulerAngle entityOrientation
Entity Orientation - This field shall specify an entity's orientation.


entityAppearance

protected UnsignedInt entityAppearance
Entity Appearance - This field shall specify the dynamic changes to the entity's appearance attributes.
References:
DIS Data Dictionary: Entity Appearance Record
See Section 3 in Document IST-CR-93-19.
DIS specification : IEEE 1278.1, Section 5.3.12


deadReckoningAlgorithm

protected UnsignedByte deadReckoningAlgorithm
Dead Reckoning Algorithm - This field shall specify the dead reckoning algorithm in use by the issuing entity.
Value:
Enumeration; see references below.
References:
See Section 7 in Document IST-CR-93-19.
DIS Data Dictionary: Dead Reckoning Parameter Record, Dead Reckoning Algorithm Field.


deadReckoningParameters

protected byte[] deadReckoningParameters
Other Parameters - This field shall specify other required dead reckoning parameters to be determined. This field shall consist of 120 bits.
Note:
we don't respect our syntax
References:
See Section 7 in Document IST-CR-93-19.
DIS Data Dictionary: Dead Reckoning Parameter Record, Dead Reckoning Other Parameters Field.


entityLinearAcceleration

protected LinearAcceleration entityLinearAcceleration
Entity Linear Acceleration - This field shall specify an entity's linear acceleration.


entityAngularVelocity

protected AngularVelocity entityAngularVelocity
Entity Angular Velocity - This field shall specify an entity's angular velocity.


characterSet

protected UnsignedByte characterSet
This field represents the Character set used in representing the Entity Marking Record.
References:
DIS specification : IEEE 1278.1, 5.3.15
DIS Data Dictionary: Entity Marking record, Entity Marking String Record.

See Also:
marking

marking

protected java.lang.String marking
This is a String used to designate the Entity Marking. It is not more than 11 characters. Besides it can't be more than 11 bytes when serializing.
Explanation The Entity Marking record has been flatened here into the marking and the characterSet fields. In general, this record is used to specify the character set used in the marking and the string of characters to be interpreted for display.
Note:
In Java, Strings are NOT the same as byte arrays. Strings use use unicode characters of two bytes each, unlike in C, where there's a direct 1-byte=1 char mapping. We get around this by taking only the low-order byte of the two-byte unicode char when serializing. One of the side effects of this is that we can SET unicode strings, but can't transmit them. This is a wart, but it makes the code a bit easier.
References:
DIS specification : IEEE 1278.1, 5.3.15
DIS Data Dictionary: Entity Marking record, Entity Marking String Record.


capabilities

protected UnsignedInt capabilities
A collection of boolean fields which describe the capabilities of the Entity. Note: The record is being flatened here in one field.
References:
See Section 4 in Document IST-CR-93-19.
DIS Data Dictionary: Entity Capabilities Record, Dead Reckoning Algorithm Field.
DIS specification : IEEE 1278.1, 5.3.13


articulationParameters

protected java.util.Vector articulationParameters
The number of articulation parameters and the Articulation Paramater record are being wrapped in Vectors. It makes the interface look better.
References:
See Section 4 in Document IST-CR-93-19.
DIS Data Dictionary: Number of Articulation Parameters Field, Articulation Parameter Record
DIS specification : IEEE 1278.1, Annex A, 5.3.5


sizeOf

public static final int sizeOf
Constant value--size of an Entity State PDU without header. sizeOf = 132 bytes

See Also:
Constant Field Values

exemplar

protected static EntityStatePdu exemplar
An "examplar" object, which is filled out to the state that is needed most of the time.
Explanation
A brand new object has to have most of its values set, such as the forceID, protocol version, and so on. This lets the user fill out most of the values, save it in the class, then retrieve a copy of it as needed.

Constructor Detail

EntityStatePdu

public EntityStatePdu()
Default constructor--fills with zeros for all values.

Method Detail

debug

protected static void debug(java.lang.String pDiagnostic)
Debugging output. Pass in a string, and it gets printed out on the console. You can pass in strings such as "foo " + bar.getName().


trace

protected static void trace(java.lang.String pDiagnostic)
Guaranteed debugging output. Pass in a string, and it gets printed out on the console. You can pass in strings such as "foo " + bar.getName().


serialize

public void serialize(java.io.DataOutputStream outputStream)
Description copied from class: PduElement
Serialize our data out to the stream. Subclasses of us should call super.Serialize() to make sure the superclasse's data is serialized out. The order in which instance variables are serialized is significant. They must be serialized in the same order they appear in the DIS spec. Prints out some information during execution if debugging flag is set.

Specified by:
serialize in interface SerializationInterface
Overrides:
serialize in class ProtocolDataUnit
Throws:
java.lang.RuntimeException - when io error occurs. fileEncoding ensures we convert string to local system encoding properly.

deSerialize

public void deSerialize(java.io.DataInputStream dataInputStream)
Description copied from class: PduElement
Deserialize our data from the input stream. Subclasses of us should call super.deSerialize to make sure the superclass's data are properly affected. The order in which instance variables are serialized is significant. They must be deSerialized in the same order as they have been serialized as specified by the DIS spec.

Specified by:
deSerialize in interface SerializationInterface
Overrides:
deSerialize in class ProtocolDataUnit
Throws:
java.lang.RuntimeException - when io error occurs. fileEncoding ensures we convert string to local system encoding properly.

clone

public java.lang.Object clone()
Returns a clone of the Entity State PDU .

Overrides:
clone in class ProtocolDataUnit
Returns:
newPdu

length

public int length()
Calculates the length of the Entity State PDU on the fly. This should reflect the current length of the PDU; if an articulation parameter is added, you have to call length() again to find the current length. Note that this is the length of the PDU AS WRITTEN TO THE WIRE.

Overrides:
length in class ProtocolDataUnit
Returns:
currentLength

pduName

public java.lang.String pduName()
This is the string value of Entity State Pdu

Specified by:
pduName in class ProtocolDataUnit
Returns:
new String of ESPDU

printValues

public void printValues(int indentLevel,
                        java.io.PrintStream printStream)
This will print the values of Entity State Pdu to a stream

Overrides:
printValues in class ProtocolDataUnit

getExemplar

public static EntityStatePdu getExemplar()
This gets the exemplar,accessor method

Returns:
exemplar.clone

setExemplar

public static void setExemplar(EntityStatePdu newExemplar)
This sets the exemplar,accessor method


getEntityID

public EntityID getEntityID()
This is the string value of Entity State Pdu,accessor method This field shall identify the entity issuing the PDU, and shall be represented by the PDU Header Record (see 5.2.24)

Returns:
entityID.clone

setEntityID

public void setEntityID(EntityID pEntityID)
Sets EntityID of an EntityID,accessor method. This field shall identify the entity issuing the PDU, and shall be represented by the PDU Header Record (see 5.2.24)


setEntityID

public void setEntityID(short pSiteID,
                        short pApplicationID,
                        short pEntityID)
Sets setEntityID(short pSiteID, short pApplicationID, short pEntityID),accessor method. will create an new EntityID = entityID This field shall identify the entity issuing the PDU, and shall be represented by the PDU Header Record (see 5.2.24)


getForceID

public UnsignedByte getForceID()
Get ForceID of UnsignedByte ,accessor method. This field shall idenitify the enity issuing the PDU, and shall be represented by an Entity Identifier record (sec 5.2.14)

Returns:
forceID.clone

setForceID

public void setForceID(UnsignedByte pForceID)
Set the ForceID with UnsignedByte,accessor method. This field shall idenitify the enity issuing the PDU, and shall be represented by an Entity Identifier record (sec 5.2.14)


setForceID

public void setForceID(int pForceID)
Set the ForceID with new UnsignedByte,accessor method. This field shall idenitify the enity issuing the PDU, and shall be represented by an Entity Identifier record (sec 5.2.14)


articulationParameterCount

public UnsignedByte articulationParameterCount()
Returns the number of articulation parameter in this Entity State PDU,accessor method. Shall be represented by an 8 bit unsigned interger (see appendix A)

Returns:
articulationParameters.size

getEntityType

public EntityType getEntityType()
Gets the Entity State PDU type,accessor method.

Returns:
enititType.clone

setEntityType

public void setEntityType(EntityType pEntityType)
Sets the Entity State PDU type,accessor method.


getEntityTypeKind

public UnsignedByte getEntityTypeKind()
Gets the Entity State PDU type,accessor method.

Returns:
entityType.getKind

setEntityTypeKind

public void setEntityTypeKind(UnsignedByte pEntityKind)
Sets the Entity State PDU type of a UnsignedByte ,accessor method.


setEntityTypeKind

public void setEntityTypeKind(int pEntityKind)
Sets the Entity State PDU type of a Int accessor method.


getEntityTypeDomain

public UnsignedByte getEntityTypeDomain()
Gets the Entity State PDU type of Domain ,accessor method.

Returns:
entityType.getDomain

setEntityTypeDomain

public void setEntityTypeDomain(UnsignedByte pEntityDomain)
Sets the Entity State PDU type of Domain ,accessor method.


setEntityDomain

public void setEntityDomain(int pEntityDomain)
Sets the Entity State PDU type of Domain ,accessor method.


getEntityTypeCountry

public UnsignedShort getEntityTypeCountry()
Gets the Entity Type's Country of origin ,accessor method.

Returns:
entityType.getCountry

setEntityTypeCountry

public void setEntityTypeCountry(UnsignedShort pEntityCountry)
Sets the Entity Type's Country of origin ,accessor method.


setEntityTypeCountry

public void setEntityTypeCountry(int pEntityCountry)
Sets the Entity Type's Country of origin ,accessor method.


getEntityTypeCategory

public UnsignedByte getEntityTypeCategory()
Gets the Entity Type's Category ,accessor method.

Returns:
entityType.getCategory

setEntityTypeCategory

public void setEntityTypeCategory(UnsignedByte pEntityCategory)
Sets the Entity Type's Category of origin ,accessor method.


setEntityTypeCategory

public void setEntityTypeCategory(int pEntityCategory)
Sets the Entity Type's Category of origin ,accessor method.


getEntityTypeSubcategory

public UnsignedByte getEntityTypeSubcategory()
Sets the Entity Type's Sub Category of origin ,accessor method.

Returns:
entityType.getSubCategory

setEntityTypeSubcategory

public void setEntityTypeSubcategory(UnsignedByte pEntitySubcategory)
Sets the Entity Type's Sub Category of origin ,accessor method.


setEntityTypeSubcategory

public void setEntityTypeSubcategory(int pEntitySubcategory)
Sets the Entity Type's Sub Category of origin ,accessor method.


getEntityTypeSpecific

public UnsignedByte getEntityTypeSpecific()
Gets the Entity Type's Specific Category of origin ,accessor method.

Returns:
entityType.getSpecific

setEntityTypeSpecific

public void setEntityTypeSpecific(UnsignedByte pEntitySpecific)
Gets the Entity Type's Specific ,accessor method.


setEntityTypeSpecific

public void setEntityTypeSpecific(int pEntitySpecific)
Sets the Entity Type's Specific ,accessor method.


getEntityTypeExtra

public UnsignedByte getEntityTypeExtra()
Gets the Entity Type's Extra data field ,accessor method.

Returns:
entityType.getExtra

setEntityTypeExtra

public void setEntityTypeExtra(UnsignedByte pEntityExtra)
Sets the Entity Type's Extra data field ,accessor method.


setEntityTypeExtra

public void setEntityTypeExtra(int pEntityExtra)
Sets the Entity Type's Extra data field ,accessor method.


getAlternativeEntityType

public EntityType getAlternativeEntityType()
Gets the Entity Type's Alternative Type data field, whcih is a clone of the Enity ,accessor method.


setAlternativeEntityType

public void setAlternativeEntityType(EntityType pNewAltEntity)
Sets the Entity Type's Alternative Type data field, whcih is a clone of the Enity ,accessor method.


getAlternativeEntityTypeKind

public UnsignedByte getAlternativeEntityTypeKind()
Gets the Entity Type's Alternative Type data field, whcih is a clone of the Enity ,accessor method.

Returns:
alternativeEntityType.getKind

setAlternativeEntityTypeKind

public void setAlternativeEntityTypeKind(UnsignedByte pEntityKind)
Sets the Entity Type's Alternative Kind, whcih is the kind of Enity ,accessor method.


setAlternativeEntityTypeKind

public void setAlternativeEntityTypeKind(int pEntityKind)
Sets the Entity Type's Alternative Kind, which is the kind of Enity ,accessor method.


getAlternativeEntityTypeDomain

public UnsignedByte getAlternativeEntityTypeDomain()
Gets the Entity Type's Alternative Type Domain, which is a clone of the Enity ,accessor method.

Returns:
alternativeEntityType.getDomain

setAlternativeEntityTypeDomain

public void setAlternativeEntityTypeDomain(UnsignedByte pEntityDomain)
Sets the Entity Type's Alternative Type Domain, which is a clone of the Enity ,accessor method.


setAlternativeEntityDomain

public void setAlternativeEntityDomain(int pEntityDomain)
Sets the Entity Type's Alternative Type Domain, which is a clone of the Enity ,accessor method.


getAlternativeEntityTypeCountry

public UnsignedShort getAlternativeEntityTypeCountry()
Gets the Entity Type's Alternative Type Country, which is a clone of the Enity ,accessor method.

Returns:
alternativeEntityType.getCountry

setAlternativeEntityTypeCountry

public void setAlternativeEntityTypeCountry(UnsignedShort pEntityCountry)
Sets the Entity Type's Alternative Type Country, which is a clone of the Enity ,accessor method.


setAlternativeEntityCountry

public void setAlternativeEntityCountry(int pEntityCountry)
Sets the Entity Type's Alternative Type Country, which is a clone of the Enity ,accessor method.


getAlternativeEntityTypeCategory

public UnsignedByte getAlternativeEntityTypeCategory()
Gets the Entity Type's Alternative Type Category, which is a clone of the Enity ,accessor method.

Returns:
alternativeEntityType.getCategory

setAlternativeEntityTypeCategory

public void setAlternativeEntityTypeCategory(UnsignedByte pEntityCategory)
Sets the Entity Type's Alternative Type Category, which is a clone of the Enity ,accessor method.


setAlternativeEntityTypeCategory

public void setAlternativeEntityTypeCategory(int pEntityCategory)
Sets the Entity Type's Alternative Type Category, which is a clone of the Enity ,accessor method.


getAlternativeEntityTypeSubcategory

public UnsignedByte getAlternativeEntityTypeSubcategory()
Gets the Entity Type's Alternative Type SubCategory, which is a clone of the Enity ,accessor method.

Returns:
alternativeEntityType.getSubCategory

setAlternativeEntityTypeSubcategory

public void setAlternativeEntityTypeSubcategory(UnsignedByte pEntitySubcategory)
Sets the Entity Type's Alternative Type SubCategory ,accessor method.


setAlternativeEntityTypeSubcategory

public void setAlternativeEntityTypeSubcategory(int pEntitySubcategory)
Sets the Entity Type's Alternative Type SubCategory ,accessor method.


getAlternativeEntityTypeSpecific

public UnsignedByte getAlternativeEntityTypeSpecific()
Gets the Entity Type's Alternative Type Specific,accessor method.

Returns:
alternativeEntityType.getSpecific

setAlternativeEntityTypeSpecific

public void setAlternativeEntityTypeSpecific(UnsignedByte pEntitySpecific)
Sets the Entity Type's Alternative Type Specific,accessor method.


setAlternativeEntityTypeSpecific

public void setAlternativeEntityTypeSpecific(int pEntitySpecific)
Sets the Entity Type's Alternative Type Specific,accessor method.


getAlternativeEntityTypeExtra

public UnsignedByte getAlternativeEntityTypeExtra()
Sets the Entity Type's Alternative Type Extra,accessor method.


setAlternativeEntityTypeExtra

public void setAlternativeEntityTypeExtra(UnsignedByte pEntityExtra)
Sets the Entity Type's Alternative Type Extra,accessor method.


setAlternativeEntityTypeExtra

public void setAlternativeEntityTypeExtra(int pEntityExtra)
Sets the Entity Type's Alternative Type Extra,accessor method.


getEntityLinearVelocity

public LinearVelocity getEntityLinearVelocity()
Gets the Entity Type's Linear Velocity in meters per sec,accessor method.

Returns:
entityLinearVelocity.clone

setEntityLinearVelocity

public void setEntityLinearVelocity(LinearVelocity pVelocity)
Sets the Entity Type's Linear Velocity in meters per sec,accessor method.


getEntityLinearVelocityX

public float getEntityLinearVelocityX()
Gets the Entity Type's Linear Velocity in meters per sec in the X Direction ,accessor method.

Returns:
entityLinearVelocity.getX

setEntityLinearVelocityX

public void setEntityLinearVelocityX(float pVelocityX)
Sets the Entity Type's Linear Velocity in meters per sec in the X Direction ,accessor method.


getEntityLinearVelocityY

public float getEntityLinearVelocityY()
Gets the Entity Type's Linear Velocity in meters per sec in the Y Direction ,accessor method.

Returns:
entityLinearVelocity.getY

setEntityLinearVelocityY

public void setEntityLinearVelocityY(float pVelocityY)
Sets the Entity Type's Linear Velocity in meters per sec in the Y Direction ,accessor method.


getEntityLinearVelocityZ

public float getEntityLinearVelocityZ()
Gets the Entity Type's Linear Velocity in meters per sec in the Z Direction ,accessor method.

Returns:
entityLinearVelocity.getZ

setEntityLinearVelocityZ

public void setEntityLinearVelocityZ(float pVelocityZ)
Sets the Entity Type's Linear Velocity in meters per sec in the Y Direction ,accessor method.


getEntityLocation

public WorldCoordinate getEntityLocation()
Gets the Entity Type's location in World Cordinates ,accessor method.

Returns:
entityLocation.clone

setEntityLocation

public void setEntityLocation(WorldCoordinate pLocation)
Sets the Entity Type's location in World Cordinates ,accessor method.


getEntityLocationX

public double getEntityLocationX()
Gets the Entity Type'slocation in World Cordinates in the X direction ,accessor method.

Returns:
entityLocation.getX

setEntityLocationX

public void setEntityLocationX(double pLocationX)
Sets the Entity Type'slocation in World Cordinates in the X direction ,accessor method.


getEntityLocationY

public double getEntityLocationY()
Gets the Entity Type'slocation in World Cordinates in the Y direction ,accessor method.

Returns:
entityLocation.getY

setEntityLocationY

public void setEntityLocationY(double pLocationY)
Sets the Entity Type'slocation in World Cordinates in the Y direction ,accessor method.


getEntityLocationZ

public double getEntityLocationZ()
Gets the Entity Type'slocation in World Cordinates in the Z direction ,accessor method.

Returns:
entityLocation.getZ

setEntityLocationZ

public void setEntityLocationZ(double pLocationZ)
Sets the Entity Type'slocation in World Cordinates in the Z direction ,accessor method.


getEntityOrientation

public EulerAngle getEntityOrientation()
Gets the Entity Type's Orientation as a EulerAngle ,accessor method.

Returns:
entityOrientation.clone

setEntityOrientation

public void setEntityOrientation(EulerAngle pNewOrientation)
Sets the Entity Type'slocation in World Cordinates in the Z direction ,accessor method.


getEntityOrientationPsi

public float getEntityOrientationPsi()
Gets the Entity Type's Orientation as a EulerAngle (Psi ,accessor method. //dwl RotationMatrix3D[psi,theta,phi]. //psi

Returns:
entityOrientation.getPsi //theta

setEntityOrientationPsi

public void setEntityOrientationPsi(float pPsi)
Sets the Entity Type'slocation in World Cordinates in the Z direction ,accessor method.


getEntityOrientationTheta

public float getEntityOrientationTheta()
Gets the Entity Type's Orientation as a EulerAngle (Theta ,accessor method.

Returns:
entityOrientation.getTheta

setEntityOrientationTheta

public void setEntityOrientationTheta(float pTheta)

getEntityOrientationPhi

public float getEntityOrientationPhi()

setEntityOrientationPhi

public void setEntityOrientationPhi(float pPhi)

getEntityAppearance

public UnsignedInt getEntityAppearance()

setEntityAppearance

public void setEntityAppearance(UnsignedInt pEntityAppearance)

setEntityAppearance

public void setEntityAppearance(int pEntityAppearance)

getDeadReckoningAlgorithm

public UnsignedByte getDeadReckoningAlgorithm()

setDeadReckoningAlgorithm

public void setDeadReckoningAlgorithm(UnsignedByte pDeadReckoningAlgorithm)

setDeadReckoningAlgorithm

public void setDeadReckoningAlgorithm(int pDeadReckoningAlgorithm)

getDeadReckoningParameters

public byte[] getDeadReckoningParameters()

setDeadReckoningParameters

public void setDeadReckoningParameters(byte[] pDeadReckoningParameters)
Throws:
java.lang.RuntimeException - if Dead Reckoning parameters are too long

getEntityLinearAcceleration

public LinearAcceleration getEntityLinearAcceleration()

setEntityLinearAcceleration

public void setEntityLinearAcceleration(LinearAcceleration pAcceleration)

setEntityLinearAcceleration

public void setEntityLinearAcceleration(float pX,
                                        float pY,
                                        float pZ)

getEntityLinearAccelerationX

public float getEntityLinearAccelerationX()

setEntityLinearAccelerationX

public void setEntityLinearAccelerationX(float pEntityAcceleration)

getEntityLinearAccelerationY

public float getEntityLinearAccelerationY()

setEntityLinearAccelerationY

public void setEntityLinearAccelerationY(float pEntityAcceleration)

getEntityLinearAccelerationZ

public float getEntityLinearAccelerationZ()

setEntityLinearAccelerationZ

public void setEntityLinearAccelerationZ(float pEntityAcceleration)

getEntityAngularVelocity

public AngularVelocity getEntityAngularVelocity()

setEntityAngularVelocity

public void setEntityAngularVelocity(AngularVelocity pAngV)

setEntityAngularVelocity

public void setEntityAngularVelocity(float pX,
                                     float pY,
                                     float pZ)

getEntityAngularVelocityX

public float getEntityAngularVelocityX()

setEntityAngularVelocityX

public void setEntityAngularVelocityX(float pEntityAngularVelocity)

getEntityAngularVelocityY

public float getEntityAngularVelocityY()

setEntityAngularVelocityY

public void setEntityAngularVelocityY(float pEntityAngularVelocity)

getEntityAngularVelocityZ

public float getEntityAngularVelocityZ()

setEntityAngularVelocityZ

public void setEntityAngularVelocityZ(float pEntityAngularVelocity)

getCharacterSet

public UnsignedByte getCharacterSet()

setCharacterSet

public void setCharacterSet(UnsignedByte pCharacterSet)

setCharacterSet

public void setCharacterSet(int pCharacterSet)

getMarking

public java.lang.String getMarking()

toString

public java.lang.String toString()
Overrides:
toString in class ProtocolDataUnit

setMarking

public void setMarking(java.lang.String pMarking)

getCapabilities

public UnsignedInt getCapabilities()

setCapabilities

public void setCapabilities(UnsignedInt pCapabilities)

setCapabilities

public void setCapabilities(int pCapabilities)

getArticulationParameterAt

public ArticulationParameter getArticulationParameterAt(int pIdx)
Returns the articulation parameter pointed at the given index.

Parameters:
pIdx - the index of the articulation parameter we want to get.
Returns:
the articulation paramter at the given index.

addArticulationParameter

public void addArticulationParameter(ArticulationParameter pParameter)
Inserts a new articulation parameter in the list.

Parameters:
pParameter - the articulation parameter to insert in the list.