Class DefaultModelParser

java.lang.Object
  |
  +--ModelParser
        |
        +--DefaultModelParser

public class DefaultModelParser
extends ModelParser

A class to encapsulate the default functionality required to properly parse a model file representing a 3D object. This class acts as a wrapper for the uses the ObjectFile class, which reads in 3D files in the Wavefront .obj file format. At present the ObjectFile implementation provided by Sun is not capable of parsing color, appearance, and texture attributes from the .obj file, although it is assumed that this functionality will be provided in the future.

See Also:
ModelParser, ObjectFile

Constructor Summary
protected DefaultModelParser()
          The default constructor which retrieves the language properties, fill the resource table, and initializes the class variables.
 
Method Summary
 void fillResources()
          Fills up the resources using the hardcoded and soft-loaded resources.
 javax.media.j3d.Group getModel()
          Returns a Group representation of a parsed file.
 void read(java.lang.String filename)
          Reads in the specified configuration from a specified file.
 
Methods inherited from class ModelParser
loadParser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultModelParser

protected DefaultModelParser()
The default constructor which retrieves the language properties, fill the resource table, and initializes the class variables.
Method Detail

fillResources

public void fillResources()
Fills up the resources using the hardcoded and soft-loaded resources.

read

public void read(java.lang.String filename)
          throws ModelParserException
Reads in the specified configuration from a specified file.
Parameters:
filename - the name of the file to parse for 3D information.
Throws:
ModelParserException - thrown if an error occurs.
Overrides:
read in class ModelParser

getModel

public javax.media.j3d.Group getModel()
                               throws ModelParserException
Returns a Group representation of a parsed file. This function requires the model file has been parsed, otherwise resulting in an exception.
Returns:
Model the representation of the model file.
Throws:
ModelParserException - indicates the model is empty.
Overrides:
getModel in class ModelParser