artofillusion.procedural
Class ScaleShiftModule

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

public class ScaleShiftModule
extends Module

This is a Module which scales and shifts its input value.


Field Summary
 
Fields inherited from class artofillusion.procedural.Module
linkFrom, linkFromIndex
 
Constructor Summary
ScaleShiftModule(java.awt.Point position)
           
 
Method Summary
 Module duplicate()
          Create a duplicate of this module.
 boolean edit(buoy.widget.BFrame fr, 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.
 double getScale()
          Get the scale value.
 double getShift()
          Get the shift value.
 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 readFromStream(java.io.DataInputStream in, Scene theScene)
          Read in the module's parameters from an input stream.
 void setScale(double val)
          Set the scale value.
 void setShift(double val)
          Set the shift value.
 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
calcSize, checkFeedback, draw, getBounds, getClickedPort, getColor, getInputIndex, getInputPorts, getName, getOutputIndex, getOutputPorts, init, inputConnected, layout, setInput, setPosition
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScaleShiftModule

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

getScale

public double getScale()
Get the scale value.


setScale

public void setScale(double val)
Set the scale value.


getShift

public double getShift()
Get the shift value.


setShift

public void setShift(double val)
Set the shift value.


getAverageValue

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

Overrides:
getAverageValue in class Module

getValueError

public double getValueError(int which,
                            double blur)
Description copied from class: Module
Get the uncertainty in the value of the specified output port. If the specified output port does not have a value type of NUMBER, the result is undefined. Blur specifies the amount of smoothing to use. Subclasses which can return values should override this method.

Overrides:
getValueError in class Module

getValueGradient

public void getValueGradient(int which,
                             Vec3 grad,
                             double blur)
Description copied from class: Module
Get the gradient of the value of the specified output port. If the specified output port does not have a value type of NUMBER, the result is undefined. Blur specifies the amount of smoothing to use. Subclasses which can return values should override this method.

Overrides:
getValueGradient in class Module

edit

public boolean edit(buoy.widget.BFrame fr,
                    Scene theScene)
Description copied from class: Module
This should display a user interface for editing the module, and return true if the module is changed. The default implementation does nothing.

Overrides:
edit 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


Copyright © 1999-2008 by Peter Eastman.