edu.swri.swiftvis.filters
Class ThinningFilter

java.lang.Object
  extended by edu.swri.swiftvis.filters.AbstractSingleSourceFilter
      extended by edu.swri.swiftvis.filters.ThinningFilter
All Implemented Interfaces:
DataSink, DataSource, Filter, GraphElement, java.io.Serializable

public class ThinningFilter
extends AbstractSingleSourceFilter

Author:
Mark Lewis This is a simple thinning filter that is provided in case you want to cut out a large number of elements and don't want to do it in any type of manner provided by other filters. You provide an integer, n, and only one out of every n inputs will be selected. Instead of individual elements you can also do the thinning by whole groups. This can be more useful for SWIFT so that you can keep all the particles in a timestep, but only take every 10th timestep or something along those lines. A group will always be defined as adjacent elements having the same value for the top sort formula of the input data source.
See Also:
Serialized Form

Field Summary
private  DataFormula groupFormula
           
private static long serialVersionUID
           
private  EditableInt thinFactor
           
private  EditableBoolean useGroups
           
 
Fields inherited from class edu.swri.swiftvis.filters.AbstractSingleSourceFilter
bounds, changed, dataVect, input, propPanel, sinkVector
 
Constructor Summary
  ThinningFilter()
           
private ThinningFilter(ThinningFilter c, java.util.List<GraphElement> l)
           
 
Method Summary
 ThinningFilter copy(java.util.List<GraphElement> l)
           
private  int doGroupSelection(int startIndex, int maxIndex, DataFormula sortFormula)
          Returns the elements after the group that begins at startIndex.
 java.lang.String getDescription()
           
 int getNumParameters()
           
 int getNumValues()
           
 java.lang.String getParameterDescription(int which)
          Tells you what a particular parameter is used for.
 java.lang.String getParameterName(int which, int paramVal)
          Tells you the text that should be used to describe a particular value of a given parameter.
static java.lang.String getTypeDescription()
           
 java.lang.String getValueDescription(int which)
          Tells you what a particular value is used for.
protected  void redoAllElements()
          This method is intended to reprocess all the input elements to redo the output.
protected  void setupSpecificPanelProperties()
          This method should add any tabbed panes to the propPanel that are specific to the given filter.
 boolean useParameterNameString(int which)
          If this returns true then the value of a parameter for this type should be listed as the strong value returned by getParameterName.
 
Methods inherited from class edu.swri.swiftvis.filters.AbstractSingleSourceFilter
abstractRedoAllElements, addInput, addOutput, clearData, getBounds, getElement, getNumElements, getNumOutputs, getNumSources, getOutput, getOutputInfoPanel, getPaint, getPropertiesPanel, getSource, getSourceInfoPanel, relink, removeInput, removeOutput, setBounds, sourceAltered, validInput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

thinFactor

private EditableInt thinFactor

useGroups

private EditableBoolean useGroups

groupFormula

private DataFormula groupFormula

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

ThinningFilter

public ThinningFilter()

ThinningFilter

private ThinningFilter(ThinningFilter c,
                       java.util.List<GraphElement> l)
Method Detail

getDescription

public java.lang.String getDescription()

getTypeDescription

public static java.lang.String getTypeDescription()

setupSpecificPanelProperties

protected void setupSpecificPanelProperties()
Description copied from class: AbstractSingleSourceFilter
This method should add any tabbed panes to the propPanel that are specific to the given filter. This is called when the propPanel is created. After it is called, the source and output info panels are added.

Specified by:
setupSpecificPanelProperties in class AbstractSingleSourceFilter

getParameterDescription

public java.lang.String getParameterDescription(int which)
Tells you what a particular parameter is used for.


useParameterNameString

public boolean useParameterNameString(int which)
If this returns true then the value of a parameter for this type should be listed as the strong value returned by getParameterName. Otherwise just the number should be displayed.


getParameterName

public java.lang.String getParameterName(int which,
                                         int paramVal)
Tells you the text that should be used to describe a particular value of a given parameter.


getValueDescription

public java.lang.String getValueDescription(int which)
Tells you what a particular value is used for.


getNumParameters

public int getNumParameters()

getNumValues

public int getNumValues()

copy

public ThinningFilter copy(java.util.List<GraphElement> l)

redoAllElements

protected void redoAllElements()
Description copied from class: AbstractSingleSourceFilter
This method is intended to reprocess all the input elements to redo the output. It must be properly implemented by all extending classes.

Specified by:
redoAllElements in class AbstractSingleSourceFilter

doGroupSelection

private int doGroupSelection(int startIndex,
                             int maxIndex,
                             DataFormula sortFormula)
Returns the elements after the group that begins at startIndex.

Parameters:
startIndex - The index to start the group at.
Returns:
The index of the first element not in the group.