NASA World Wind

gov.nasa.worldwind.ogc.collada
Class ColladaNode

java.lang.Object
  extended by gov.nasa.worldwind.util.xml.AbstractXMLEventParser
      extended by gov.nasa.worldwind.ogc.collada.ColladaAbstractObject
          extended by gov.nasa.worldwind.ogc.collada.ColladaNode
All Implemented Interfaces:
ColladaRenderable, XMLEventParser

public class ColladaNode
extends ColladaAbstractObject
implements ColladaRenderable

Represents the COLLADA node element and provides access to its contents.


Field Summary
protected  List<ColladaRenderable> children
          Children of this node.
protected  List<ColladaInstanceGeometry> geometries
          Geometries defined in this node.
protected  Matrix matrix
          Transform matrix for this node.
protected  List<ColladaMeshShape> shapes
          Shape used to render geometry in this node.
 
Fields inherited from class gov.nasa.worldwind.util.xml.AbstractXMLEventParser
CHARACTERS_CONTENT, fields, namespaceURI, parent
 
Constructor Summary
ColladaNode(String ns)
          Construct an instance.
 
Method Summary
protected  List<ColladaMeshShape> createShapes()
          Create shapes to render this node.
protected  void createShapesForGeometry(ColladaInstanceGeometry geomInstance, List<ColladaMeshShape> shapes)
          Create shapes for a geometry.
protected  List<ColladaRenderable> getChildren()
          Indicates the children of this node.
 Box getLocalExtent(ColladaTraversalContext tc)
          Returns this renderable's model coordinate extent.
protected  Matrix getMatrix()
          Indicates the transform matrix specified in this node.
protected  double[] parseDoubleArray(String doubleArrayString)
          Parse a string of doubles into a double[].
 void preRender(ColladaTraversalContext tc, DrawContext dc)
          Pre-Render this element.
 void render(ColladaTraversalContext tc, DrawContext dc)
          Render this element.
 void setField(String keyName, Object value)
           
 
Methods inherited from class gov.nasa.worldwind.ogc.collada.ColladaAbstractObject
getRoot
 
Methods inherited from class gov.nasa.worldwind.util.xml.AbstractXMLEventParser
allocate, doAddCharacters, doAddEventAttribute, doAddEventContent, doParseEventAttributes, doParseEventContent, freeResources, getAConstructor, getCharacters, getField, getField, getFields, getNamespaceURI, getParent, hasField, hasField, hasFields, mergeFields, newInstance, overrideFields, parse, parseCharacterContent, removeField, setField, setFields, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

children

protected List<ColladaRenderable> children
Children of this node. Children may be ColladaNode (direct child of this node) or ColladaInstanceNode (reference to a node elsewhere in the current document, or another document).


geometries

protected List<ColladaInstanceGeometry> geometries
Geometries defined in this node.


matrix

protected Matrix matrix
Transform matrix for this node.


shapes

protected List<ColladaMeshShape> shapes
Shape used to render geometry in this node.

Constructor Detail

ColladaNode

public ColladaNode(String ns)
Construct an instance.

Parameters:
ns - the qualifying namespace URI. May be null to indicate no namespace qualification.
Method Detail

createShapes

protected List<ColladaMeshShape> createShapes()
Create shapes to render this node.

Returns:
List shapes. The list may be empty, but will never be null.

createShapesForGeometry

protected void createShapesForGeometry(ColladaInstanceGeometry geomInstance,
                                       List<ColladaMeshShape> shapes)
Create shapes for a geometry.

Parameters:
geomInstance - Geometry for which to create shapes.
shapes - List to collect the new shapes.

getChildren

protected List<ColladaRenderable> getChildren()
Indicates the children of this node. Children may be other node elements contained directly within this node, or other nodes referenced indirectly by a instance_node element.

Returns:
List of children. The list may be empty, but will never be null.

getLocalExtent

public Box getLocalExtent(ColladaTraversalContext tc)
Description copied from class: ColladaAbstractObject
Returns this renderable's model coordinate extent.

Specified by:
getLocalExtent in interface ColladaRenderable
Overrides:
getLocalExtent in class ColladaAbstractObject
Parameters:
tc - The traversal context to use when determining the extent.
Returns:
The model coordinate extent.

getMatrix

protected Matrix getMatrix()
Indicates the transform matrix specified in this node.

Returns:
The matrix specified in this node. Returns the identity matrix if the node does not specify a matrix.

parseDoubleArray

protected double[] parseDoubleArray(String doubleArrayString)
Parse a string of doubles into a double[].

Parameters:
doubleArrayString - String of doubles, separated by whitespace.
Returns:
Parsed double[]

preRender

public void preRender(ColladaTraversalContext tc,
                      DrawContext dc)
Pre-Render this element.

Specified by:
preRender in interface ColladaRenderable
Parameters:
tc - the current COLLADA traversal context.
dc - the current draw context.

render

public void render(ColladaTraversalContext tc,
                   DrawContext dc)
Render this element.

Specified by:
render in interface ColladaRenderable
Parameters:
tc - the current COLLADA traversal context.
dc - the current draw context.

setField

public void setField(String keyName,
                     Object value)
Overrides:
setField in class AbstractXMLEventParser

NASA World Wind