|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.j3d.loaders.lw3d.ParserObject
com.sun.j3d.loaders.lw3d.LwoParser
class LwoParser
This class is responsible for parsing a binary Object file and storing
the data. This class is not called directly, but is the parent class of
J3dLwoObject. The subclass calls this class to parse the file, then it
turns the resulting data into Java3D objects. LwoObject instantiates
an LWOBFileReader object to parse the data. Then the class creates a
list of ShapeHolder objects to hold all of the vertex/facet data and
surface references and creates a list of LwoSurface objects to hold
the data for each surface.
Rather than describe in detail how the file is parsed for each method,
I advise the user of this code to understand the lw3d file format
specs, which are pretty clear.
Field Summary | |
---|---|
(package private) int |
blue
|
(package private) float[] |
coordsArray
|
(package private) int |
currLength
|
(package private) float |
diffuse
|
(package private) int[] |
facetIndicesArray
|
(package private) int[] |
facetSizesArray
|
(package private) int |
gloss
|
(package private) int |
green
|
(package private) float |
luminosity
|
(package private) float[] |
normalCoordsArray
|
(package private) int[] |
normalIndicesArray
|
(package private) int |
red
|
(package private) java.util.Vector |
shapeList
|
(package private) float |
specular
|
(package private) java.util.Vector |
surfaceList
|
(package private) java.util.Vector |
surfNameList
|
(package private) LWOBFileReader |
theReader
|
(package private) float |
transparency
|
Fields inherited from class com.sun.j3d.loaders.lw3d.ParserObject |
---|
debugPrinter, EXCEPTION, LINE_TRACE, MISC, NONE, TIME, TRACE, VALUES, WARNING |
Constructor Summary | |
---|---|
LwoParser(java.lang.String fileName,
int debugVals)
Constructor: Creates file reader and calls parseFile() to actually read the file and grab the data |
|
LwoParser(java.net.URL url,
int debugVals)
|
Method Summary | |
---|---|
(package private) ShapeHolder |
getAppropriateShape(int numSurf,
int numVerts)
Returns already-existing ShapeHolder if one exists with the same surface and the same geometry type (point, line, or poly) |
(package private) void |
getPnts(int length)
Parses file to get all vertices |
(package private) void |
getPols(int length)
Parse the file for all the data for a POLS object (polygon description) |
(package private) void |
getSrfs(int length)
Parses file to get the names of all surfaces. |
(package private) void |
getSurf(int length)
Creates new LwoSurface object that parses file and gets all surface parameters for a particular surface |
(package private) static void |
main(java.lang.String[] args)
This method is used only for testing |
(package private) int |
parseFile()
parses entire file. |
(package private) int |
skipDetailPolygons(int numPolys)
Detail polygons are currently not implemented by this loader. |
Methods inherited from class com.sun.j3d.loaders.lw3d.ParserObject |
---|
debugOutput, debugOutputLn |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
LWOBFileReader theReader
int currLength
float[] coordsArray
float[] normalCoordsArray
int[] facetIndicesArray
int[] facetSizesArray
int[] normalIndicesArray
int red
int green
int blue
float diffuse
float specular
float transparency
float luminosity
int gloss
java.util.Vector surfNameList
java.util.Vector surfaceList
java.util.Vector shapeList
Constructor Detail |
---|
LwoParser(java.lang.String fileName, int debugVals) throws java.io.FileNotFoundException
java.io.FileNotFoundException
LwoParser(java.net.URL url, int debugVals) throws java.io.FileNotFoundException
java.io.FileNotFoundException
Method Detail |
---|
int skipDetailPolygons(int numPolys) throws ParsingErrorException
ParsingErrorException
ShapeHolder getAppropriateShape(int numSurf, int numVerts)
void getPols(int length)
void getSrfs(int length)
void getPnts(int length) throws ParsingErrorException
ParsingErrorException
void getSurf(int length) throws java.io.FileNotFoundException
java.io.FileNotFoundException
int parseFile() throws java.io.FileNotFoundException, IncorrectFormatException
java.io.FileNotFoundException
IncorrectFormatException
static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |