artofillusion.view
Class SelectionVertexShader

java.lang.Object
  extended by artofillusion.view.SelectionVertexShader
All Implemented Interfaces:
VertexShader

public class SelectionVertexShader
extends java.lang.Object
implements VertexShader

This is a VertexShader which highlights selected faces. For unselected faces, it delegates to another shader to select the color.


Constructor Summary
SelectionVertexShader(RGBColor selectionColor, VertexShader shader, int[] faceIndex, boolean[] selected)
          Create a FlatVertexShader for a mesh.
 
Method Summary
 void getColor(int face, int vertex, RGBColor color)
          Select the color for a vertex.
 void getTextureSpec(TextureSpec spec)
          Get the texture properties of the surface.
 boolean isUniformFace(int face)
          Get whether a particular face should be rendered with a single uniform color.
 boolean isUniformTexture()
          Get whether this shader represents a uniform texture.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectionVertexShader

public SelectionVertexShader(RGBColor selectionColor,
                             VertexShader shader,
                             int[] faceIndex,
                             boolean[] selected)
Create a FlatVertexShader for a mesh.

Parameters:
selectionColor - the color to use for selected faces
shader - the shader to use for unselected faces
faceIndex - the index of the control mesh face for each face of the rendering mesh
selected - specifies which faces of the control mesh are selected
Method Detail

getColor

public void getColor(int face,
                     int vertex,
                     RGBColor color)
Select the color for a vertex.

Specified by:
getColor in interface VertexShader
Parameters:
face - the index of the triangle being rendered
vertex - the index of the vertex to color
color - the vertex color will be returned in this object

isUniformFace

public boolean isUniformFace(int face)
Get whether a particular face should be rendered with a single uniform color.

Specified by:
isUniformFace in interface VertexShader
Parameters:
face - the index of the triangle being rendered

isUniformTexture

public boolean isUniformTexture()
Get whether this shader represents a uniform texture. If this returns true, all texture properties are uniform over the entire surface (although different parts may still be colored differently due to lighting).

Specified by:
isUniformTexture in interface VertexShader

getTextureSpec

public void getTextureSpec(TextureSpec spec)
Get the texture properties of the surface. This should only be called if isUniformTexture() returns true.

Specified by:
getTextureSpec in interface VertexShader
Parameters:
spec - the surface properties will be returned in this object


Copyright © 1999-2011 by Peter Eastman.