Package org.sunflow.core.parser
Class SCAbstractParser
- java.lang.Object
-
- org.sunflow.core.parser.SCAbstractParser
-
- All Implemented Interfaces:
SceneParser
- Direct Known Subclasses:
SCAsciiParser,SCBinaryParser
public abstract class SCAbstractParser extends java.lang.Object implements SceneParser
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSCAbstractParser.Keyword
-
Constructor Summary
Constructors Constructor Description SCAbstractParser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidcloseParser()protected abstract voidopenParser(java.lang.String filename)booleanparse(java.lang.String filename, SunflowAPIInterface api)Parse the specified file to create a scene description into the providedSunflowAPIobject.protected abstract booleanparseBoolean()protected abstract floatparseFloat()protected float[]parseFloatArray(int size)protected abstract intparseInt()private int[]parseIntArray(int size)protected abstract ParameterList.InterpolationTypeparseInterpolationType()protected abstract SCAbstractParser.KeywordparseKeyword()protected abstract Matrix4parseMatrix()private float[]parseMatrixArray(int size)private voidparseParameter(SunflowAPIInterface api)private Point3parsePoint()protected abstract java.lang.StringparseString()private java.lang.String[]parseStringArray(int size)private Point2parseTexcoord()private Vector3parseVector()protected abstract java.lang.StringparseVerbatimString()
-
-
-
Method Detail
-
parse
public boolean parse(java.lang.String filename, SunflowAPIInterface api)Description copied from interface:SceneParserParse the specified file to create a scene description into the providedSunflowAPIobject.- Specified by:
parsein interfaceSceneParser- Parameters:
filename- filename to parseapi- scene to parse the file into- Returns:
trueupon sucess, orfalseif errors have occured.
-
parseParameter
private void parseParameter(SunflowAPIInterface api) throws java.io.IOException
- Throws:
java.io.IOException
-
parseStringArray
private java.lang.String[] parseStringArray(int size) throws java.io.IOException- Throws:
java.io.IOException
-
parseIntArray
private int[] parseIntArray(int size) throws java.io.IOException- Throws:
java.io.IOException
-
parseFloatArray
protected float[] parseFloatArray(int size) throws java.io.IOException- Throws:
java.io.IOException
-
parseMatrixArray
private float[] parseMatrixArray(int size) throws java.io.IOException- Throws:
java.io.IOException
-
parsePoint
private Point3 parsePoint() throws java.io.IOException
- Throws:
java.io.IOException
-
parseVector
private Vector3 parseVector() throws java.io.IOException
- Throws:
java.io.IOException
-
parseTexcoord
private Point2 parseTexcoord() throws java.io.IOException
- Throws:
java.io.IOException
-
parseInterpolationType
protected abstract ParameterList.InterpolationType parseInterpolationType() throws java.io.IOException
- Throws:
java.io.IOException
-
openParser
protected abstract void openParser(java.lang.String filename) throws java.io.IOException- Throws:
java.io.IOException
-
closeParser
protected abstract void closeParser() throws java.io.IOException- Throws:
java.io.IOException
-
parseKeyword
protected abstract SCAbstractParser.Keyword parseKeyword() throws java.io.IOException
- Throws:
java.io.IOException
-
parseBoolean
protected abstract boolean parseBoolean() throws java.io.IOException- Throws:
java.io.IOException
-
parseInt
protected abstract int parseInt() throws java.io.IOException- Throws:
java.io.IOException
-
parseFloat
protected abstract float parseFloat() throws java.io.IOException- Throws:
java.io.IOException
-
parseString
protected abstract java.lang.String parseString() throws java.io.IOException- Throws:
java.io.IOException
-
parseVerbatimString
protected abstract java.lang.String parseVerbatimString() throws java.io.IOException- Throws:
java.io.IOException
-
parseMatrix
protected abstract Matrix4 parseMatrix() throws java.io.IOException
- Throws:
java.io.IOException
-
-