hmi.facegraphics
Class GLHead

java.lang.Object
  extended by hmi.xml.XMLStructureAdapter
      extended by hmi.facegraphics.GLHead
All Implemented Interfaces:
Head, XMLStructure

public class GLHead
extends XMLStructureAdapter
implements Head


Nested Class Summary
private static class GLHead.Operation
           
 
Field Summary
private  HashMap<FAP,Deformer> deformers
           
private  boolean deformScheduled
           
private  HashMap<FAP,HashMap<Integer,float[]>> displacements
          This map contains maps, each of which contains pairs of vertex-index - displacement.
private  boolean displacementsDirty
           
private  GLSkinnedMesh faceMesh
           
private  HashMap<String,Float> fapus
           
private  boolean fapusDirty
           
private  HashMap<FeaturePoint,float[]> fpPositions
           
private  ArrayList<FAP> keepSync
           
private  Eye leftEye
           
private  LowerJaw lowerJaw
           
private  GLHead.Operation mergeOp
           
private  Neck neck
           
private  float[] neutralVertexData
           
private  Eye rightEye
           
private static long serialVersionUID
           
private  float[] vertexData
           
private  HashMap<FAP,ArrayList<Integer>> vertexMasks
           
private  float xcenter
           
private static String XMLTAG
           
private  float xsize
           
 
Fields inherited from class hmi.xml.XMLStructureAdapter
ATTRIBUTE_TOKEN_DELIMITERS, COMMA_SEPARATOR, DECODEDARRAYSIZE, DEFAULT_RECOVER_MODE, NEWLINE, SYSTEMNEWLINE, TAB, TAB_STRING
 
Constructor Summary
GLHead()
           
 
Method Summary
 StringBuilder appendContent(StringBuilder buf, XMLFormatting fmt)
          Appends a String to buf that encodes the contents for the XML encoding.
 void applyDisplacements()
          Deprecated. 
private  float[] calculateCenter(float[] first, float[] second)
           
private  float calculateDistance(float[] first, float[] second)
           
private  void calculateFAPUs()
           
private  void calculateHeadWidth()
           
 void calculateVertexWeights()
           
 void clearDisplacements()
           
 void decodeContent(XMLTokenizer tokenizer)
          decodes the XML contents, i.e. the XML between the STag and ETag of the encoding.
 void deformWhenScheduled()
           
 Deformer getDeformer(FAP fap)
           
 float getFAPU(String fapu)
           
 float[] getFPPosition(FeaturePoint fp)
           
private  float[] getFPPosition(String fpString)
           
 boolean getKeepSync(FAP fap)
           
 Eye getLeftEye()
           
 LowerJaw getLowerJaw()
           
 Neck getNeck()
           
 float[] getNeutralVertexPos(int index)
           
 int getNumVertices()
           
 Eye getRightEye()
           
 float[] getVertexData()
           
 ArrayList<Integer> getVertexMask(FAP fap)
           
 float getWidth()
           
 float getXCenter()
           
 String getXMLTag()
          The XML Stag for XML encoding -- use this method to find out the run-time xml tag of an object
 void scheduleDeform()
           
 void setDeformer(FAP fap, Deformer deformer)
           
 void setDisplacements(FAP fap, HashMap<Integer,float[]> disp)
          Deprecated. 
 void setEyes(Eye leftEye, Eye rightEye)
           
 void setFaceMesh(GLSkinnedMesh faceMesh)
           
 void setFPPosition(FeaturePoint fp, float[] pos)
           
 void setKeepSync(FAP fap, boolean sync)
           
 void setLowerJaw(LowerJaw lowerJaw)
           
 void setNeck(Neck neck)
           
private  void setNeutralVertexData(float[] neutralVertexData)
           
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, 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, decodeAttributes, 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
 
Methods inherited from interface hmi.xml.XMLStructure
appendXML, appendXML, appendXML, readXML, readXML, readXML, toXMLString, toXMLString, toXMLString, writeXML, writeXML, writeXML
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

fpPositions

private HashMap<FeaturePoint,float[]> fpPositions

