Class DefaultDataReducer
- java.lang.Object
-
- de.gsi.chart.renderer.datareduction.DefaultDataReducer
-
- All Implemented Interfaces:
RendererDataReducer
public class DefaultDataReducer extends java.lang.Object implements RendererDataReducer
Default data reduction algorithm implementation for the ErrorDataSet Renderer
Simple algorithm that reduces the number of points if neighbouring x coordinates are closer than the user-defined dash size. Points in between are dropped and their errors propagated to the following drawn data point. N.B. numerical complexity: average = worst-case = O(n)- Author:
- rstein
-
-
Field Summary
Fields Modifier and Type Field Description protected javafx.beans.property.IntegerPropertyminPointPixelDistance
-
Constructor Summary
Constructors Constructor Description DefaultDataReducer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetMinPointPixelDistance()javafx.beans.property.IntegerPropertyminPointPixelDistanceProperty()intreducePoints(double[] xValues, double[] yValues, double[] xPointErrorsPos, double[] xPointErrorsNeg, double[] yPointErrorsPos, double[] yPointErrorsNeg, java.lang.String[] styles, boolean[] pointSelected, int indexMin, int indexMax)Internal function to the ErrorDataSetRenderer arrays are cached copies and operations are assumed to be performed in-place (<-> for performance reasons/minimisation of memory allocation)voidsetMinPointPixelDistance(int minPixelDistance)Sets theminPointPixelDistanceto the specified value.
-
-
-
Method Detail
-
getMinPointPixelDistance
public final int getMinPointPixelDistance()
- Returns:
- the
minPointPixelDistance.
-
setMinPointPixelDistance
public final void setMinPointPixelDistance(int minPixelDistance)
Sets theminPointPixelDistanceto the specified value.- Parameters:
minPixelDistance- the minimum distance between two adjacent points.
-
minPointPixelDistanceProperty
public final javafx.beans.property.IntegerProperty minPointPixelDistanceProperty()
-
reducePoints
public int reducePoints(double[] xValues, double[] yValues, double[] xPointErrorsPos, double[] xPointErrorsNeg, double[] yPointErrorsPos, double[] yPointErrorsNeg, java.lang.String[] styles, boolean[] pointSelected, int indexMin, int indexMax)Internal function to the ErrorDataSetRenderer arrays are cached copies and operations are assumed to be performed in-place (<-> for performance reasons/minimisation of memory allocation)- Specified by:
reducePointsin interfaceRendererDataReducer- Parameters:
xValues- array of x coordinatesyValues- array of y coordinatesxPointErrorsPos- array of coordinates containing x+expxPointErrorsNeg- array of coordinates containing x-exnyPointErrorsPos- array of coordinates containing x+eypyPointErrorsNeg- array of coordinates containing x+eynpointSelected- array containing the points that have been specially selected by the userindexMin- minimum index of those array that shall be consideredindexMax- maximum index of those array that shall be consideredstyles- point styles- Returns:
- effective number of points that remain after the reduction
-
-