hmi.animation
Class SkeletonPose

java.lang.Object
  extended by hmi.xml.XMLStructureAdapter
      extended by hmi.animation.SkeletonPose
All Implemented Interfaces:
XMLStructure

public class SkeletonPose
extends XMLStructureAdapter

Contains a single pose in a config and a configType describing what the numbers in the config mean. Poses can be set to or from an array of VObjects set as target

Author:
welberge

Field Summary
private  float[] config
           
private  int configSize
           
private  String configType
           
private static String[] empty_PartIds
           
private  boolean hasAngularVelocity
           
private  boolean hasRootTranslation
           
private  boolean hasRotation
           
private  boolean hasScale
           
private  boolean hasTranslation
           
private  boolean hasVelocity
           
private static org.slf4j.Logger logger
           
private  String[] partIds
           
private  String rotationEncoding
           
private  int stride
           
private  VObject[] targetParts
           
private static String XMLTAG
           
 
Fields inherited from class hmi.xml.XMLStructureAdapter
ATTRIBUTE_TOKEN_DELIMITERS, COMMA_SEPARATOR, DECODEDARRAYSIZE, DEFAULT_RECOVER_MODE, NEWLINE, SYSTEMNEWLINE, TAB, TAB_STRING
 
Constructor Summary
SkeletonPose(String[] partIds, float[] config, String configType)
          Creates a new SkeletonInterpolator for a specified ConfigList, VParts, and Config type.
SkeletonPose(String[] partIds, String configType)
          Creates a new SkeletonInterpolator for a specified ConfigList, VParts, and Config type.
SkeletonPose(VObject[] targets, String configType)
           
SkeletonPose(XMLTokenizer tokenizer)
          Creates a new, uninitialized, SkeletonInterpolator
 
Method Summary
private  void calculateConfigSize()
           
private  void convertFromAxisAngles()
           
 void decodeAttributes(HashMap<String,String> attrMap, XMLTokenizer tokenizer)
          decodes the XML attributes
 void decodeContent(XMLTokenizer xmlTokenizer)
          Decodes XML content, and converts it into the float config data.
 float[] getConfig()
          Gets the Config list
 int getConfigSize()
          Returns the (uniform) size of configs, in number of floats.
 String getConfigType()
          Returns the configuration type, as encoded conform VOBject types.
 String[] getPartIds()
          Returns the list of ids of the VObject parts that are influenced by this interpolator.
 String getRotationEncoding()
           
 String getXMLTag()
          The XML Stag for XML encoding -- use this method to find out the run-time xml tag of an object
 void setConfig(float[] config)
          Sets the ConfigList, defining the VPartsConfigs to be interpolated.
 void setConfigType(String configType)
           
 void setFromTarget()
          Sets the current pose from the status of the VObject target
 void setPartIds(String[] partIds)
          Sets the list of VObject ids/sids
 void setPartIds(VObject[] targets)
           
 void setRotationEncoding(String rotationEncoding)
           
 void setTargets(VObject[] targets)
          Sets a specified VObject array as target for the pose A lookup is performed for parts of the target with Id/Sid/Name as defined by the partIds for this pose.
 void setToTarget()
          Sets the current pose to the VObject target
 int size()
          returns the size of the list
static String xmlTag()
          The XML Stag for XML encoding -- use this static method when you want to see if a given String equals the xml tag for this class
 
Methods inherited from class hmi.xml.XMLStructureAdapter
appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttributes, appendAttributes, appendAttributeString, appendAttributeString, appendBooleans, appendCloseEmptyTag, appendCloseSTag, appendComment, appendContent, appendContent, appendDoubleElement, appendEmptyTag, appendEmptyTag, appendEmptyTag, appendEmptyTag, appendEmptyTag, appendEmptyTag, appendETag, appendETag, appendFloatArrayElement, appendFloatElement, appendFloats, appendIntArrayElement, appendIntElement, appendInts, appendLongElement, appendNewLine, appendNewLine, appendNewLine, appendOpenSTag, appendOptionalDoubleElement, appendOptionalFloatElement, appendOptionalIntElement, appendOptionalLongElement, appendSpaces, appendSpaces, appendSTag, appendSTag, appendSTag, appendStringArrayElement, appendStrings, appendSystemNewLine, appendTab, appendTextElement, appendXML, appendXML, appendXML, appendXML, appendXML, appendXMLStructure, appendXMLStructureList, appendXMLTextElementList, countTokens, countTokens, decodeAttribute, decodeAttribute, decodeBoolean, decodeBooleanArray, decodeBooleanArray, decodeBooleanArray, decodeBooleanArray, decodeDouble, decodeDoubleArray, decodeDoubleArray, decodeDoubleArray, decodeDoubleArray, decodeFloat, decodeFloatArray, decodeFloatArray, decodeFloatArray, decodeFloatArray, decodeInt, decodeIntArray, decodeIntArray, decodeIntArray, decodeIntArray, decodeLong, decodeStringArray, decodeStringArray, decodeStringArray, decodeStringArray, decodeXMLStructureList, decodeXMLValueElement, getNamespace, getOptionalAttribute, getOptionalAttribute, getOptionalBooleanAttribute, getOptionalDoubleAttribute, getOptionalFloatAttribute, getOptionalIntAttribute, getOptionalLongAttribute, getRequiredAttribute, getRequiredBooleanAttribute, getRequiredDoubleAttribute, getRequiredFloatAttribute, getRequiredIntAttribute, getRequiredLongAttribute, getTagLine, hasContent, parseXMLElement, postProcess, preProcess, readXML, readXML, readXML, setConsoleAttributeEnabled, setDefaultRecoverMode, setRecoverMode, spaces, toString, toXMLString, toXMLString, toXMLString, toXMLString, toXMLString, toXMLString, writeXML, writeXML, writeXML, writeXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

