Package gov.nasa.worldwind.ogc.collada
Class ColladaNode
- java.lang.Object
-
- gov.nasa.worldwind.util.xml.AbstractXMLEventParser
-
- gov.nasa.worldwind.ogc.collada.ColladaAbstractObject
-
- 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
Fields Modifier and Type Field Description protected java.util.List<ColladaRenderable>
children
Children of this node.protected java.util.List<ColladaInstanceGeometry>
geometries
Geometries defined in this node.protected Matrix
matrix
Transform matrix for this node.protected java.util.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
Constructors Constructor Description ColladaNode(java.lang.String ns)
Construct an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<ColladaMeshShape>
createShapes()
Create shapes to render this node.protected void
createShapesForGeometry(ColladaInstanceGeometry geomInstance, java.util.List<ColladaMeshShape> shapes)
Create shapes for a geometry.protected java.util.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(java.lang.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(java.lang.String keyName, java.lang.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, setNamespaceURI, setParent
-
-
-
-
Field Detail
-
children
protected java.util.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 java.util.List<ColladaInstanceGeometry> geometries
Geometries defined in this node.
-
shapes
protected java.util.List<ColladaMeshShape> shapes
Shape used to render geometry in this node.
-
matrix
protected Matrix matrix
Transform matrix for this node.
-
-
Method Detail
-
getLocalExtent
public Box getLocalExtent(ColladaTraversalContext tc)
Description copied from class:ColladaAbstractObject
Returns this renderable's model coordinate extent.- Specified by:
getLocalExtent
in interfaceColladaRenderable
- Overrides:
getLocalExtent
in classColladaAbstractObject
- Parameters:
tc
- The traversal context to use when determining the extent.- Returns:
- The model coordinate extent.
-
preRender
public void preRender(ColladaTraversalContext tc, DrawContext dc)
Pre-Render this element.- Specified by:
preRender
in interfaceColladaRenderable
- 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 interfaceColladaRenderable
- Parameters:
tc
- the current COLLADA traversal context.dc
- the current draw context.
-
createShapes
protected java.util.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, java.util.List<ColladaMeshShape> shapes)
Create shapes for a geometry.- Parameters:
geomInstance
- Geometry for which to create shapes.shapes
- List to collect the new shapes.
-
setField
public void setField(java.lang.String keyName, java.lang.Object value)
- Overrides:
setField
in classAbstractXMLEventParser
-
getChildren
protected java.util.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.
-
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(java.lang.String doubleArrayString)
Parse a string of doubles into a double[].- Parameters:
doubleArrayString
- String of doubles, separated by whitespace.- Returns:
- Parsed double[]
-
-