artofillusion.procedural
Class CellsModule

java.lang.Object
  extended by artofillusion.procedural.Module
      extended by artofillusion.procedural.CellsModule

public class CellsModule
extends Module

This is a Module which generates a pattern based on Steven Worley's cellular texture basis function.


Field Summary
 
Fields inherited from class artofillusion.procedural.Module
linkFrom, linkFromIndex
 
Constructor Summary
CellsModule(java.awt.Point position)
           
 
Method Summary
 Module duplicate()
          Create a duplicate of this module.
 boolean edit(ProcedureEditor editor, Scene theScene)
          Allow the user to set the parameters.
 double getAverageValue(int which, double blur)
          Calculate the average value of an output.
 int getMetric()
          Get the metric to use for the cells function.
 double getValueError(int which, double blur)
          Calculate the error of an output.
 void getValueGradient(int which, Vec3 grad, double blur)
          Calculate the gradient of an output.
 void init(PointInfo p)
          New point, so the value will need to be recalculated.
 void readFromStream(java.io.DataInputStream in, Scene theScene)
          Read in the parameters.
 void setMetric(int m)
          Set the metric to use for the cells function.
 void writeToStream(java.io.DataOutputStream out, Scene theScene)
          Write out the parameters.
 
Methods inherited from class artofillusion.procedural.Module
calcSize, 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
 

Constructor Detail

CellsModule

public CellsModule(java.awt.Point position)
Method Detail

getMetric

public int getMetric()
Get the metric to use for the cells function. This is one of the constants defined in the Cells class.


setMetric

public void setMetric(int m)
Set the metric to use for the cells function. This should be one of the constants defined in the Cells class.


init

public void init(PointInfo p)
New point, so the value will need to be recalculated.

Overrides:
init in class Module

getAverageValue

public double getAverageValue(int which,
                              double blur)
Calculate the average value of an output.

Overrides:
getAverageValue in class Module

getValueError

public double getValueError(int which,
                            double blur)
Calculate the error of an output.

Overrides:
getValueError in class Module

getValueGradient

public void getValueGradient(int which,
                             Vec3 grad,
                             double blur)
Calculate the gradient of an output.

Overrides:
getValueGradient in class Module

edit

public boolean edit(ProcedureEditor editor,
                    Scene theScene)
Allow the user to set the parameters.

Overrides:
edit in class Module

duplicate

public Module duplicate()
Create a duplicate of this module.

Overrides:
duplicate in class Module

writeToStream

public void writeToStream(java.io.DataOutputStream out,
                          Scene theScene)
                   throws java.io.IOException
Write out the parameters.

Overrides:
writeToStream in class Module
Throws:
java.io.IOException

readFromStream

public void readFromStream(java.io.DataInputStream in,
                           Scene theScene)
                    throws java.io.IOException
Read in the parameters.

Overrides:
readFromStream in class Module
Throws:
java.io.IOException


Copyright © 1999-2011 by Peter Eastman.