|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectartofillusion.procedural.Module
public class Module
This represents a module in a procedure. This is an abstract class, whose subclasses represent specific kinds of modules.
Field Summary | |
---|---|
Module[] |
linkFrom
|
int[] |
linkFromIndex
|
Constructor Summary | |
---|---|
Module(java.lang.String name,
IOPort[] input,
IOPort[] output,
java.awt.Point position)
|
Method Summary | |
---|---|
void |
calcSize()
Calculate the size on the screen of this module. |
boolean |
checkFeedback()
This method is used to check feedback loops in a procedure. |
void |
draw(java.awt.Graphics2D g,
boolean selected)
Draw the module on the screen. |
Module |
duplicate()
Create a duplicate of this module. |
boolean |
edit(BFrame fr,
Scene theScene)
This is an old form of edit() that exists only to maintain compatibility with old plugins. |
boolean |
edit(ProcedureEditor editor,
Scene theScene)
This should display a user interface for editing the module, and return true if the module is changed. |
double |
getAverageValue(int which,
double blur)
Get the average value of the specified output port. |
java.awt.Rectangle |
getBounds()
Get the boundary rectangle for this module. |
IOPort |
getClickedPort(java.awt.Point pos)
Determine whether the specified point is over an IOPort, and if so, return the port. |
void |
getColor(int which,
RGBColor color,
double blur)
Get the color of the specified output port. |
int |
getInputIndex(IOPort port)
Get the index of a particular input port. |
IOPort[] |
getInputPorts()
Get a list of the input ports for this module. |
java.lang.String |
getName()
Get the name of this module. |
int |
getOutputIndex(IOPort port)
Get the index of a particular output port. |
IOPort[] |
getOutputPorts()
Get a list of the output ports for this module. |
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. |
void |
init(PointInfo p)
This method initializes the module in preparation for evaluating the procedure at a new point. |
boolean |
inputConnected(int which)
Determine whether an input port is connected to anything. |
void |
layout()
Layout the module's onscreen representation. |
void |
readFromStream(java.io.DataInputStream out,
Scene theScene)
Read in the module's parameters from an input stream. |
void |
setInput(IOPort which,
IOPort port)
Specify the module and port which one of the input ports is connected to. |
void |
setPosition(int x,
int y)
Move this module to a new location. |
void |
writeToStream(java.io.DataOutputStream out,
Scene theScene)
Write out the module's parameters to an output stream. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Module[] linkFrom
public int[] linkFromIndex
Constructor Detail |
---|
public Module(java.lang.String name, IOPort[] input, IOPort[] output, java.awt.Point position)
Method Detail |
---|
public java.lang.String getName()
public java.awt.Rectangle getBounds()
public void setPosition(int x, int y)
public IOPort[] getInputPorts()
public IOPort[] getOutputPorts()
public int getInputIndex(IOPort port)
public int getOutputIndex(IOPort port)
public boolean inputConnected(int which)
public IOPort getClickedPort(java.awt.Point pos)
public void setInput(IOPort which, IOPort port)
public void calcSize()
public void layout()
public void draw(java.awt.Graphics2D g, boolean selected)
public boolean checkFeedback()
public boolean edit(ProcedureEditor editor, Scene theScene)
editor
- the ProcedureEditor in which this module is being editedtheScene
- the Scene to which this module belongs
public boolean edit(BFrame fr, Scene theScene)
public void init(PointInfo p)
public double getAverageValue(int which, double blur)
public double getValueError(int which, double blur)
public void getValueGradient(int which, Vec3 grad, double blur)
public void getColor(int which, RGBColor color, double blur)
public Module duplicate()
public void writeToStream(java.io.DataOutputStream out, Scene theScene) throws java.io.IOException
java.io.IOException
public void readFromStream(java.io.DataInputStream out, Scene theScene) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |