Public Member Functions | |
Model | getModel () |
boolean | parseModel (String filename) |
Static Public Member Functions | |
static Class<?extends ModelParser > | findParser (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, Model > | modelBuffer = new HashMap<String, Model>() |
Base class for all ModelParsers. Used to parse models from file an draw them onto the Processing applet.
Definition at line 27 of file ModelParser.java.
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
filename | file to check |
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.
filename | Filename to find parser for |
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
filename | The filename |
Definition at line 69 of file ModelParser.java.
Model edu.tum.cs.vis.model.parser.ModelParser.getModel | ( | ) | [inline] |
Get the object containing the model (meshes)
Definition at line 99 of file ModelParser.java.
String edu.tum.cs.vis.model.parser.ModelParser.getValidExtensions | ( | ) | [inline, protected] |
Returns a comma separated string with all valid file extensions of this class
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.
filename | Filename to check |
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
filename | Physical file of model to parse |
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.
filename | Physical file of model to parse |
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.
vertices | list of all vertices for polygon |
Definition at line 186 of file ModelParser.java.
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.
Model edu.tum.cs.vis.model.parser.ModelParser.model [protected] |
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.