|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.loaders.ac3d.Ac3dParser
public class Ac3dParser
AC3DFileParser
handles the work of parsing the AC3D data
from a stream. Since the AC3D file format is not only ASCII based, but
also formatted using lines, this gets away with just using a
BufferedReader
and picking off the lines one by one.
Although this parser was implemented to facilitate building an AC3D file loader for importing models into Java3D, this parser aims to be independant of the Java3D API. The intention is to be able to leverage this code in other applications, as well. (Perhaps in a command line format conversion tool...) Thus, the separation of Java3D and parsing code.
Internationalisation Resource Names
Field Summary | |
---|---|
static int |
SUPPORTED_FORMAT_VERSION
The latest version of the file format this parser supports. |
Constructor Summary | |
---|---|
Ac3dParser()
Construct a default parser that does not have an input source. |
|
Ac3dParser(java.io.Reader rdr)
Construct a new parser that sources the data from the given reader. |
Method Summary | |
---|---|
Ac3dMaterial[] |
getMaterials()
Fetch the materials from the previously loaded file. |
Ac3dObject[] |
getObjects()
Fetch the objects from the previously loaded file. |
void |
parse(boolean retainData)
Performs the action of parsing the data stream already set. |
void |
reset(java.io.Reader rdr)
Reset the parser with a new input reader. |
void |
setErrorReporter(ErrorReporter reporter)
Register an error reporter with the engine so that any errors generated by the parsing internals can be reported in a nice, pretty fashion. |
void |
setParseObserver(Ac3dParseObserver obs)
Set the observer for parsing events that can be used with this class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SUPPORTED_FORMAT_VERSION
Constructor Detail |
---|
public Ac3dParser()
public Ac3dParser(java.io.Reader rdr)
rdr
- The reader instance to useMethod Detail |
---|
public void setErrorReporter(ErrorReporter reporter)
reporter
- The instance to use or nullpublic void setParseObserver(Ac3dParseObserver obs)
obs
- The observer instance to usepublic void parse(boolean retainData) throws java.io.IOException
retainData
- true if the parser should maintain a copy of all the
data read locally after completing parsing
InvalidFormatException
- The file format does not match the
expected format for AC3D
UnsupportedFormatException
- The format provided is later version
than what we currently support
java.io.IOException
- An I/O error occurred while processing the filepublic void reset(java.io.Reader rdr)
rdr
- The new reader instance to usepublic Ac3dMaterial[] getMaterials()
public Ac3dObject[] getObjects()
|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |