All Packages Class Hierarchy This Package Previous Next Index
Class edu.wpi.mqp.graphics.jviz.UserBrush
java.lang.Object
|
+----edu.wpi.mqp.graphics.jviz.UserBrush
- public class UserBrush
- extends Object
- implements Cloneable, Serializable
The UserBrush class keeps track of the max and min values of the brush. It
also contains methods which will return the points that are contained within
the brush or verify if a given point is in the brush. The UserBrush class
is separate from the Brush class to more easily support multiple brush.
version 1.0 does not currently support this feature, though. In order to be
more computationally efficient, this class does implement the getActive*()
type of functions as the Data class does. Internally, this class keeps
track of all the dimensions, not just the active dimensions.
- Version:
- 1.0, created 21 NOV 1997
- Author:
- Matthew C. Jucius
-
data
-
-
max
-
-
min
-
-
pointsInBrush
-
-
UserBrush(Data)
-
Default constructor
-
getActiveCenter(int)
-
This method will return the center value of the brush in the active
dimension specified by dimension.
-
getActiveMax(int)
-
This method will return the Max value of the brush in the active
dimension specified by dimension.
-
getActiveMin(int)
-
This method will return the Min value of the brush in the active
dimension specified by dimension.
-
getCenter(int)
-
This method will return the center value of the brush in the specified
dimension.
-
getMax(int)
-
This method will return the Max value of the brush in the specified
dimension.
-
getMin(int)
-
This method will return the Min value of the brush in the specified
dimension.
-
getPointsInBrush()
-
This method returns the indices to the points in the data object that are
contained within the brush in the active brush.
-
initUserBrush()
-
This method is called by the constructor.
-
isInBrush(int)
-
This method returns a boolean value based on whether the specified point
falls entirely within the brush.
-
setActiveMax(int, double)
-
This method will set the Max value of the brush in the active
dimension specified by dimension to the value specified by newMax.
-
setActiveMin(int, double)
-
This method will set the Min value of the brush in the active
dimension specified by dimension to the value specified by newMin.
-
setBrushToRange(double, double, int)
-
This method is most likely used to form the brush perfectly around all
of the points in the given range in the given dimension.
-
setMax(int, double)
-
This method sets the Maximum value of the brush in the specified
dimension.
-
setMin(int, double)
-
This method set the min value of the brush in the specified dimension.
data
protected Data data
pointsInBrush
protected int pointsInBrush[]
max
protected double max[]
min
protected double min[]
UserBrush
public UserBrush(Data newData)
- Default constructor
- Parameters:
- newData - data object to use the brush with
initUserBrush
public boolean initUserBrush()
- This method is called by the constructor. It sets the defaults values for
the brush to take up exactly the two middle quarters of the max and min
range. For example, if values are from 5 to 25, the brush would cover
values from 10 to 20.
- Returns:
-
true
if initialization is successful. It currently
will never fail.
setBrushToRange
public boolean setBrushToRange(double newMin,
double newMax,
int dimension)
- This method is most likely used to form the brush perfectly around all
of the points in the given range in the given dimension. It is currently
used by the "shift and drag" option of the Parallel Coordinates Graph.
This method alters the brush in all dimensions, not just the active
dimensions.
NOTE: The brush if fit to the data points in every dimension except the
one dragged in. It will set max and min to the values passed reguardless
of data point values. This should be changed.
- Parameters:
- newMin - value to set as minimum
- newMax - value to set as new maximum
- dimensions - index of dimension (not active dimension)
- Returns:
-
true
if successful Currently does not return false,
but should if dimension value is invalid.
getPointsInBrush
public int[] getPointsInBrush()
- This method returns the indices to the points in the data object that are
contained within the brush in the active brush. There currently is no
getActivePointsInBrush() method as there should be. All of the variables
in this method are declared in the beginning for the slight performance
gain at the cost of clarity. This method is called frequently, so a
conscious effort was made to ensure efficient operation.
- Returns:
- exactly sized int array of the indices of the points contained
within the brush.
setMax
public boolean setMax(int dimension,
double newMax)
- This method sets the Maximum value of the brush in the specified
dimension. Use setActiveMax() to set the active dimension value.
- Parameters:
- dimension - dimension to change max
- newMax - new maximum value of brush in specified dimension
- Returns:
-
true
if operation successful
getMax
public double getMax(int dimension)
- This method will return the Max value of the brush in the specified
dimension. Use getActiveMax() to get the active dimension value.
- Parameters:
- dimension - dimension of max value to retrieve.
- Returns:
- max value of brush in the specified dimension
setMin
public boolean setMin(int dimension,
double newMin)
- This method set the min value of the brush in the specified dimension.
Use the setActiveMin() to set the active dimension value.
- Parameters:
- dimension - dimension to chenge the minimum value of
- newMin - new Minimum value of the specified dimension
- Returns:
-
true
if min set successfully
getMin
public double getMin(int dimension)
- This method will return the Min value of the brush in the specified
dimension. Use getActiveMin() to get the active dimension value.
- Parameters:
- dimension - dimension of min value to retrieve.
- Returns:
- min value of brush in the specified dimension
getCenter
public double getCenter(int dimension)
- This method will return the center value of the brush in the specified
dimension. Use getActiveCenter() to get the active dimension value.
This method is provided as a convience if the center value of the brush
is needed. This value is calculated from the max an min on each call
rather than stored in this class.
- Parameters:
- dimension - dimension of min value to retrieve.
- Returns:
- min value of brush in the specified dimension
setActiveMax
public boolean setActiveMax(int dimension,
double newMax)
- This method will set the Max value of the brush in the active
dimension specified by dimension to the value specified by newMax.
- Parameters:
- dimension - active dimension of max value to set.
- newMax - value to assign max of specified dimension
- Returns:
-
true
if operation is successful
getActiveMax
public double getActiveMax(int dimension)
- This method will return the Max value of the brush in the active
dimension specified by dimension.
- Parameters:
- dimension - active dimension of max value to retrieve.
- Returns:
- max value of brush in specified active dimension.
setActiveMin
public boolean setActiveMin(int dimension,
double newMin)
- This method will set the Min value of the brush in the active
dimension specified by dimension to the value specified by newMin.
- Parameters:
- dimension - active dimension of min value to set.
- newMin - value to assign min of specified dimension
- Returns:
-
true
if operation is successful
getActiveMin
public double getActiveMin(int dimension)
- This method will return the Min value of the brush in the active
dimension specified by dimension.
- Parameters:
- dimension - active dimension of min value to retrieve.
- Returns:
- min value of brush in specified active dimension.
getActiveCenter
public double getActiveCenter(int dimension)
- This method will return the center value of the brush in the active
dimension specified by dimension. This is a convience method.
- Parameters:
- dimension - active dimension of center value to retrieve.
- Returns:
- center value of brush in specified active dimension.
isInBrush
public boolean isInBrush(int pointIndex)
- This method returns a boolean value based on whether the specified point
falls entirely within the brush.
NOTE: It is more efficient to call getPointsInBrush() rather than call
isInBrush() on every point in a data set.
- Parameters:
- pointIndex - index of point in data class to test
- Returns:
-
true
when specified point is entirely within the
brush
false
when specified point is not in brush
All Packages Class Hierarchy This Package Previous Next Index