artofillusion.procedural
Class Procedure

java.lang.Object
  extended by artofillusion.procedural.Procedure

public class Procedure
extends java.lang.Object

This represents a procedure for calculating a set of values (typically, the parameters for a texture or material).


Constructor Summary
Procedure(OutputModule[] output)
           
 
Method Summary
 void addLink(Link ln)
          Add a link to the procedure.
 void addModule(Module mod)
          Add a module to the procedure.
 boolean checkFeedback()
          Check for feedback loops in this procedure.
 void copy(Procedure proc)
          Make this procedure identical to another one.
 void deleteLink(int which)
          Delete a link from the procedure.
 void deleteModule(int which)
          Delete a module from the procedure.
 Link[] getLinks()
          Get the list of links between modules.
 int getModuleIndex(Module mod)
          Get the index of a particular module.
 Module[] getModules()
          Get the list of all other modules.
 void getOutputColor(int which, RGBColor color)
          This routine returns the color of the specified output module.
 void getOutputGradient(int which, Vec3 grad)
          This routine returns the gradient of the specified output module.
 int getOutputIndex(Module mod)
          Get the index of a particular output module.
 OutputModule[] getOutputModules()
          Get the list of output modules.
 double getOutputValue(int which)
          This routine returns the value of the specified output module.
 void initForPoint(PointInfo p)
          This routine is called before the procedure is evaluated.
 void readFromStream(java.io.DataInputStream in, Scene theScene)
          Reconstruct this procedure from an input stream.
 void writeToStream(java.io.DataOutputStream out, Scene theScene)
          Write this procedure to an output stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Procedure

public Procedure(OutputModule[] output)
Method Detail

getOutputModules

public OutputModule[] getOutputModules()
Get the list of output modules.


getModules

public Module[] getModules()
Get the list of all other modules.


getModuleIndex

public int getModuleIndex(Module mod)
Get the index of a particular module.


getOutputIndex

public int getOutputIndex(Module mod)
Get the index of a particular output module.


addModule

public void addModule(Module mod)
Add a module to the procedure.


deleteModule

public void deleteModule(int which)
Delete a module from the procedure. Any links involving this module should be deleted before* calling this method.


getLinks

public Link[] getLinks()
Get the list of links between modules.


addLink

public void addLink(Link ln)
Add a link to the procedure.


deleteLink

public void deleteLink(int which)
Delete a link from the procedure.


checkFeedback

public boolean checkFeedback()
Check for feedback loops in this procedure.


initForPoint

public void initForPoint(PointInfo p)
This routine is called before the procedure is evaluated. The PointInfo object describes the point for which it is to be evaluated.


getOutputValue

public double getOutputValue(int which)
This routine returns the value of the specified output module. If that output does not have value type NUMBER, the results are undefined.


getOutputGradient

public void getOutputGradient(int which,
                              Vec3 grad)
This routine returns the gradient of the specified output module. If that output does not have value type NUMBER, the results are undefined.


getOutputColor

public void getOutputColor(int which,
                           RGBColor color)
This routine returns the color of the specified output module. If that output does not have value type COLOR, the results are undefined.


copy

public void copy(Procedure proc)
Make this procedure identical to another one. The output modules must already be set up before calling this method.


writeToStream

public void writeToStream(java.io.DataOutputStream out,
                          Scene theScene)
                   throws java.io.IOException
Write this procedure to an output stream.

Throws:
java.io.IOException

readFromStream

public void readFromStream(java.io.DataInputStream in,
                           Scene theScene)
                    throws java.io.IOException,
                           java.io.InvalidObjectException
Reconstruct this procedure from an input stream. The output modules must already be set up before calling this method.

Throws:
java.io.IOException
java.io.InvalidObjectException


Copyright © 1999-2011 by Peter Eastman.