artofillusion.material
Class UniformMaterialMapping

java.lang.Object
  extended by artofillusion.material.MaterialMapping
      extended by artofillusion.material.UniformMaterialMapping

public class UniformMaterialMapping
extends MaterialMapping

UniformMaterialMapping is the MaterialMapping for UniformMaterials.


Constructor Summary
UniformMaterialMapping(java.io.DataInputStream in, Object3D theObject, Material theMaterial)
           
UniformMaterialMapping(Object3D theObject, Material theMaterial)
           
 
Method Summary
 void copy(MaterialMapping map)
          Make this mapping identical to another one.
 MaterialMapping duplicate()
          Create a new MaterialMapping which is identical to this one.
 MaterialMapping duplicate(Object3D obj, Material mat)
          Create a new MaterialMapping which is identical to this one, but for a different object and Material.
 Widget getEditingPanel(Object3D obj, MaterialPreviewer preview)
          This method should return a Widget in which the user can edit the mapping.
 void getMaterialSpec(Vec3 pos, MaterialSpec spec, double size, double t)
          Given a point inside the object for which this mapping is being used, find the corresponding material properties.
 double getStepSize()
          Get the step size to use for integrating the material.
static boolean legalMapping(Object3D obj, Material mat)
           
 void writeToFile(java.io.DataOutputStream out)
          Every subclass of MaterialMapping must define a constructor which takes a Material and an Object3D as its arguments:
 
Methods inherited from class artofillusion.material.MaterialMapping
castsShadows, getMaterial, getName, getObject, indexOfRefraction, isScattering
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UniformMaterialMapping

public UniformMaterialMapping(Object3D theObject,
                              Material theMaterial)

UniformMaterialMapping

public UniformMaterialMapping(java.io.DataInputStream in,
                              Object3D theObject,
                              Material theMaterial)
                       throws java.io.IOException,
                              java.io.InvalidObjectException
Throws:
java.io.IOException
java.io.InvalidObjectException
Method Detail

getStepSize

public double getStepSize()
Description copied from class: MaterialMapping
Get the step size to use for integrating the material.

Specified by:
getStepSize in class MaterialMapping

getMaterialSpec

public void getMaterialSpec(Vec3 pos,
                            MaterialSpec spec,
                            double size,
                            double t)
Description copied from class: MaterialMapping
Given a point inside the object for which this mapping is being used, find the corresponding material properties. The properties should be averaged over a region of width size.

Specified by:
getMaterialSpec in class MaterialMapping

legalMapping

public static boolean legalMapping(Object3D obj,
                                   Material mat)

duplicate

public MaterialMapping duplicate()
Description copied from class: MaterialMapping
Create a new MaterialMapping which is identical to this one.

Specified by:
duplicate in class MaterialMapping

duplicate

public MaterialMapping duplicate(Object3D obj,
                                 Material mat)
Description copied from class: MaterialMapping
Create a new MaterialMapping which is identical to this one, but for a different object and Material.

Specified by:
duplicate in class MaterialMapping

copy

public void copy(MaterialMapping map)
Description copied from class: MaterialMapping
Make this mapping identical to another one.

Specified by:
copy in class MaterialMapping

getEditingPanel

public Widget getEditingPanel(Object3D obj,
                              MaterialPreviewer preview)
Description copied from class: MaterialMapping
This method should return a Widget in which the user can edit the mapping. The parameters are the object whose mapping is being edited, and a MaterialPreviewer which should be rendered whenever one of the mapping's parameters changes.

Specified by:
getEditingPanel in class MaterialMapping

writeToFile

public void writeToFile(java.io.DataOutputStream out)
                 throws java.io.IOException
Description copied from class: MaterialMapping
Every subclass of MaterialMapping must define a constructor which takes a Material and an Object3D as its arguments:

public MappingSubclass(Object3D theObject, Material theMaterial)

In addition, every subclass must include a constructor with the signature

public MappingSubclass(DataInputStream in, Object3D theObject, Material theMaterial) throws IOException, InvalidObjectException

which reconstructs the mapping by reading its data from an input stream. The following method writes the object's data to an output stream.

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


Copyright © 1999-2011 by Peter Eastman.