edu.washington.NVisF.plotter
Class LineCloudStrategy

java.lang.Object
  |
  +--edu.washington.NVisF.plotter.PlotStrategy
        |
        +--edu.washington.NVisF.plotter.LineCloudStrategy

public class LineCloudStrategy
extends PlotStrategy

A LineCloudStrategy provides a strategy for representing a 3D vector field as a single 3D visualization object where the vector for each data object is represented as a line starting from the object's position. The endpoint of the vector is set by a VectorStrategy object which is a required component of this Strategy along with a PositionStrategy and AppearanceStrategy. The completed 3D visualization object is wrapped in an ObjectGroup.

See Also:
PositionStrategy, VectorStrategy, ColoringStrategy, AlphaColoringStrategy, AppearanceStrategy, javax.media.j3d.LineArray

Constructor Summary
LineCloudStrategy()
          Constructs a simple LineCloudStrategy with a default PositionStrategy, VectorStrategy, and AppearanceStrategy.
LineCloudStrategy(PositionStrategy positionStrategy, VectorStrategy vectorStrategy, ColoringStrategy coloringStrategy, AlphaColoringStrategy alphaColoringStrategy, AppearanceStrategy appearanceStrategy)
          Constructs a LineCloudStrategy that will use the specified components for its positions, vector enpoints, colors, alpha values, and Appearance.
LineCloudStrategy(PositionStrategy positionStrategy, VectorStrategy vectorStrategy, ColoringStrategy coloringStrategy, AppearanceStrategy appearanceStrategy)
          Constructs a LineCloudStrategy that will use the specified components for its positions, vector enpoints, colors, and Appearance.
 
Method Summary
 AlphaColoringStrategy getAlphaColoringStrategy()
          returns the AlphaColoringStrategy that provides alpha values for this PlotStrategy.
 Appearance getAppearance(PlotCommand command)
          returns an Appearance object appropriate to the given PlotCommand.
 AppearanceStrategy getAppearanceStrategy()
          returns the AppearanceStrategy that provides Appearance objects for this PlotStrategy.
 ColoringStrategy getColoringStrategy()
          returns the ColoringStrategy that provides colors for this PlotStrategy.
 GeometryArray[] getGeometryArrays(PlotCommand command)
          builds the GeometryArray[] for the specified PlotCommand.
 PositionStrategy getPositionStrategy()
          returns the PositionStrategy that provides coordinates for this PlotStrategy.
 VectorStrategy getVectorStrategy()
          returns the VectorStrategy that provides vector endpoints for this PlotStrategy.
 int getVertexFormat()
          returns the vertexFormat used to construct the GeometryArray.
 void setAlphaColoringStrategy(AlphaColoringStrategy alphaColoringStrategy)
          setss the AlphaColoringStrategy that provides alpha values for this PlotStrategy.
 void setAppearanceStrategy(AppearanceStrategy appearanceStrategy)
          sets the AppearanceStrategy that provides Appearance objects for this PlotStrategy.
 void setColoringStrategy(ColoringStrategy coloringStrategy)
          sets the ColoringStrategy that provides colors for this PlotStrategy.
 void setPositionStrategy(PositionStrategy positionStrategy)
          sets the PositionStrategy that provides coordinates for this PlotStrategy.
 void setVectorStrategy(VectorStrategy vectorStrategy)
          sets the VectorStrategy that provides vector endpoints for this PlotStrategy.
 void setVertexFormat(int format)
          sets the vertexFormat used to construct the GeometryArray.
static float[] vectorSum(float[] first, float[] second)
          Utility method for adding two floating point arrays.
 
Methods inherited from class edu.washington.NVisF.plotter.PlotStrategy
getShape3Ds, getShape3Ds, getShape3Ds
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineCloudStrategy

public LineCloudStrategy()
Constructs a simple LineCloudStrategy with a default PositionStrategy, VectorStrategy, and AppearanceStrategy.

LineCloudStrategy

