artofillusion.procedural
Class SpectrumModule

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

public class SpectrumModule
extends Module

This is a Module which implements an arbitrary mapping of numbers to colors.


Field Summary
 
Fields inherited from class artofillusion.procedural.Module
linkFrom, linkFromIndex
 
Constructor Summary
SpectrumModule(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.
 void getColor(int which, RGBColor c, double blur)
          Get the color of the specified output port.
 double[] getColorPositions()
          Get the list of input values corresponding to the colors in the table.
 RGBColor[] getColors()
          Get the list of colors in the table.
 boolean getRepeat()
          Get whether the colors should repeat outside the range [0,1].
 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 setColors(RGBColor[] color, double[] position)
          Set the color table
 void setRepeat(boolean repeat)
          Set whether the colors 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, getAverageValue, getBounds, getClickedPort, getInputIndex, getInputPorts, getName, getOutputIndex, getOutputPorts, getValueError, getValueGradient, inputConnected, layout, setInput, setPosition
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpectrumModule

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

getColors

public RGBColor[] getColors()
Get the list of colors in the table.


getColorPositions

public double[] getColorPositions()
Get the list of input values corresponding to the colors in the table.


setColors

public void setColors(RGBColor[] color,
                      double[] position)
Set the color table

Parameters:
color - the list of colors
position - the list of input values corresponding to the colors. These must be between 0 and 1, and be in increasing order

getRepeat

public boolean getRepeat()
Get whether the colors should repeat outside the range [0,1].


setRepeat

public void setRepeat(boolean repeat)
Set whether the colors should repeat outside the range [0,1].


init

public void init(PointInfo p)
Description copied from class: Module
This method initializes the module in preparation for evaluating the procedure at a new point. The default implementation does nothing. Subclasses whose output depends on the point should override this method.

Overrides:
init in class Module

getColor

public void getColor(int which,
                     RGBColor c,
                     double blur)
Description copied from class: Module
Get the color of the specified output port. If the specified output port does not have a value type of COLOR, the result is undefined. Blur specifies the amount of smoothing to use. Subclasses which can return colors should override this method.

Overrides:
getColor in class Module

duplicate

public Module duplicate()
Description copied from class: Module
Create a duplicate of this module. Subclasses with adjustable parameters should override this.

Overrides:
duplicate in class Module

writeToStream

public void writeToStream(java.io.DataOutputStream out,
                          Scene theScene)
                   throws java.io.IOException
Description copied from class: Module
Write out the module's parameters to an output stream. Subclasses with editable parameters should override this method.

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

readFromStream

public void readFromStream(java.io.DataInputStream in,
                           Scene theScene)
                    throws java.io.IOException
Description copied from class: Module
Read in the module's parameters from an input stream. Subclasses with editable parameters should override this method.

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

calcSize

public void calcSize()
Description copied from class: Module
Calculate the size on the screen of this module. The default implementation makes it large enough to display the name of the module.

Overrides:
calcSize in class Module

edit

public boolean edit(ProcedureEditor editor,
                    Scene theScene)
Description copied from class: Module
This is an old form of edit() that exists only to maintain compatibility with old plugins. Subclasses should override the other form, not this one.

Overrides:
edit in class Module


Copyright © 1999-2011 by Peter Eastman.