Package org.sunflow.core
Class ParameterList
java.lang.Object
org.sunflow.core.ParameterList
- Direct Known Subclasses:
Options
This class holds a list of "parameters". These are defined and then passed
onto rendering objects through the API. They can hold arbitrary typed and
named variables as a unified way of getting data into user objects.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classRepresents an array of floating point values.static enumprotected static final class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBoolean(String name, boolean value) Add the specified boolean as a parameter.voidAdd the specified color as a parameter.voidAdd the specified float as a parameter.voidaddFloats(String name, ParameterList.InterpolationType interp, float[] data) Add the specified floats as a parameter.voidaddInteger(String name, int value) Add the specified integer as a parameter.voidaddIntegerArray(String name, int[] array) Add the specified array of integers as a parameter.voidaddMatrices(String name, ParameterList.InterpolationType interp, float[] data) Add the specified matrices as a parameter.voidaddPoints(String name, ParameterList.InterpolationType interp, float[] data) Add the specified points as a parameter.voidAdd the specified string as a parameter.voidaddStringArray(String name, String[] array) Add the specified array of integers as a parameter.voidaddTexCoords(String name, ParameterList.InterpolationType interp, float[] data) Add the specified texture coordinates as a parameter.voidaddVectors(String name, ParameterList.InterpolationType interp, float[] data) Add the specified vectors as a parameter.voidclear(boolean showUnused) Clears the list of all its members.booleangetBoolean(String name, boolean defaultValue) Get the specified boolean parameter from this list.Get the specified color parameter from this list.floatGet the specified float parameter from this list.getFloatArray(String name) Get the specified float array parameter from this list.intGet the specified integer parameter from this list.int[]getIntArray(String name) Get the specified integer array parameter from this list.Get the specified matrix parameter from this list.getMatrixArray(String name) Get the specified matrix array parameter from this list.final MovingMatrix4getMovingMatrix(String name, MovingMatrix4 defaultValue) Get the specified point parameter from this list.getPointArray(String name) Get the specified point array parameter from this list.Get the specified string parameter from this list.String[]getStringArray(String name, String[] defaultValue) Get the specified string array parameter from this list.getTexCoord(String name, Point2 defaultValue) Get the specified texture coordinate parameter from this list.getTexCoordArray(String name) Get the specified texture coordinate array parameter from this list.Get the specified vector parameter from this list.getVectorArray(String name) Get the specified vector array parameter from this list.voidsetFaceCount(int numFaces) Setup how many faces should be used to check member count on "face" interpolated parameters.voidsetFaceVertexCount(int numFaceVerts) Setup how many "face-vertices" should be used to check member count of "facevarying" interpolated parameters.voidsetVertexCount(int numVerts) Setup how many vertices should be used to check member count of "vertex" interpolated parameters.
-
Field Details
-
list
-
-
Constructor Details
-
ParameterList
public ParameterList()Creates an empty ParameterList.
-
-
Method Details
-
clear
public void clear(boolean showUnused) Clears the list of all its members. If some members were never used, a warning will be printed to remind the user something may be wrong. -
setFaceCount
public void setFaceCount(int numFaces) Setup how many faces should be used to check member count on "face" interpolated parameters.- Parameters:
numFaces- number of faces
-
setVertexCount
public void setVertexCount(int numVerts) Setup how many vertices should be used to check member count of "vertex" interpolated parameters.- Parameters:
numVerts- number of vertices
-
setFaceVertexCount
public void setFaceVertexCount(int numFaceVerts) Setup how many "face-vertices" should be used to check member count of "facevarying" interpolated parameters. This should be equal to the sum of the number of vertices on each face.- Parameters:
numFaceVerts- number of "face-vertices"
-
addString
Add the specified string as a parameter.nullvalues are not permitted.- Parameters:
name- parameter namevalue- parameter value
-
addInteger
Add the specified integer as a parameter.nullvalues are not permitted.- Parameters:
name- parameter namevalue- parameter value
-
addBoolean
Add the specified boolean as a parameter.nullvalues are not permitted.- Parameters:
name- parameter namevalue- parameter value
-
addFloat
Add the specified float as a parameter.nullvalues are not permitted.- Parameters:
name- parameter namevalue- parameter value
-
addColor
Add the specified color as a parameter.nullvalues are not permitted.- Parameters:
name- parameter namevalue- parameter value
-
addIntegerArray
Add the specified array of integers as a parameter.nullvalues are not permitted.- Parameters:
name- parameter namearray- parameter value
-
addStringArray
Add the specified array of integers as a parameter.nullvalues are not permitted.- Parameters:
name- parameter namearray- parameter value
-
addFloats
Add the specified floats as a parameter.nullvalues are not permitted.- Parameters:
name- parameter nameinterp- interpolation typedata- parameter value
-
addPoints
Add the specified points as a parameter.nullvalues are not permitted.- Parameters:
name- parameter nameinterp- interpolation typedata- parameter value
-
addVectors
Add the specified vectors as a parameter.nullvalues are not permitted.- Parameters:
name- parameter nameinterp- interpolation typedata- parameter value
-
addTexCoords
Add the specified texture coordinates as a parameter.nullvalues are not permitted.- Parameters:
name- parameter nameinterp- interpolation typedata- parameter value
-
addMatrices
Add the specified matrices as a parameter.nullvalues are not permitted.- Parameters:
name- parameter nameinterp- interpolation typedata- parameter value
-
getString
Get the specified string parameter from this list.- Parameters:
name- name of the parameterdefaultValue- value to return if not found- Returns:
- the value of the parameter specified or default value if not found
-
getStringArray
Get the specified string array parameter from this list.- Parameters:
name- name of the parameterdefaultValue- value to return if not found- Returns:
- the value of the parameter specified or default value if not found
-
getInt
Get the specified integer parameter from this list.- Parameters:
name- name of the parameterdefaultValue- value to return if not found- Returns:
- the value of the parameter specified or default value if not found
-
getIntArray
Get the specified integer array parameter from this list.- Parameters:
name- name of the parameter- Returns:
- the value of the parameter specified or
nullif not found
-
getBoolean
Get the specified boolean parameter from this list.- Parameters:
name- name of the parameterdefaultValue- value to return if not found- Returns:
- the value of the parameter specified or default value if not found
-
getFloat
Get the specified float parameter from this list.- Parameters:
name- name of the parameterdefaultValue- value to return if not found- Returns:
- the value of the parameter specified or default value if not found
-
getColor
Get the specified color parameter from this list.- Parameters:
name- name of the parameterdefaultValue- value to return if not found- Returns:
- the value of the parameter specified or default value if not found
-
getPoint
Get the specified point parameter from this list.- Parameters:
name- name of the parameterdefaultValue- value to return if not found- Returns:
- the value of the parameter specified or default value if not found
-
getVector
Get the specified vector parameter from this list.- Parameters:
name- name of the parameterdefaultValue- value to return if not found- Returns:
- the value of the parameter specified or default value if not found
-
getTexCoord
Get the specified texture coordinate parameter from this list.- Parameters:
name- name of the parameterdefaultValue- value to return if not found- Returns:
- the value of the parameter specified or default value if not found
-
getMatrix
Get the specified matrix parameter from this list.- Parameters:
name- name of the parameterdefaultValue- value to return if not found- Returns:
- the value of the parameter specified or default value if not found
-
getFloatArray
Get the specified float array parameter from this list.- Parameters:
name- name of the parameter- Returns:
- the value of the parameter specified or
nullif not found
-
getPointArray
Get the specified point array parameter from this list.- Parameters:
name- name of the parameter- Returns:
- the value of the parameter specified or
nullif not found
-
getVectorArray
Get the specified vector array parameter from this list.- Parameters:
name- name of the parameter- Returns:
- the value of the parameter specified or
nullif not found
-
getTexCoordArray
Get the specified texture coordinate array parameter from this list.- Parameters:
name- name of the parameter- Returns:
- the value of the parameter specified or
nullif not found
-
getMatrixArray
Get the specified matrix array parameter from this list.- Parameters:
name- name of the parameter- Returns:
- the value of the parameter specified or
nullif not found
-
getMovingMatrix
-