|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectartofillusion.procedural.Module
artofillusion.procedural.FunctionModule
public class FunctionModule
This is a Module which outputs a user defined function of its input, y = f(x). It is defined by a set of points (x,y). For other values of x, the output is determined by interpolation.
Field Summary | |
---|---|
static short |
LINEAR
|
static short |
SMOOTH_INTERPOLATE
|
Fields inherited from class artofillusion.procedural.Module |
---|
linkFrom, linkFromIndex |
Constructor Summary | |
---|---|
FunctionModule(java.awt.Point position)
|
Method Summary | |
---|---|
void |
calcSize()
Calculate the size on the screen of this module. |
Module |
duplicate()
Create a duplicate of this module. |
boolean |
edit(ProcedureEditor editor,
Scene theScene)
This is an old form of edit() that exists only to maintain compatibility with old plugins. |
double |
getAverageValue(int which,
double blur)
Get the average value of the specified output port. |
short |
getMethod()
Get the method for interpolating between the set values (LINEAR or SMOOTH_INTERPOLATE). |
boolean |
getRepeat()
Get whether the function should repeat outside the range [0,1]. |
double |
getValueError(int which,
double blur)
Get the uncertainty in the value of the specified output port. |
void |
getValueGradient(int which,
Vec3 grad,
double blur)
Get the gradient of the value of the specified output port. |
double[] |
getX()
Get the list of x (input) values. |
double[] |
getY()
Get the list of y (output) values. |
void |
init(PointInfo p)
This method initializes the module in preparation for evaluating the procedure at a new point. |
void |
readFromStream(java.io.DataInputStream in,
Scene theScene)
Read in the module's parameters from an input stream. |
void |
setFunction(double[] x,
double[] y)
Set the lists of (x,y) pairs that define the function. |
void |
setMethod(short method)
Set the method for interpolating between the set values (LINEAR or SMOOTH_INTERPOLATE). |
void |
setRepeat(boolean repeat)
Set whether the function should repeat outside the range [0,1]. |
void |
writeToStream(java.io.DataOutputStream out,
Scene theScene)
Write out the module's parameters to an output stream. |
Methods inherited from class artofillusion.procedural.Module |
---|
checkFeedback, draw, getBounds, getClickedPort, getColor, getInputIndex, getInputPorts, getName, getOutputIndex, getOutputPorts, inputConnected, layout, setInput, setPosition |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final short LINEAR
public static final short SMOOTH_INTERPOLATE
Constructor Detail |
---|
public FunctionModule(java.awt.Point position)
Method Detail |
---|
public double[] getX()
public double[] getY()
public void setFunction(double[] x, double[] y)
x
- the list of x valuesy
- the list of y values. These must be in the range [0,1], and be in increasing orderpublic boolean getRepeat()
public void setRepeat(boolean repeat)
public short getMethod()
public void setMethod(short method)
public void init(PointInfo p)
Module
init
in class Module
public double getAverageValue(int which, double blur)
Module
getAverageValue
in class Module
public double getValueError(int which, double blur)
Module
getValueError
in class Module
public void getValueGradient(int which, Vec3 grad, double blur)
Module
getValueGradient
in class Module
public void calcSize()
Module
calcSize
in class Module
public Module duplicate()
Module
duplicate
in class Module
public void writeToStream(java.io.DataOutputStream out, Scene theScene) throws java.io.IOException
Module
writeToStream
in class Module
java.io.IOException
public void readFromStream(java.io.DataInputStream in, Scene theScene) throws java.io.IOException
Module
readFromStream
in class Module
java.io.IOException
public boolean edit(ProcedureEditor editor, Scene theScene)
Module
edit
in class Module
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |