|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.xml.XMLStructureAdapter
hmi.graphics.scenegraph.GNode
public class GNode
GNode represent a scenegraph node, that contains GNode typed children, references GShapes, and specifies a local 3D transformation. The latter is specified by either a 4X4 matrix, and/or by the following:
| Nested Class Summary | |
|---|---|
static interface |
GNode.Predicate
GNode.Predicates are Objects that implement a boolean test on GNodes, in the form of their "valid" method. |
| Field Summary | |
|---|---|
private static List<GNode> |
EMPTYGNODELIST
|
private static List<GShape> |
EMPTYGSHAPELIST
|
private List<GNode> |
gnodes
|
private List<GShape> |
gshapes
|
private String |
id
|
private VJoint |
joint
|
private static int |
LISTSIZE
|
private String |
name
|
private GNode |
parent
|
private String |
sid
|
private String |
type
|
private float[] |
vec
|
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 | |
|---|---|
GNode()
Creates a new GNode with null id. |
|
GNode(String id)
Creates a new GNode with specified id. |
|
GNode(XMLTokenizer tokenizer)
|
|
| Method Summary | |
|---|---|
void |
addGNode(GNode sn)
Adds some GNode as a child node. |
void |
addGShape(GShape gshape)
Adds a GShape |
void |
addGShapes(List<GShape> gshapeList)
Adds all elements of a List of GShapes |
void |
affineTransform(float[] mat4x4)
|
void |
affineTransformGShapes(float[] mat4x4)
|
StringBuilder |
appendAttributes(StringBuilder buf)
appends the id, sid, name XML attributes to buf. |
StringBuilder |
appendContent(StringBuilder buf,
XMLFormatting fmt)
Appends a String to buf that encodes the contents for the XML encoding. |
void |
clearJointRotations()
|
void |
clearLocalLinearTransform()
|
void |
clearRotations()
|
void |
decodeAttributes(HashMap<String,String> attrMap,
XMLTokenizer tokenizer)
decodes the id and sid XML attributes. |
void |
decodeContent(XMLTokenizer tokenizer)
decodes the XML contents, i.e. the XML between the STag and ETag of the encoding. |
float[] |
getGlobalMatrix()
Gets the global transform matrix of the associated VJoint |
List<GNode> |
getGNodes()
Returns a List with GNode children of this GNode. |
List<GShape> |
getGShapes()
Returns a List with the GShape children of this GNode. |
String |
getId()
Returns the id attribute. |
float[] |
getLocalMatrix()
Gets the local transform matrix of the associated VJoint |
String |
getName()
Returns the name attribute. |
GNode |
getParent()
Returns the parent GNode of this GNode, which could be null. |
GNode |
getPartById(String id)
Searches for a GNode with specified id. |
GNode |
getPartByNamePattern(Pattern namePat)
Searches for a GNode with a name matching the specified (java.util.regex) regular pattern. |
GNode |
getPartByNamePattern(String namePattern)
Searches for a GNode with a name matching the specified regular pattern. |
GNode |
getPartBySid(String sid)
Searches for a GNode with specified sid. |
String |
getSid()
Returns the Collada sid attribute. |
void |
getTranslation(float[] result)
|
String |
getType()
Returns the Collada type attribute. |
VJoint |
getVJoint()
|
String |
getXMLTag()
returns the XML tag for XML encoding |
boolean |
hasGShapes()
Determines whether a GNode based scene graph, with this GNode as root, includes some GShapes at all. |
void |
removeGNode(GNode sn)
Removes the specified GNode from the List of child gnodes. |
void |
removeLinearTransforms()
Removes the scaling and rotation transformations from this scenegraph by applying the linear part of the transformations to geometry. |
void |
removeLinearTransforms(float[] mat3x3)
Removes the linear component of the transform of this GNode and its descendant. |
void |
renameJoints(Map<String,String> renaming)
recursively renames the sids and names of GNodes |
List<GNode> |
selectGNodes()
Selects recursively all offspring |
List<GNode> |
selectGNodes(GNode.Predicate select)
Selects recursively all child GNodes that satisfy the predicate |
List<GNode> |
selectGNodes(GNode.Predicate select,
GNode.Predicate prune)
Selects recursively child GNodes that satisfy the predicate. |
List<GNode> |
selectGNodes(GNode.Predicate select,
GNode.Predicate prune,
ArrayList<GNode> list)
Selects recursively child GNodes that satisfy the predicate. |
void |
setId(String id)
Sets the id attribute. |
void |
setLocalTransform(float[] m)
Sets the local transform matrix of the associated VJoint |
void |
setName(String name)
Sets the name attribute. |
void |
setRotation(float[] rotation)
Sets the rotation quaternion of the associated VJoint |
void |
setScale(float[] scaleVec)
Sets the scale vector of the associated VJoint |
void |
setSid(String sid)
Sets the Collada sid attribute. |
void |
setSkewMatrix(float[] skewMatrix)
Sets the skewing matrix of the associated VJoint |
void |
setTranslation(float[] translation)
Sets the translation of the associated VJoint |
void |
setType(String type)
Sets the Collada type attribute. |
String |
toString()
Returns the XML encoding of this GNode |
static String |
xmlTag()
The XML tag for XML encoding |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private String id
private String sid
private String name
private String type
private GNode parent
private List<GNode> gnodes
private List<GShape> gshapes
private VJoint joint
private static final List<GNode> EMPTYGNODELIST
private static final List<GShape> EMPTYGSHAPELIST
private float[] vec
private static final int LISTSIZE
private static final String XMLTAG
| Constructor Detail |
|---|
public GNode()
public GNode(String id)
public GNode(XMLTokenizer tokenizer)
throws IOException
IOException| Method Detail |
|---|
public void setId(String id)
public String getId()
public void setSid(String sid)
public String getSid()
public void setName(String name)
public String getName()
public void setType(String type)
public String getType()
public List<GNode> selectGNodes()
public List<GNode> selectGNodes(GNode.Predicate select)
public List<GNode> selectGNodes(GNode.Predicate select,
GNode.Predicate prune)
public List<GNode> selectGNodes(GNode.Predicate select,
GNode.Predicate prune,
ArrayList<GNode> list)
public VJoint getVJoint()
public void addGNode(GNode sn)
public void removeGNode(GNode sn)
public List<GNode> getGNodes()
public GNode getParent()
public void addGShape(GShape gshape)
public void addGShapes(List<GShape> gshapeList)
public List<GShape> getGShapes()
public boolean hasGShapes()
public GNode getPartBySid(String sid)
public GNode getPartById(String id)
public GNode getPartByNamePattern(String namePattern)
public GNode getPartByNamePattern(Pattern namePat)
public void renameJoints(Map<String,String> renaming)
public void setTranslation(float[] translation)
public void getTranslation(float[] result)
public void setRotation(float[] rotation)
public void setScale(float[] scaleVec)
public void setSkewMatrix(float[] skewMatrix)
public void setLocalTransform(float[] m)
public float[] getLocalMatrix()
public float[] getGlobalMatrix()
public void clearLocalLinearTransform()
public void clearRotations()
public void clearJointRotations()
public void affineTransform(float[] mat4x4)
public void affineTransformGShapes(float[] mat4x4)
public void removeLinearTransforms()
public void removeLinearTransforms(float[] mat3x3)
public String toString()
toString in class XMLStructureAdapterpublic StringBuilder appendAttributes(StringBuilder buf)
appendAttributes in class XMLStructureAdapter
public void decodeAttributes(HashMap<String,String> attrMap,
XMLTokenizer tokenizer)
decodeAttributes in class XMLStructureAdapter
public StringBuilder appendContent(StringBuilder buf,
XMLFormatting fmt)
XMLStructureAdapter
appendContent in class XMLStructureAdapter
public void decodeContent(XMLTokenizer tokenizer)
throws IOException
XMLStructureAdapter
decodeContent in class XMLStructureAdapterIOExceptionpublic static String xmlTag()
public String getXMLTag()
getXMLTag in interface XMLStructuregetXMLTag in class XMLStructureAdapter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||