empty_PartIds

private static final String[] empty_PartIds

partIds

private String[] partIds

config

private float[] config

configType

private String configType

configSize

private int configSize

stride

private int stride

hasRootTranslation

private boolean hasRootTranslation

hasTranslation

private boolean hasTranslation

hasRotation

private boolean hasRotation

hasScale

private boolean hasScale

hasVelocity

private boolean hasVelocity

hasAngularVelocity

private boolean hasAngularVelocity

rotationEncoding

private String rotationEncoding

targetParts

private VObject[] targetParts

logger

private static org.slf4j.Logger logger

XMLTAG

private static final String XMLTAG
See Also:
Constant Field Values
Constructor Detail

SkeletonPose

public SkeletonPose(XMLTokenizer tokenizer)
             throws IOException
Creates a new, uninitialized, SkeletonInterpolator

Throws:
IOException

SkeletonPose

public SkeletonPose(String[] partIds,
                    float[] config,
                    String configType)
Creates a new SkeletonInterpolator for a specified ConfigList, VParts, and Config type. The Config type should be a String like "T1R" or "R", or "TRSVW".


SkeletonPose

public SkeletonPose(String[] partIds,
                    String configType)
Creates a new SkeletonInterpolator for a specified ConfigList, VParts, and Config type. The Config type should be a String like "T1R" or "R", or "TRSVW".


SkeletonPose

public SkeletonPose(VObject[] targets,
                    String configType)
Method Detail

setPartIds

public void setPartIds(VObject[] targets)

calculateConfigSize

private void calculateConfigSize()

setConfig

public void setConfig(float[] config)
Sets the ConfigList, defining the VPartsConfigs to be interpolated.


getConfig

public float[] getConfig()
Gets the Config list


setPartIds

public void setPartIds(String[] partIds)
Sets the list of VObject ids/sids


getPartIds

public String[] getPartIds()
Returns the list of ids of the VObject parts that are influenced by this interpolator.


getConfigType

public String getConfigType()
Returns the configuration type, as encoded conform VOBject types.


setConfigType

public void setConfigType(String configType)

setRotationEncoding

public void setRotationEncoding(String rotationEncoding)

getConfigSize

public int getConfigSize()
Returns the (uniform) size of configs, in number of floats.


size

public int size()
returns the size of the list


setTargets

public void setTargets(VObject[] targets)
Sets a specified VObject array as target for the pose A lookup is performed for parts of the target with Id/Sid/Name as defined by the partIds for this pose.


setToTarget

public void setToTarget()
Sets the current pose to the VObject target


setFromTarget

public void setFromTarget()
Sets the current pose from the status of the VObject target


getRotationEncoding

public String getRotationEncoding()

decodeAttributes

public void decodeAttributes(HashMap<String,String> attrMap,
                             XMLTokenizer tokenizer)
decodes the XML attributes

Overrides:
decodeAttributes in class XMLStructureAdapter

decodeContent

public void decodeContent(XMLTokenizer xmlTokenizer)
                   throws IOException
Decodes XML content, and converts it into the float config data.

Overrides:
decodeContent in class XMLStructureAdapter
Throws:
IOException

convertFromAxisAngles

private void convertFromAxisAngles()

xmlTag

public static String xmlTag()
The XML Stag for XML encoding -- use this static method when you want to see if a given String equals the xml tag for this class


getXMLTag

public String getXMLTag()
The XML Stag for XML encoding -- use this method to find out the run-time xml tag of an object

Specified by:
getXMLTag in interface XMLStructure
Overrides:
getXMLTag in class XMLStructureAdapter