artofillusion.material
Class ProceduralMaterial3D

java.lang.Object
  extended by artofillusion.material.Material
      extended by artofillusion.material.Material3D
          extended by artofillusion.material.ProceduralMaterial3D
All Implemented Interfaces:
ProcedureOwner

public class ProceduralMaterial3D
extends Material3D
implements ProcedureOwner

This is a Material3D which uses a Procedure to calculate its properties.


Constructor Summary
ProceduralMaterial3D()
           
ProceduralMaterial3D(java.io.DataInputStream in, Scene theScene)
           
 
Method Summary
 void acceptEdits(ProcedureEditor editor)
          This is called when the user clicks OK in the procedure editor.
 boolean allowParameters()
          Determine whether the procedure may contain Parameter modules.
 boolean allowViewAngle()
          Determine whether the procedure may contain View Angle modules.
 boolean canEditName()
          Determine whether the procedure may be renamed.
 boolean castsShadows()
          Return true if this material should cast shadows.
 void disposePreview(java.lang.Object preview)
          Dispose of the preview object when the editor is closed.
 Material duplicate()
          Create a duplicate of the material.
 void edit(BFrame fr, Scene sc)
          Allow the user to interactively edit the material.
 void editProperties(ProcedureEditor editor)
          Display the Properties dialog.
 void getMaterialSpec(MaterialSpec spec, double x, double y, double z, double xsize, double ysize, double zsize, double t)
          Get the properties at point (x, y, z) at time t.
 java.lang.Object getPreview(ProcedureEditor editor)
          Create an object which displays a preview of the procedure.
 double getStepSize()
          Get the step size to be used for integrating this material.
static java.lang.String getTypeName()
           
 java.lang.String getWindowTitle()
          Get the title of the procedure's editing window.
 boolean isScattering()
          The material scatters light if there is anything connected to the scattering output.
 void setStepSize(double step)
           
 void updatePreview(java.lang.Object preview)
          Update the display of the preview.
 boolean usesImage(ImageMap image)
          Determine whether this Material uses the specified image.
 void writeToFile(java.io.DataOutputStream out, Scene theScene)
          The following method writes the material's data to an output stream.
 
Methods inherited from class artofillusion.material.Material3D
getDefaultMapping
 
Methods inherited from class artofillusion.material.Material
assignNewID, getID, getName, indexOfRefraction, setID, setIndexOfRefraction, setName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface artofillusion.procedural.ProcedureOwner
getName, setName
 

Constructor Detail

ProceduralMaterial3D

public ProceduralMaterial3D()

ProceduralMaterial3D

public ProceduralMaterial3D(java.io.DataInputStream in,
                            Scene theScene)
                     throws java.io.IOException,
                            java.io.InvalidObjectException
Throws:
java.io.IOException
java.io.InvalidObjectException
Method Detail

getTypeName

public static java.lang.String getTypeName()

getStepSize

public double getStepSize()
Description copied from class: Material
Get the step size to be used for integrating this material.

Overrides:
getStepSize in class Material

setStepSize

public void setStepSize(double step)

getMaterialSpec

public void getMaterialSpec(MaterialSpec spec,
                            double x,
                            double y,
                            double z,
                            double xsize,
                            double ysize,
                            double zsize,
                            double t)
Description copied from class: Material3D
Get the properties at point (x, y, z) at time t. More precisely, the properties returned should represent an average over a region of width (xsize, ysize, zsize), which is centered at (x, y, z).

Specified by:
getMaterialSpec in class Material3D

usesImage

public boolean usesImage(ImageMap image)
Determine whether this Material uses the specified image.

Overrides:
usesImage in class Material

isScattering

public boolean isScattering()
The material scatters light if there is anything connected to the scattering output.

Specified by:
isScattering in class Material

castsShadows

public boolean castsShadows()
Description copied from class: Material
Return true if this material should cast shadows.

Specified by:
castsShadows in class Material

duplicate

public Material duplicate()
Description copied from class: Material
Create a duplicate of the material.

Specified by:
duplicate in class Material

edit

public void edit(BFrame fr,
                 Scene sc)
Description copied from class: Material
Allow the user to interactively edit the material. fr is a Frame which can be used as a parent for Dialogs, and sc is the Scene which this Material is part of.

Specified by:
edit in class Material

writeToFile

public void writeToFile(java.io.DataOutputStream out,
                        Scene theScene)
                 throws java.io.IOException
Description copied from class: Material
The following method writes the material's data to an output stream. In addition to this method, every Material must include a constructor with the signature public Classname(DataInputStream in, Scene theScene) throws IOException, InvalidObjectException which reconstructs the material by reading its data from an input stream.

Specified by:
writeToFile in class Material
Throws:
java.io.IOException

getWindowTitle

public java.lang.String getWindowTitle()
Get the title of the procedure's editing window.

Specified by:
getWindowTitle in interface ProcedureOwner

getPreview

public java.lang.Object getPreview(ProcedureEditor editor)
Create an object which displays a preview of the procedure.

Specified by:
getPreview in interface ProcedureOwner

updatePreview

public void updatePreview(java.lang.Object preview)
Update the display of the preview.

Specified by:
updatePreview in interface ProcedureOwner

disposePreview

public void disposePreview(java.lang.Object preview)
Dispose of the preview object when the editor is closed.

Specified by:
disposePreview in interface ProcedureOwner

allowViewAngle

public boolean allowViewAngle()
Determine whether the procedure may contain View Angle modules.

Specified by:
allowViewAngle in interface ProcedureOwner

allowParameters

public boolean allowParameters()
Determine whether the procedure may contain Parameter modules.

Specified by:
allowParameters in interface ProcedureOwner

canEditName

public boolean canEditName()
Determine whether the procedure may be renamed.

Specified by:
canEditName in interface ProcedureOwner

acceptEdits

public void acceptEdits(ProcedureEditor editor)
This is called when the user clicks OK in the procedure editor.

Specified by:
acceptEdits in interface ProcedureOwner

editProperties

public void editProperties(ProcedureEditor editor)
Display the Properties dialog.

Specified by:
editProperties in interface ProcedureOwner


Copyright © 1999-2011 by Peter Eastman.