artofillusion.texture
Class ProceduralTexture3D

java.lang.Object
  extended by artofillusion.texture.Texture
      extended by artofillusion.texture.Texture3D
          extended by artofillusion.texture.ProceduralTexture3D
All Implemented Interfaces:
ProcedureOwner

public class ProceduralTexture3D
extends Texture3D
implements ProcedureOwner

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


Field Summary
 
Fields inherited from class artofillusion.texture.Texture
BUMP_COMPONENT, DIFFUSE_COLOR_COMPONENT, DISPLACEMENT_COMPONENT, EMISSIVE_COLOR_COMPONENT, HILIGHT_COLOR_COMPONENT, SPECULAR_COLOR_COMPONENT, TRANSPARENT_COLOR_COMPONENT
 
Constructor Summary
ProceduralTexture3D()
           
ProceduralTexture3D(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.
 void disposePreview(java.lang.Object preview)
          Dispose of the preview object when the editor is closed.
 Texture duplicate()
          Create a duplicate of the texture.
 void edit(BFrame fr, Scene sc)
          Allow the user to interactively edit the texture.
 void editProperties(ProcedureEditor editor)
          Display the Properties dialog.
 void getAverageSpec(TextureSpec spec, double time, double[] param)
          Get a TextureSpec which represents the average surface properties of this texture.
 double getDisplacement(double x, double y, double z, double xsize, double ysize, double zsize, double t, double[] param)
          Textures which use displacement mapping should override this method to return the displacement at the given point.
 TextureParameter[] getParameters()
          Get the list of parameters for this texture.
 java.lang.Object getPreview(ProcedureEditor editor)
          Create an object which displays a preview of the procedure.
 Procedure getProcedure()
          Get the procedure used by this texture.
 void getTextureSpec(TextureSpec spec, double x, double y, double z, double xsize, double ysize, double zsize, double angle, double t, double[] param)
          Get the surface properties at point in the texture.
 void getTransparency(RGBColor trans, double x, double y, double z, double xsize, double ysize, double zsize, double angle, double t, double[] param)
           
static java.lang.String getTypeName()
           
 java.lang.String getWindowTitle()
          Get the title of the procedure's editing window.
 boolean hasComponent(int component)
          Determine whether this texture has a non-zero value anywhere for a particular component.
 void updatePreview(java.lang.Object preview)
          Update the display of the preview.
 boolean usesImage(ImageMap image)
          Determine whether this Texture uses the specified image.
 void writeToFile(java.io.DataOutputStream out, Scene theScene)
          The following method writes the texture's data to an output stream.
 
Methods inherited from class artofillusion.texture.Texture3D
displacementMapped, getDefaultMapping
 
Methods inherited from class artofillusion.texture.Texture
assignNewID, getID, getName, setID, 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

ProceduralTexture3D

public ProceduralTexture3D()

ProceduralTexture3D

public ProceduralTexture3D(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()

getAverageSpec

public void getAverageSpec(TextureSpec spec,
                           double time,
                           double[] param)
Description copied from class: Texture
Get a TextureSpec which represents the average surface properties of this texture. It will be used by Renderers and Translators which do not support the given texture type. This need not be an exact mathematical average, but should give a reasonable representation of the overall surface properties.

Specified by:
getAverageSpec in class Texture

getTextureSpec

public void getTextureSpec(TextureSpec spec,
                           double x,
                           double y,
                           double z,
                           double xsize,
                           double ysize,
                           double zsize,
                           double angle,
                           double t,
                           double[] param)
Description copied from class: Texture3D
Get the surface properties at point in the texture. The properties should be averaged over a region around the point.

Specified by:
getTextureSpec in class Texture3D
Parameters:
spec - the surface properties will be stored in this
x - the x coordinate at which to evaluate the texture
y - the y coordinate at which to evaluate the texture
z - the z coordinate at which to evaluate the texture
xsize - the range of x over which to average the surface properties
ysize - the range of y over which to average the surface properties
zsize - the range of z over which to average the surface properties
angle - the dot product of the view direction with the surface normal
t - the time at which to evaluate the surface properties
param - the texture parameter values at the point

getTransparency

public void getTransparency(RGBColor trans,
                            double x,
                            double y,
                            double z,
                            double xsize,
                            double ysize,
                            double zsize,
                            double angle,
                            double t,
                            double[] param)
Specified by:
getTransparency in class Texture3D

getProcedure

public Procedure getProcedure()
Get the procedure used by this texture.


usesImage

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

Overrides:
usesImage in class Texture

getDisplacement

public double getDisplacement(double x,
                              double y,
                              double z,
                              double xsize,
                              double ysize,
                              double zsize,
                              double t,
                              double[] param)
Description copied from class: Texture3D
Textures which use displacement mapping should override this method to return the displacement at the given point.

Overrides:
getDisplacement in class Texture3D

getParameters

public TextureParameter[] getParameters()
Get the list of parameters for this texture.

Overrides:
getParameters in class Texture

duplicate

public Texture duplicate()
Description copied from class: Texture
Create a duplicate of the texture.

Specified by:
duplicate in class Texture

hasComponent

public boolean hasComponent(int component)
Determine whether this texture has a non-zero value anywhere for a particular component.

Specified by:
hasComponent in class Texture
Parameters:
component - the texture component to check for (one of the *_COMPONENT constants)

edit

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

Specified by:
edit in class Texture

writeToFile

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

Specified by:
writeToFile in class Texture
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.