keepSync

private ArrayList<FAP> keepSync

deformers

private HashMap<FAP,Deformer> deformers

vertexMasks

private HashMap<FAP,ArrayList<Integer>> vertexMasks

fapus

private HashMap<String,Float> fapus

fapusDirty

private boolean fapusDirty

xcenter

private float xcenter

xsize

private float xsize

leftEye

private Eye leftEye

rightEye

private Eye rightEye

lowerJaw

private LowerJaw lowerJaw

neck

private Neck neck

displacements

private HashMap<FAP,HashMap<Integer,float[]>> displacements
This map contains maps, each of which contains pairs of vertex-index - displacement.


displacementsDirty

private boolean displacementsDirty

deformScheduled

private boolean deformScheduled

vertexData

private float[] vertexData

neutralVertexData

private float[] neutralVertexData

faceMesh

private GLSkinnedMesh faceMesh

mergeOp

private final GLHead.Operation mergeOp

XMLTAG

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

GLHead

public GLHead()
Method Detail

getFPPosition

public float[] getFPPosition(FeaturePoint fp)

getFPPosition

private float[] getFPPosition(String fpString)

setFPPosition

public void setFPPosition(FeaturePoint fp,
                          float[] pos)

setKeepSync

public void setKeepSync(FAP fap,
                        boolean sync)

getKeepSync

public boolean getKeepSync(FAP fap)

setDeformer

public void setDeformer(FAP fap,
                        Deformer deformer)

getDeformer

public Deformer getDeformer(FAP fap)

getVertexMask

public ArrayList<Integer> getVertexMask(FAP fap)

getFAPU

public float getFAPU(String fapu)
Specified by:
getFAPU in interface Head

calculateFAPUs

private void calculateFAPUs()

calculateDistance

private float calculateDistance(float[] first,
                                float[] second)

calculateCenter

private float[] calculateCenter(float[] first,
                                float[] second)

getNumVertices

public int getNumVertices()

getVertexData

public float[] getVertexData()

calculateHeadWidth

private void calculateHeadWidth()

getWidth

public float getWidth()

getXCenter

public float getXCenter()

setNeutralVertexData

private void setNeutralVertexData(float[] neutralVertexData)

getNeutralVertexPos

public float[] getNeutralVertexPos(int index)

setFaceMesh

public void setFaceMesh(GLSkinnedMesh faceMesh)

calculateVertexWeights

public void calculateVertexWeights()

scheduleDeform

public void scheduleDeform()

deformWhenScheduled

public void deformWhenScheduled()

setDisplacements

@Deprecated
public void setDisplacements(FAP fap,
                                        HashMap<Integer,float[]> disp)
Deprecated. 


clearDisplacements

public void clearDisplacements()

applyDisplacements

@Deprecated
public void applyDisplacements()
Deprecated. 


setEyes

public void setEyes(Eye leftEye,
                    Eye rightEye)

getLeftEye

public Eye getLeftEye()

getRightEye

public Eye getRightEye()

setLowerJaw

public void setLowerJaw(LowerJaw lowerJaw)

getLowerJaw

public LowerJaw getLowerJaw()

setNeck

public void setNeck(Neck neck)

getNeck

public Neck getNeck()

appendContent

public StringBuilder appendContent(StringBuilder buf,
                                   XMLFormatting fmt)
Description copied from class: XMLStructureAdapter
Appends a String to buf that encodes the contents for the XML encoding. MUST BE OVERWRITTEN BY IMPLEMENTATIONS. (The default implementation appends nothing). The encoding should start on a new line, using indentation equal to tab. There should be no newline after the encoding.

Overrides:
appendContent in class XMLStructureAdapter

decodeContent

public void decodeContent(XMLTokenizer tokenizer)
                   throws IOException
Description copied from class: XMLStructureAdapter
decodes the XML contents, i.e. the XML between the STag and ETag of the encoding. MUST BE OVERWRITTEN BY IMPLEMENTATIONS.

Overrides:
decodeContent in class XMLStructureAdapter
Throws:
IOException

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