hmi.graphics.scenegraph
Class GScene

java.lang.Object
  extended by hmi.xml.XMLStructureAdapter
      extended by hmi.graphics.scenegraph.GScene
All Implemented Interfaces:
XMLStructure

public class GScene
extends XMLStructureAdapter

A GScene combines a GNode based scene graph with other scene elements, like Controllers, ... A scene graph is really a forest, containing (potentially) several root nodes.

Author:
Job Zwiers

Field Summary
private static org.slf4j.Logger logger
           
private  List<GNode> rootNodes
           
private  List<GNode> skeletonRoots
           
private  List<GSkinnedMesh> skinnedMeshList
           
private static boolean writeBindMatrices
           
private static String XMLTAG
           
private  String xmlVersion
           
 
Fields inherited from class hmi.xml.XMLStructureAdapter
ATTRIBUTE_TOKEN_DELIMITERS, COMMA_SEPARATOR, DECODEDARRAYSIZE, DEFAULT_RECOVER_MODE, NEWLINE, SYSTEMNEWLINE, TAB, TAB_STRING
 
Constructor Summary
GScene()
          Creates a new GScene.
GScene(XMLTokenizer tokenizer)
           
 
Method Summary
 void addOriginMarker()
           
 void addRootNode(GNode root)
          Adds a GNode as a root node to the scene graph forrest.
 void addSkinnedMeshes(List<GSkinnedMesh> skinnedMeshes)
          Adds some SkinnedMeshes
 void adjustBindPoses()
           
 void affineTransformMeshes(float[] t, float[] q, float s)
           
 StringBuilder appendAttributes(StringBuilder buf)
          appends XML attributes to buf.
 StringBuilder appendContent(StringBuilder buf, XMLFormatting fmt)
          Appends a String to buf that encodes the contents for the XML encoding.
 void calculateVJointMatrices()
          Calculates the matrices for the VJoint structures.
 void clearRotations()
           
 void decodeAttributes(HashMap<String,String> attrMap, XMLTokenizer tokenizer)
          decodes XML attributes.
 void decodeContent(XMLTokenizer tokenizer)
          decodes the XML contents, i.e. the XML between the STag and ETag of the encoding.
static org.slf4j.Logger getLogger()
          returns the (static) org.slf4j.Logger for the scenegraph package
 List<GNode> getRootNodes()
          returns the list with the root nodes of the scene graph forrest
 List<GNode> getSkeletonRoots()
           
 List<GSkinnedMesh> getSkinnedMeshes()
          returns the List of all GSkinnedMeshes for this GScene.
 String getXMLTag()
          returns the XML Stag for XML encoding
 void prepareSkinnedMeshes(String renamingList, float scale, boolean setToHAnim)
           
 void renameJoints(String renamingList)
           
 void resolveSkinnedMeshJoints()
          Resolves the VJoints for all skinned meshes within this GScene,
 void rotateScaleSkinnedMeshes(float x, float y, float z, float angle, float scale)
           
 void setHAnimPoses()
          Sets all skeletons into HAnim pose
static String xmlTag()
          The XML Stag for XML encoding
 
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, 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, 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

rootNodes

private List<GNode> rootNodes

skinnedMeshList

private List<GSkinnedMesh> skinnedMeshList

skeletonRoots

private List<GNode> skeletonRoots

xmlVersion

private String xmlVersion

logger

private static org.slf4j.Logger logger

writeBindMatrices

private static final boolean writeBindMatrices
See Also:
Constant Field Values

XMLTAG

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

GScene

public GScene()
Creates a new GScene.


GScene

public GScene(XMLTokenizer tokenizer)
       throws IOException
Throws:
IOException
Method Detail

getLogger

public static org.slf4j.Logger getLogger()
returns the (static) org.slf4j.Logger for the scenegraph package


addOriginMarker

public void addOriginMarker()

addRootNode

public void addRootNode(GNode root)
Adds a GNode as a root node to the scene graph forrest.


getRootNodes

public List<GNode> getRootNodes()
returns the list with the root nodes of the scene graph forrest


getSkeletonRoots

public List<GNode> getSkeletonRoots()

addSkinnedMeshes

public void addSkinnedMeshes(List<GSkinnedMesh> skinnedMeshes)
Adds some SkinnedMeshes


getSkinnedMeshes

public List<GSkinnedMesh> getSkinnedMeshes()
returns the List of all GSkinnedMeshes for this GScene.


calculateVJointMatrices

public void calculateVJointMatrices()
Calculates the matrices for the VJoint structures.


clearRotations

public void clearRotations()

rotateScaleSkinnedMeshes

public void rotateScaleSkinnedMeshes(float x,
                                     float y,
                                     float z,
                                     float angle,
                                     float scale)

affineTransformMeshes

public void affineTransformMeshes(float[] t,
                                  float[] q,
                                  float s)

renameJoints

public void renameJoints(String renamingList)

resolveSkinnedMeshJoints

public void resolveSkinnedMeshJoints()
Resolves the VJoints for all skinned meshes within this GScene,


adjustBindPoses

public void adjustBindPoses()

prepareSkinnedMeshes

public void prepareSkinnedMeshes(String renamingList,
                                 float scale,
                                 boolean setToHAnim)

setHAnimPoses

public void setHAnimPoses()
Sets all skeletons into HAnim pose


appendAttributes

public StringBuilder appendAttributes(StringBuilder buf)
appends XML attributes to buf.

Overrides:
appendAttributes in class XMLStructureAdapter

decodeAttributes

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

Overrides:
decodeAttributes in class XMLStructureAdapter

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


getXMLTag

public String getXMLTag()
returns the XML Stag for XML encoding

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