mil.navy.nps.dis
Class ArticulationParameter

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

public class ArticulationParameter
extends PduElement

Articulation parameters are components of an entity that can move - this data is appended to the EntityState PDU.

Version:
1.0
Author:
Don McGregor (http://www.npsnet.org/~mcgredo)
Location:
Web: http://www.web3d.org/WorkingGroups/vrtp/mil/navy/nps/dis/ArticulationParameter.java
or locally: ~/mil/navy/nps/dis/ArticulationParameter.java
Hierarchy Diagram:
Summary:
Location of the origin of the entity's coordinate system shall be specified by a set of three coordinates: X, Y, and Z.
Explanation
The articulation parameter describes how a part of an entity, such as a turret or fin, is oriented wrt the rest of the entity.

This is a subclass of the PduElement class, the abstract class that all parts of a PDU inherit from. It knows how to serialize, deserialize, and clone itself. It is kept as a part of the EntityStatePdu.

History:
21Oct96 /Don McGregor /New
04Mar97 /Don McGregor /changes for javadoc
16Apr97 /Don McGregor /PrintStream passed to printValues
8Dec97 /Ronan Fauglas /changes for documentation templates + complements in documentation
11Dec97 /Ronan Fauglas /changes access methods names from "variable()" to "getVariable()"
04Jan98 /Ronan Fauglas /suppressed redundant comments for clone, printValues, etc...
12Jan98 /Ronan Fauglas /changed changeIndicator to parameterChangeIndicator.
12Jan98 /Ronan Fauglas /changed partID to articulationAttachmentID.
31Mar99 /Don Brutzman, Don McGregor /changed articulationParameter from long to double
4Mar99 /Don Brutzman /updated disEnumeration javadoc links
References:
DIS Data Dictionary: Articulation Parameter Record (local) and Articulation Parameter Record (SISO)
DIS specification : IEEE 1278.1, Section 5.3.5, Annex A
See Also:
PduElement, DetonationPdu, SerializationInterface, EntityStatePdu

Field Summary
protected  UnsignedShort articulationAttachmentID
          The identification of the articulated part to which this articulation parameter is attached.
protected  UnsignedByte changeIndicator
          The change of any parameter for any articulated part shall be indicated by a change indicator field.
protected  UnsignedInt parameterType
          The type of parameter represented shall be specified by an enumeration.
protected  UnsignedByte parameterTypeDesignator
          The identification of whether the Parameter Type Record is for an articulated or attached part shall be designated by this field.
protected  double parameterValue
          This field contains the value of the Articulation Parameter.
static int sizeOf
          Constant value--size of an Articulation Parameter WHEN WRITTEN TO THE WIRE; here :sizeOf = 16 bytes.
 
Constructor Summary
ArticulationParameter()
          Default constructor--fills with zeros for all values.
 
Method Summary
 java.lang.Object clone()
          Makes deep copies of all the instance variables, so we don't have two objects pointing to the same data.
 void decrementChangeIndicator()
           
 void deSerialize(java.io.DataInputStream inputStream)
          Deserialize our data from the input stream.
 UnsignedShort getArticulationAttachmentID()
           
 UnsignedByte getChangeIndicator()
           
 UnsignedInt getParameterType()
           
 UnsignedByte getParameterTypeDesignator()
           
 double getParameterValue()
          changed type of parameterValue from long to double (but note that value gets downcasted to float when sent to VRML)
 void incrementChangeIndicator()
          incremented automatically when parameterValue is changed, also available to users.
 int length()
          Returns the length of the object when serialized in a stream.
 void printValues(int indentLevel, java.io.PrintStream printStream)
          Prints the generated serialized object for debugging.
 void printValues(int indentLevel, java.io.PrintStream printStream, int idx)
          Include index of which ArticulationPararameter is being printed.
 void serialize(java.io.DataOutputStream outputStream)
          Serialize our data out to the stream.
 void setArticulationAttachmentID(int pArticulationAttachmentID)
           
 void setArticulationAttachmentID(UnsignedShort pArticulationAttachmentID)
           
 void setChangeIndicator(int pChangeIndicator)
           
 void setChangeIndicator(UnsignedByte pChangeIndicator)
           
 void setParameterType(int pParameterType)
           
 void setParameterType(UnsignedInt pParameterType)
           
 void setParameterTypeDesignator(int pParameterTypeDesignator)
           
 void setParameterTypeDesignator(UnsignedByte pParameterTypeDesignator)
           
 void setParameterValue(double pParameterValue)
           
 void setParameterValue(long pParameterValue)
          Deprecated. 31 MAR 99, use setParameterValue(double) -- changed type of parameterValue from long to double to match DIS specification (nevertheless note that value gets further downcasted to float if sent to VRML)
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parameterTypeDesignator

protected UnsignedByte parameterTypeDesignator
The identification of whether the Parameter Type Record is for an articulated or attached part shall be designated by this field.
Value:
Enumeration, see references below for values.
References:
disEnumeration class: Parameter Type Designator Field (local)
DIS Data Dictionary: Parameter Type Designator Field (local) and Parameter Type Designator Field (SISO)


changeIndicator

protected UnsignedByte changeIndicator
The change of any parameter for any articulated part shall be indicated by a change indicator field.
Value:
This field shall be set to o for each exercise and sequencially incremented by one for each change in articulation parameter. In the case all possible values are exhausted, the numbers shall be reused beginning at zero.
References:
DIS Data Dictionary: Parameter Change Indicator Field (local) and Parameter Change Indicator Field (SISO)
See section 4 in EBV-DOC


articulationAttachmentID

protected UnsignedShort articulationAttachmentID
The identification of the articulated part to which this articulation parameter is attached.
Value:
This field shall contain the value 0 if the articulated part is attached directly to the entity.
References:
DIS Data Dictionary: Articulation Attachment ID Field (local) and Articulation Attachment ID Field (SISO)


parameterType

protected UnsignedInt parameterType
The type of parameter represented shall be specified by an enumeration.
Value:
Enumeration, see references below for values.
References:
disEnumeration classes: Parameter Type Attached Parts Field (local), or Parameter Type Articulated Parts Low Bits Field (local) and Parameter Type Articulated Parts High Bits Field (local)
DIS Data Dictionary: Parameter Type Variant (local) and Parameter Type Variant (SISO)
DIS specification: IEEE 1278.1, Annex A
See Section 4 in EBV-DOC


parameterValue

protected double parameterValue
This field contains the value of the Articulation Parameter.
Value:
The definition of the 64 bits shall be determined based on the type of parameter specified in the ParameterType field. See References below for further information.
References:
DIS Data Dictionary: Articulation Parameter Record (local) and Articulation Parameter Record (SISO)
DIS specification: IEEE 1278.1, 5.3.5.4
See Section 4 in EBV-DOC


sizeOf

public static final int sizeOf
Constant value--size of an Articulation Parameter WHEN WRITTEN TO THE WIRE; here :sizeOf = 16 bytes.

See Also:
Constant Field Values
Constructor Detail

ArticulationParameter

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

Method Detail

clone

public java.lang.Object clone()
Description copied from class: PduElement
Makes deep copies of all the instance variables, so we don't have two objects pointing to the same data. The accessor methods make copies of the objects, rather than returning the objects themselves. The runtime provides the right object type with the call to super.clone(), and we cast it to our type. Subclasses should do the same thing, and all these ivars will be taken care of automatically.

Overrides:
clone in class PduElement
Returns:
a clone of this instance
See Also:
Object

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
Specified by:
serialize in class PduElement
Parameters:
outputStream - the stream to which this object is serialized

deSerialize

public void deSerialize(java.io.DataInputStream inputStream)
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
Specified by:
deSerialize in class PduElement
Parameters:
inputStream - the stream from which this object is initialized

length

public int length()
Description copied from class: PduElement
Returns the length of the object when serialized in a stream.

Specified by:
length in class PduElement
Returns:
the length of the object when serialized in a stream

printValues

public void printValues(int indentLevel,
                        java.io.PrintStream printStream)
Description copied from class: PduElement
Prints the generated serialized object for debugging.

Specified by:
printValues in class PduElement
Parameters:
indentLevel - number of spaces to indent for visibility

printValues

public void printValues(int indentLevel,
                        java.io.PrintStream printStream,
                        int idx)
Include index of which ArticulationPararameter is being printed.


toString

public java.lang.String toString()

getParameterTypeDesignator

public UnsignedByte getParameterTypeDesignator()

setParameterTypeDesignator

public void setParameterTypeDesignator(UnsignedByte pParameterTypeDesignator)

setParameterTypeDesignator

public void setParameterTypeDesignator(int pParameterTypeDesignator)

getChangeIndicator

public UnsignedByte getChangeIndicator()

incrementChangeIndicator

public void incrementChangeIndicator()
incremented automatically when parameterValue is changed, also available to users.


decrementChangeIndicator

public void decrementChangeIndicator()

setChangeIndicator

public void setChangeIndicator(UnsignedByte pChangeIndicator)

setChangeIndicator

public void setChangeIndicator(int pChangeIndicator)

getArticulationAttachmentID

public UnsignedShort getArticulationAttachmentID()

setArticulationAttachmentID

public void setArticulationAttachmentID(UnsignedShort pArticulationAttachmentID)

setArticulationAttachmentID

public void setArticulationAttachmentID(int pArticulationAttachmentID)

getParameterType

public UnsignedInt getParameterType()

setParameterType

public void setParameterType(UnsignedInt pParameterType)

setParameterType

public void setParameterType(int pParameterType)

getParameterValue

public double getParameterValue()
changed type of parameterValue from long to double (but note that value gets downcasted to float when sent to VRML)


setParameterValue

public void setParameterValue(long pParameterValue)
Deprecated. 31 MAR 99, use setParameterValue(double) -- changed type of parameterValue from long to double to match DIS specification (nevertheless note that value gets further downcasted to float if sent to VRML)


setParameterValue

public void setParameterValue(double pParameterValue)