Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
edu.tum.cs.vis.model.parser.ColladaParser Class Reference
Inheritance diagram for edu.tum.cs.vis.model.parser.ColladaParser:
Inheritance graph
[legend]

List of all members.

Protected Member Functions

boolean loadModel (String filename)

Private Member Functions

void parseNode (Node node, Group currGroup, ArrayList< BaseXform > transformations, Collada collada)

Static Private Member Functions

static Appearance getAppearance (Material mat, Collada collada)
static String getDaeLocation (String tmpPath)
static String getNodeValue (NodeList nList, LinkedList< String > nodeNames)
static ArrayList< VertexgetVerticesOfMesh (Mesh m, List< Input > inputs, String type)
static void parseGeometry (Geometry g, Group currGroup, Map< String, String > instanceMaterial, List< BaseXform > transformations, Collada collada)
static void parseGeometryLine (Lines l, Group currGroup, Map< String, String > instanceMaterial, Collada collada, List< Vertex > vertices)
static void parseGeometryTriangle (Triangles t, Group currGroup, Map< String, String > instanceMaterial, Collada collada, List< Vertex > vertices, Mesh m)
static float[][] SourceToFloat (Source s)
static void useTransformation (Vertex vertex, List< BaseXform > transformations, boolean withTranslate)

Private Attributes

String textureBasePath = ""

Detailed Description

Connection between dae4j library and processing applet. Used to parse COLLADA (.dae) files and draw them on the processing applet. Also .kmz files are supported. These are exctracted to tmp dir and the dae file init will be loaded.

Author:
Stefan Profanter

Definition at line 71 of file ColladaParser.java.


Member Function Documentation

static Appearance edu.tum.cs.vis.model.parser.ColladaParser.getAppearance ( Material  mat,
Collada  collada 
) [inline, static, private]

Returns the instantiated Apperance by reading the material information from mat.

Parameters:
matCollada Material which holds information about the appearance
colladaCollada structure
Returns:
Instance of Apperance set according to mat.

Definition at line 82 of file ColladaParser.java.

static String edu.tum.cs.vis.model.parser.ColladaParser.getDaeLocation ( String  tmpPath) [inline, static, private]

Tries to determine the location of the .dae file when a .kmz file was extracted. The path to the .dae file is stored in the doc.kml file withing the zipped kmz.

Parameters:
tmpPathPath to the extracted .kmz file
Returns:
Absolute path to the .dae file or null if not found.

Definition at line 164 of file ColladaParser.java.

static String edu.tum.cs.vis.model.parser.ColladaParser.getNodeValue ( NodeList  nList,
LinkedList< String >  nodeNames 
) [inline, static, private]

Searches in the given nList nodes tree for the node represented by nodeNames and returns the inner value of this node.

Parameters:
nListthe list of all nodes (returned by getElementsByTagName)
nodeNamesA linked list with the structure to search. The first name is the name of the root, the next name is the name of the child to search in the root and so on.
Returns:
The inner value of the node or null if not found

Definition at line 225 of file ColladaParser.java.

static ArrayList<Vertex> edu.tum.cs.vis.model.parser.ColladaParser.getVerticesOfMesh ( Mesh  m,
List< Input inputs,
String  type 
) [inline, static, private]

Get all vertices of mesh object m in an array.

Parameters:
mthe mesh object
inputslist of all vertices
typetype of vertices
Returns:
list of all vertices which match given constraints.

Definition at line 276 of file ColladaParser.java.

boolean edu.tum.cs.vis.model.parser.ColladaParser.loadModel ( String  filename) [inline, protected, virtual]

This function will be called from parseModel if the model isn't in the Buffer

Parameters:
filenamePhysical file of model to parse
Returns:
true if model parsed successfully. false otherwise

Implements edu.tum.cs.vis.model.parser.ModelParser.

Definition at line 585 of file ColladaParser.java.

static void edu.tum.cs.vis.model.parser.ColladaParser.parseGeometry ( Geometry  g,
Group  currGroup,
Map< String, String >  instanceMaterial,
List< BaseXform >  transformations,
Collada  collada 
) [inline, static, private]

Parse a geometry object from the collada structure

Parameters:
gGeometry object to parse
currGroupgroup of which the current geometry is part of. Used to add all found vertices to the group's vertices list.
instanceMaterialList of all known materials which may be referred by the geometry object
transformationsList of all parent transformations which should be applied to this and it's subsequent geometries
colladathe collada Structure

Definition at line 314 of file ColladaParser.java.

static void edu.tum.cs.vis.model.parser.ColladaParser.parseGeometryLine ( Lines  l,
Group  currGroup,
Map< String, String >  instanceMaterial,
Collada  collada,
List< Vertex vertices 
) [inline, static, private]

Parse a line from a geometry object from the collada structure.

Parameters:
lthe line object to parse
currGroupgroup of which the current geometry is part of. Used to add all found vertices to the group's vertices list.
instanceMaterialList of all known materials which may be referred by the geometry object
colladathe collada Structure
verticesList of vertices of the line.

Definition at line 358 of file ColladaParser.java.

static void edu.tum.cs.vis.model.parser.ColladaParser.parseGeometryTriangle ( Triangles  t,
Group  currGroup,
Map< String, String >  instanceMaterial,
Collada  collada,
List< Vertex vertices,
Mesh  m 
) [inline, static, private]

Parse a triangle from a geometry object from the collada structure.

Parameters:
tthe line object to parse
mparent mesh for the triangle
instanceMaterialList of all known materials which may be referred by the geometry object
colladathe collada Structure
verticesList of vertices of the line.
currGroupgroup of which the current geometry is part of. Used to add all found vertices to the group's vertices list.

Definition at line 427 of file ColladaParser.java.

void edu.tum.cs.vis.model.parser.ColladaParser.parseNode ( Node  node,
Group  currGroup,
ArrayList< BaseXform >  transformations,
Collada  collada 
) [inline, private]

Parses a node from the collada structure and stores the triangles and lines information.

Parameters:
nodeNode to parse (may have other sub-Nodes => called recursively)
currGroupGroup of which the node is part of.
transformationsList of all parent transformations which should be applied to this and it's subsequent nodes
colladathe collada Structure

Definition at line 667 of file ColladaParser.java.

static float [][] edu.tum.cs.vis.model.parser.ColladaParser.SourceToFloat ( Source  s) [inline, static, private]

Convert a collada source item to the corresponding float array

Parameters:
scollada source
Returns:
float array with float[count][stride]

Definition at line 530 of file ColladaParser.java.

static void edu.tum.cs.vis.model.parser.ColladaParser.useTransformation ( Vertex  vertex,
List< BaseXform >  transformations,
boolean  withTranslate 
) [inline, static, private]

Applies the list of transformations in the correct order to the vertex

Parameters:
vertexvertex to apply the transformation onto
transformationslist of transformations to apply
withTranslateif false, only rotation part of transformation matrix is applied. If true, the vertex is also translated according to the transformation matrix.

Definition at line 550 of file ColladaParser.java.


Member Data Documentation

Base path of the texture files. In the dae file are only relative paths. So we need a base. If kmz is parsed, this will be set automatically

Definition at line 582 of file ColladaParser.java.


The documentation for this class was generated from the following file:


knowrob_cad_parser
Author(s): Stefan Profanter
autogenerated on Sat Dec 28 2013 17:09:45