artofillusion.texture
Class FaceVertexParameterValue

java.lang.Object
  extended by artofillusion.texture.FaceVertexParameterValue
All Implemented Interfaces:
ParameterValue

public class FaceVertexParameterValue
extends java.lang.Object
implements ParameterValue

This class defines a scalar parameter whose value is defined at each vertex of each face of a mesh.


Constructor Summary
FaceVertexParameterValue(java.io.DataInputStream in)
          Reconstruct a serialized object.
FaceVertexParameterValue(double[][] val)
          Create a new FaceVertexParameterValue object.
FaceVertexParameterValue(FacetedMesh mesh, TextureParameter param)
          Create a new FaceVertexParameterValue for a mesh, and initialize it to appropriate default values.
 
Method Summary
 ParameterValue duplicate()
          Create a duplicate of this object.
 boolean equals(java.lang.Object o)
          Determine whether this object represents the same set of values as another one.
 double getAverageValue()
          Get the average value of the parameter over the entire surface.
 int getFaceCount()
          Get the number of faces for which the parameter has values.
 int getFaceVertexCount(int faceIndex)
          Get the number of vertices in a particular face.
 double getValue(int faceIndex, int vertIndex)
          Get the value of the parameter at a particular vertex in a particular face.
 double getValue(int faceIndex, int v1, int v2, int v3, double u, double v, double w)
          Get the value of the parameter at a particular point within the interior of a face.
 void setValue(double[][] val)
          Set the list of parameter values.
 void setValue(int faceIndex, int vertIndex, double newValue)
          Set the value of the parameter at a particular vertex in a particular face.
 void writeToStream(java.io.DataOutputStream out)
          Write out a serialized representation of this object to a stream.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FaceVertexParameterValue

public FaceVertexParameterValue(double[][] val)
Create a new FaceVertexParameterValue object. val is an array containing the parameter value at every vertex of every face. Specifically, val[i][j] is the value at the j'th vertex of the i'th face.


FaceVertexParameterValue

public FaceVertexParameterValue(FacetedMesh mesh,
                                TextureParameter param)
Create a new FaceVertexParameterValue for a mesh, and initialize it to appropriate default values.


FaceVertexParameterValue

public FaceVertexParameterValue(java.io.DataInputStream in)
                         throws java.io.IOException
Reconstruct a serialized object.

Throws:
java.io.IOException
Method Detail

setValue

public void setValue(double[][] val)
Set the list of parameter values. val is an array containing the parameter value at every vertex of every face. Specifically, val[i][j] is the value at the j'th vertex of the i'th face.


getValue

public double getValue(int faceIndex,
                       int vertIndex)
Get the value of the parameter at a particular vertex in a particular face.

Parameters:
faceIndex - the index of the face within the mesh
vertIndex - the index of the vertex within the face
Returns:
the value at the specified face/vertex

setValue

public void setValue(int faceIndex,
                     int vertIndex,
                     double newValue)
Set the value of the parameter at a particular vertex in a particular face.

Parameters:
faceIndex - the index of the face within the mesh
vertIndex - the index of the vertex within the face
newValue - the value to set for the specified face/vertex

getValue

public double getValue(int faceIndex,
                       int v1,
                       int v2,
                       int v3,
                       double u,
                       double v,
                       double w)
Get the value of the parameter at a particular point within the interior of a face. This method assumes the face is triangular (which is always the case for a parameter of a RenderingMesh).

Specified by:
getValue in interface ParameterValue

getFaceCount

public int getFaceCount()
Get the number of faces for which the parameter has values.


getFaceVertexCount

public int getFaceVertexCount(int faceIndex)
Get the number of vertices in a particular face.

Parameters:
faceIndex - the index of the face within the mesh

getAverageValue

public double getAverageValue()
Get the average value of the parameter over the entire surface.

Specified by:
getAverageValue in interface ParameterValue

duplicate

public ParameterValue duplicate()
Create a duplicate of this object.

Specified by:
duplicate in interface ParameterValue

equals

public boolean equals(java.lang.Object o)
Determine whether this object represents the same set of values as another one.

Overrides:
equals in class java.lang.Object

writeToStream

public void writeToStream(java.io.DataOutputStream out)
                   throws java.io.IOException
Write out a serialized representation of this object to a stream.

Specified by:
writeToStream in interface ParameterValue
Throws:
java.io.IOException


Copyright © 1999-2011 by Peter Eastman.