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< Vertex > | getVerticesOfMesh (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 = "" |
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.
Definition at line 71 of file ColladaParser.java.
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.
mat | Collada Material which holds information about the appearance |
collada | Collada structure |
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.
tmpPath | Path to the extracted .kmz file |
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.
nList | the list of all nodes (returned by getElementsByTagName) |
nodeNames | A 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. |
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.
m | the mesh object |
inputs | list of all vertices |
type | type of vertices |
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
filename | Physical file of model to parse |
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
g | Geometry object to parse |
currGroup | group of which the current geometry is part of. Used to add all found vertices to the group's vertices list. |
instanceMaterial | List of all known materials which may be referred by the geometry object |
transformations | List of all parent transformations which should be applied to this and it's subsequent geometries |
collada | the 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.
l | the line object to parse |
currGroup | group of which the current geometry is part of. Used to add all found vertices to the group's vertices list. |
instanceMaterial | List of all known materials which may be referred by the geometry object |
collada | the collada Structure |
vertices | List 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.
t | the line object to parse |
m | parent mesh for the triangle |
instanceMaterial | List of all known materials which may be referred by the geometry object |
collada | the collada Structure |
vertices | List of vertices of the line. |
currGroup | group 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.
node | Node to parse (may have other sub-Nodes => called recursively) |
currGroup | Group of which the node is part of. |
transformations | List of all parent transformations which should be applied to this and it's subsequent nodes |
collada | the 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
s | collada source |
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
vertex | vertex to apply the transformation onto |
transformations | list of transformations to apply |
withTranslate | if 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.
String edu.tum.cs.vis.model.parser.ColladaParser.textureBasePath = "" [private] |
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.