artofillusion.material
Class Material

java.lang.Object
  extended by artofillusion.material.Material
Direct Known Subclasses:
Material3D, UniformMaterial

public abstract class Material
extends java.lang.Object

A Material represents a description of the bulk physical properties of an object: internal color and transparency, index of refraction, etc. This is distinct from the surface properties, which are described by a Texture object.


Constructor Summary
Material()
           
 
Method Summary
 void assignNewID()
          Assign a new ID number to this material, to reflect the fact that it has changed.
abstract  boolean castsShadows()
          Return true if this material should cast shadows.
abstract  Material duplicate()
          Create a duplicate of the material.
abstract  void edit(BFrame fr, Scene sc)
          Allow the user to interactively edit the material.
abstract  MaterialMapping getDefaultMapping(Object3D obj)
          Get a default MaterialMapping for the material.
 int getID()
          Get an ID number which is unique (within this session) for this material.
 java.lang.String getName()
          Get the name of the material.
 double getStepSize()
          Get the step size to be used for integrating this material.
static java.lang.String getTypeName()
          Get the name of this type of material.
 double indexOfRefraction()
          Get the index of refraction.
abstract  boolean isScattering()
          Return true if this material has internal scattering.
 void setID(int newid)
          Set the ID number for this material.
 void setIndexOfRefraction(double n)
          Set the index of refraction.
 void setName(java.lang.String name)
          Change the name of the material.
 boolean usesImage(ImageMap image)
          Return true if this Material makes use of the specified ImageMap.
abstract  void writeToFile(java.io.DataOutputStream out, Scene theScene)
          The following method writes the material's data to an output stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Material

public Material()
Method Detail

getTypeName

public static java.lang.String getTypeName()
Get the name of this type of material. Subclasses should override this method to return an appropriate name.


getName

public java.lang.String getName()
Get the name of the material.


setName

public void setName(java.lang.String name)
Change the name of the material.


indexOfRefraction

public double indexOfRefraction()
Get the index of refraction.


setIndexOfRefraction

public void setIndexOfRefraction(double n)
Set the index of refraction.


getStepSize

public double getStepSize()
Get the step size to be used for integrating this material.


usesImage

public boolean usesImage(ImageMap image)
Return true if this Material makes use of the specified ImageMap. Materials which use ImageMaps should override this method.


isScattering

public abstract boolean isScattering()
Return true if this material has internal scattering.


castsShadows

public abstract boolean castsShadows()
Return true if this material should cast shadows.


getID

public int getID()
Get an ID number which is unique (within this session) for this material.


assignNewID

public void assignNewID()
Assign a new ID number to this material, to reflect the fact that it has changed.


setID

public void setID(int newid)
Set the ID number for this material. (Use with extreme caution!)


getDefaultMapping

public abstract MaterialMapping getDefaultMapping(Object3D obj)
Get a default MaterialMapping for the material.


duplicate

public abstract Material duplicate()
Create a duplicate of the material.


edit

public abstract void edit(BFrame fr,
                          Scene sc)
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.


writeToFile

public abstract void writeToFile(java.io.DataOutputStream out,
                                 Scene theScene)
                          throws java.io.IOException
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.

Throws:
java.io.IOException


Copyright © 1999-2011 by Peter Eastman.