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

List of all members.

Public Member Functions

Model getModel ()
boolean parseModel (String filename)

Static Public Member Functions

static Class<?extends ModelParserfindParser (String filename)
static int[] polygonTriangulation (Vertex vertices[])

Protected Member Functions

boolean checkExtension (String filename)
String getValidExtensions ()
boolean isValidExtension (String filename)
abstract boolean loadModel (String filename)

Static Protected Member Functions

static String getExtension (String filename)

Protected Attributes

Model model

Static Package Functions

 [static initializer]

Static Private Attributes

static final HashMap< String,
Class<?extends ModelParser > > 
extensionAssignment = new HashMap<String, Class<? extends ModelParser>>()
static HashMap< String, ModelmodelBuffer = new HashMap<String, Model>()

Detailed Description

Base class for all ModelParsers. Used to parse models from file an draw them onto the Processing applet.

Author:
Stefan Profanter

Definition at line 27 of file ModelParser.java.


Member Function Documentation

edu.tum.cs.vis.model.parser.ModelParser.[static initializer] ( ) [inline, static, package]
boolean edu.tum.cs.vis.model.parser.ModelParser.checkExtension ( String  filename) [inline, protected]

Checks if the file extension is valid for this class

Parameters:
filenamefile to check
Returns:
true if extension is valid for this class. false otherwise

Definition at line 85 of file ModelParser.java.

static Class<? extends ModelParser> edu.tum.cs.vis.model.parser.ModelParser.findParser ( String  filename) [inline, static]

Finds the appropriate parser for the given filename by comparing the file extension.

Parameters:
filenameFilename to find parser for
Returns:
the Parser Class for this file

Definition at line 58 of file ModelParser.java.

static String edu.tum.cs.vis.model.parser.ModelParser.getExtension ( String  filename) [inline, static, protected]

Gets the filename extension of a filename. Usually the last 3 characters

Parameters:
filenameThe filename
Returns:
the extension without dot

Definition at line 69 of file ModelParser.java.

Get the object containing the model (meshes)

Returns:
the model member

Definition at line 99 of file ModelParser.java.

Returns a comma separated string with all valid file extensions of this class

Returns:
List of file extensions: eg "kmz, dae,"

Definition at line 108 of file ModelParser.java.

boolean edu.tum.cs.vis.model.parser.ModelParser.isValidExtension ( String  filename) [inline, protected]

Checks if the given filename has a valid extension for the extended class.

Parameters:
filenameFilename to check
Returns:
true if extension is valid

Definition at line 127 of file ModelParser.java.

abstract boolean edu.tum.cs.vis.model.parser.ModelParser.loadModel ( String  filename) [protected, pure 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

Implemented in edu.tum.cs.vis.model.parser.ColladaParser, edu.tum.cs.vis.model.parser.PlyParser, and edu.tum.cs.vis.model.parser.CustomParser.

boolean edu.tum.cs.vis.model.parser.ModelParser.parseModel ( String  filename) [inline]

Main function to parse the model from the given filename. If model has already been parsed, it will be taken from modelBuffer instead of parsing it again.

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

Definition at line 150 of file ModelParser.java.

static int [] edu.tum.cs.vis.model.parser.ModelParser.polygonTriangulation ( Vertex  vertices[]) [inline, static]

Split polygon into triangles. Build in GeometryInfo class is used. New vertex indices are then returned.

Parameters:
verticeslist of all vertices for polygon
Returns:
list of vertex indices for triangles

Definition at line 186 of file ModelParser.java.


Member Data Documentation

final HashMap<String, Class<? extends ModelParser> > edu.tum.cs.vis.model.parser.ModelParser.extensionAssignment = new HashMap<String, Class<? extends ModelParser>>() [static, private]

Contains for each valid file extension the appropriate parser. Used to automatically determine the correct parser for a file.

Definition at line 33 of file ModelParser.java.

Contains mesh of the model

Definition at line 76 of file ModelParser.java.

HashMap<String, Model> edu.tum.cs.vis.model.parser.ModelParser.modelBuffer = new HashMap<String, Model>() [static, private]

This is a buffer for already parsed models. If a model is loaded through parseModel method it will be stored in this HashMap. It it is loaded a second time, instead of parsing it again it will be taken from this HashMap

Definition at line 49 of file ModelParser.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