edu.washington.NVisF.plotter
Class AlphaColoringStrategy

java.lang.Object
  |
  +--edu.washington.NVisF.plotter.AlphaColoringStrategy

public class AlphaColoringStrategy
extends java.lang.Object

An AlphaColoringStrategy uses data from a PlotCommand to compute alpha values for a set of data objects. A method is also provided to construct colors with alpha values given a set of colors. Java3D defines a Color3f object, which is an rgb color, and a Color4f object, which is an rgb color plus an alpha value. The alpha value can be used to implement transparency. If two visible objects would overlap in the view, the alpha values are compared according to a particular alpha test algorithm to determine which is displayed. See the (unfortunately meager) Java3D documentation, or other sources. The current algorithm only returns null since I haven't written a real implemetation yet.


Constructor Summary
AlphaColoringStrategy()
           
 
Method Summary
 float[] getAlphaValues(PlotCommand command)
          returns the appropriate alpha value for each data object available from the input PlotCommand command according to the algorithm for this AlphaColoringStrategy.
 Color4f[] getColors(PlotCommand command, Color3f[] colors, int multiples)
          given a input Color3f array, constructs a Color4f array by calling getAlphaValues and using makeColor4fFromColor3f for each color.
static Color4f makeColor4fFromColor3f(Color3f color, float alphaValue)
          Constructs a Color4f from the provided Color3f and alphaValue.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlphaColoringStrategy

public AlphaColoringStrategy()
Method Detail

makeColor4fFromColor3f

public static Color4f makeColor4fFromColor3f(Color3f color,
                                             float alphaValue)
Constructs a Color4f from the provided Color3f and alphaValue.

getColors

public Color4f[] getColors(PlotCommand command,
                           Color3f[] colors,
                           int multiples)
given a input Color3f array, constructs a Color4f array by calling getAlphaValues and using makeColor4fFromColor3f for each color. The input parameter multiples is needed to determine how many colors there are for each data object.
Parameters:
command - the PlotCommand providing data
colors - the input array of Color3f objects
multiples - the number of colors per data object
Returns:
Color4f the desired array of colors with alpha values

getAlphaValues

public float[] getAlphaValues(PlotCommand command)
returns the appropriate alpha value for each data object available from the input PlotCommand command according to the algorithm for this AlphaColoringStrategy. Currently returns null.