artofillusion.texture
Class Texture

java.lang.Object
  extended by artofillusion.texture.Texture
Direct Known Subclasses:
LayeredTexture, Texture2D, Texture3D, UniformTexture

public abstract class Texture
extends java.lang.Object

A Texture represents a description of the surface properties of an object: color, transparency, displacement, etc. This is distinct from the interior bulk properties, which are described by a Material object.


Field Summary
static int BUMP_COMPONENT
           
static int DIFFUSE_COLOR_COMPONENT
           
static int DISPLACEMENT_COMPONENT
           
static int EMISSIVE_COLOR_COMPONENT
           
static int HILIGHT_COLOR_COMPONENT
           
static int SPECULAR_COLOR_COMPONENT
           
static int TRANSPARENT_COLOR_COMPONENT
           
 
Constructor Summary
Texture()
           
 
Method Summary
 void assignNewID()
          Assign a new ID number to this texture, to reflect the fact that it has changed.
abstract  Texture duplicate()
          Create a duplicate of the texture.
abstract  void edit(BFrame fr, Scene sc)
          Allow the user to interactively edit the texture.
abstract  void getAverageSpec(TextureSpec spec, double time, double[] param)
          Get a TextureSpec which represents the average surface properties of this texture.
abstract  TextureMapping getDefaultMapping(Object3D object)
          Get a default TextureMapping for the texture.
 int getID()
          Get an ID number which is unique (within this session) for this texture.
 java.lang.String getName()
          Get the name of the texture.
 TextureParameter[] getParameters()
          Get the list of parameters for this texture.
static java.lang.String getTypeName()
          Get the name of this type of texture.
abstract  boolean hasComponent(int component)
          Determine whether this texture has a non-zero value anywhere for a particular component.
 void setID(int newid)
          Set the ID number for this texture.
 void setName(java.lang.String name)
          Change the name of the texture.
 boolean usesImage(ImageMap image)
          Return true if this Texture makes use of the specified ImageMap.
abstract  void writeToFile(java.io.DataOutputStream out, Scene theScene)
          The following method writes the texture's data to an output stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIFFUSE_COLOR_COMPONENT

public static final int DIFFUSE_COLOR_COMPONENT
See Also:
Constant Field Values

SPECULAR_COLOR_COMPONENT

public static final int SPECULAR_COLOR_COMPONENT
See Also:
Constant Field Values

TRANSPARENT_COLOR_COMPONENT

public static final int TRANSPARENT_COLOR_COMPONENT
See Also:
Constant Field Values

HILIGHT_COLOR_COMPONENT

public static final int HILIGHT_COLOR_COMPONENT
See Also:
Constant Field Values

EMISSIVE_COLOR_COMPONENT

public static final int EMISSIVE_COLOR_COMPONENT
See Also:
Constant Field Values

BUMP_COMPONENT

public static final int BUMP_COMPONENT
See Also:
Constant Field Values

DISPLACEMENT_COMPONENT

public static final int DISPLACEMENT_COMPONENT
See Also:
Constant Field Values
Constructor Detail

Texture

public Texture()
Method Detail

getTypeName

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


getName

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


setName

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


hasComponent

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

Parameters:
component - the texture component to check for (one of the *_COMPONENT constants)

getParameters

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


usesImage

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


getID

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


assignNewID

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


setID

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


getAverageSpec

public abstract void getAverageSpec(TextureSpec spec,
                                    double time,
                                    double[] param)
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.


getDefaultMapping

public abstract TextureMapping getDefaultMapping(Object3D object)
Get a default TextureMapping for the texture.


duplicate

public abstract Texture duplicate()
Create a duplicate of the texture.


edit

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


writeToFile

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

Throws:
java.io.IOException


Copyright © 1999-2011 by Peter Eastman.