$search

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, HashMap< String, String > instanceMaterial, ArrayList< BaseXform > transformations, Collada collada)
static void parseGeometryLine (Lines l, Group currGroup, HashMap< String, String > instanceMaterial, Collada collada, ArrayList< Vertex > vertices)
static void parseGeometryTriangle (Triangles t, Group currGroup, HashMap< String, String > instanceMaterial, Collada collada, ArrayList< Vertex > vertices, Mesh m)
static float[][] SourceToFloat (Source s)
static void useTransformation (Vertex vertex, ArrayList< 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 70 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:
mat Collada Material which holds information about the appearance
collada Collada structure
Returns:
Instance of Apperance set according to mat.

Definition at line 81 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:
tmpPath Path to the extracted .kmz file
Returns:
Absolute path to the .dae file or null if not found.

Definition at line 163 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:
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.
Returns:
The inner value of the node or null if not found

Definition at line 224 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:
m the mesh object
inputs list of all vertices
type type of vertices
Returns:
list of all vertices which match given constraints.

Definition at line 275 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:
filename Physical file of model to parse
Returns:
true if model parsed successfully. false otherwise

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

Definition at line 578 of file ColladaParser.java.

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

Parse a geometry object from the collada structure

Parameters:
g Geometry object to parse
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 310 of file ColladaParser.java.

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

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

Parameters:
l the line object to parse
m parent mesh for the line
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 355 of file ColladaParser.java.

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

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

Parameters:
t the line object to parse
m parent mesh for the line
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 422 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:
node Node to parse (may have other sub-Nodes => called recursively)
transformations List of all parent transformations which should be applied to this and it's subsequent nodes
collada the collada Structure

Definition at line 658 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:
the collada source
Returns:
float array with float[count][stride]

Definition at line 526 of file ColladaParser.java.

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

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

Parameters:
vertex vertex to apply the transformation onto
transformations list of transformations to apply

Definition at line 543 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 575 of file ColladaParser.java.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


knowrob_cad_parser
Author(s): Stefan Profanter
autogenerated on Tue Mar 5 12:15:34 2013