public LineCloudStrategy(PositionStrategy positionStrategy,
                         VectorStrategy vectorStrategy,
                         ColoringStrategy coloringStrategy,
                         AppearanceStrategy appearanceStrategy)
Constructs a LineCloudStrategy that will use the specified components for its positions, vector enpoints, colors, and Appearance. It will use ordinary (Color3f) colors.
Throws:
NullPointerException - if positionStrategy, vectorStrategy, or appearanceStrategy is null

LineCloudStrategy

public LineCloudStrategy(PositionStrategy positionStrategy,
                         VectorStrategy vectorStrategy,
                         ColoringStrategy coloringStrategy,
                         AlphaColoringStrategy alphaColoringStrategy,
                         AppearanceStrategy appearanceStrategy)
Constructs a LineCloudStrategy that will use the specified components for its positions, vector enpoints, colors, alpha values, and Appearance. It will use colors with alpha values (Color4f).
Throws:
NullPointerException - if positionStrategy, vectorStrategy, or appearanceStrategy is null
Method Detail

getAppearance

public Appearance getAppearance(PlotCommand command)
returns an Appearance object appropriate to the given PlotCommand.
Overrides:
getAppearance in class PlotStrategy

getGeometryArrays

public GeometryArray[] getGeometryArrays(PlotCommand command)
builds the GeometryArray[] for the specified PlotCommand. Positions, vector endpoints, colors, and alpha values are provided by the appropriate components if available. The vertex format for the GemetryArraya is taken from the most recent setVertexFormat(int) method call, which is also called from the constructors.
Overrides:
getGeometryArrays in class PlotStrategy
Throws:
NullPointerException - if no positions or vector endpoints are available to construct the GeometryArraya
See Also:
GeometryArray

vectorSum

public static float[] vectorSum(float[] first,
                                float[] second)
Utility method for adding two floating point arrays. The length of the return array is the smaller of the lengths of the input arrays, and each element is the sum of the corresponding input array elements.
Throws:
NullPointerException - if either argument is null

getVertexFormat

public int getVertexFormat()
returns the vertexFormat used to construct the GeometryArray. See the GeometryArray class for a definition of this format.

setVertexFormat

public void setVertexFormat(int format)
sets the vertexFormat used to construct the GeometryArray. See the GeometryArray class for a definition of this format.

getPositionStrategy

public PositionStrategy getPositionStrategy()
returns the PositionStrategy that provides coordinates for this PlotStrategy.

setPositionStrategy

public void setPositionStrategy(PositionStrategy positionStrategy)
sets the PositionStrategy that provides coordinates for this PlotStrategy.
Throws:
NullPointerException - if the supplied argument is null

getVectorStrategy

public VectorStrategy getVectorStrategy()
returns the VectorStrategy that provides vector endpoints for this PlotStrategy.

setVectorStrategy

public void setVectorStrategy(VectorStrategy vectorStrategy)
sets the VectorStrategy that provides vector endpoints for this PlotStrategy.
Throws:
NullPointerException - if the supplied argument is null

getColoringStrategy

public ColoringStrategy getColoringStrategy()
returns the ColoringStrategy that provides colors for this PlotStrategy.

setColoringStrategy

public void setColoringStrategy(ColoringStrategy coloringStrategy)
sets the ColoringStrategy that provides colors for this PlotStrategy.

getAlphaColoringStrategy

public AlphaColoringStrategy getAlphaColoringStrategy()
returns the AlphaColoringStrategy that provides alpha values for this PlotStrategy.

setAlphaColoringStrategy

public void setAlphaColoringStrategy(AlphaColoringStrategy alphaColoringStrategy)
setss the AlphaColoringStrategy that provides alpha values for this PlotStrategy.

getAppearanceStrategy

public AppearanceStrategy getAppearanceStrategy()
returns the AppearanceStrategy that provides Appearance objects for this PlotStrategy.

setAppearanceStrategy

public void setAppearanceStrategy(AppearanceStrategy appearanceStrategy)
sets the AppearanceStrategy that provides Appearance objects for this PlotStrategy.
Throws:
NullPointerException - if the supplied argument is null