Package de.gsi.chart.renderer.spi
Class ContourDataSetRenderer
- java.lang.Object
-
- de.gsi.chart.renderer.spi.AbstractDataSetManagement<ContourDataSetRenderer>
-
- de.gsi.chart.renderer.spi.ContourDataSetRenderer
-
- All Implemented Interfaces:
Renderer
public class ContourDataSetRenderer extends AbstractDataSetManagement<ContourDataSetRenderer> implements Renderer
https://en.wikipedia.org/wiki/Marching_squares#Isoline- Author:
- rstein
-
-
Field Summary
Fields Modifier and Type Field Description protected javafx.scene.shape.RectanglegradientRect-
Fields inherited from class de.gsi.chart.renderer.spi.AbstractDataSetManagement
showInLegend
-
-
Constructor Summary
Constructors Constructor Description ContourDataSetRenderer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description javafx.beans.property.ObjectProperty<ColorGradient>colorGradientProperty()Color gradient (linear) used to encode data point values.booleancomputeLocalRange()Returns the value of thecomputeLocalRangeProperty().javafx.beans.property.BooleanPropertycomputeLocalRangeProperty()Indicates if the chart should compute the min/max z-Axis for the local (true) or global (false) visible rangejavafx.beans.property.ObjectProperty<ContourType>contourTypeProperty()Indicates if the chart should plot contours (true) or color gradient map (false)static doubleconvolution(double[][] pixelMatrix)javafx.scene.canvas.CanvasdrawLegendSymbol(de.gsi.dataset.DataSet dataSet, int dsIndex, int width, int height)static doubleerosionConvolution(double[][] pixelMatrix)static doubleerosionConvolution2(double[][] pixelMatrix)ColorGradientgetColorGradient()Returns the value of thecolorGradientProperty().ContourTypegetContourType()Returns the value of thecontourTypeProperty().intgetMaxContourSegments()intgetMinHexTileSizeProperty()intgetNumberQuantisationLevels()protected ContourDataSetRenderergetThis()AxisgetZAxis()booleanisSmooth()Returns the value of thesmoothProperty().protected voidlayoutZAxis(Axis zAxis, de.gsi.chart.renderer.spi.ContourDataSetRenderer.Cache lCache)javafx.beans.property.IntegerPropertymaxContourSegmentsProperty()javafx.beans.property.IntegerPropertyminHexTileSizeProperty()javafx.beans.property.IntegerPropertyquantisationLevelsProperty()voidrender(javafx.scene.canvas.GraphicsContext gc, Chart chart, int dataSetOffset, javafx.collections.ObservableList<de.gsi.dataset.DataSet> datasets)voidsetColorGradient(ColorGradient value)Sets the value of thecolorGradientProperty().voidsetComputeLocalRange(boolean value)Sets the value of thecomputeLocalRangeProperty().voidsetContourType(ContourType value)Sets the value of thecontourTypeProperty().ContourDataSetRenderersetMaxContourSegments(int nSegments)suppresses contour segments being drawn that have more than the specified number of sub-segmentsContourDataSetRenderersetMinHexTileSizeProperty(int minSize)ContourDataSetRenderersetNumberQuantisationLevels(int nQuantisation)voidsetSmooth(boolean value)Sets the value of thesmoothProperty().voidshiftZAxisToLeft()voidshiftZAxisToRight()javafx.beans.property.BooleanPropertysmoothProperty()Indicates if the chart should smooth colors between data points or render each data point as a rectangle with uniform color.-
Methods inherited from class de.gsi.chart.renderer.spi.AbstractDataSetManagement
copyMetaData, getAxes, getDataSetCopy, getDatasets, getDatasetsCopy, getDatasetsCopy, getErrorDataSetCopy, getFirstAxis, setShowInLegend, showInLegend, showInLegendProperty
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.gsi.chart.renderer.Renderer
getAxes, getDatasets, getDatasetsCopy, setShowInLegend, showInLegend, showInLegendProperty
-
-
-
-
Method Detail
-
getThis
protected ContourDataSetRenderer getThis()
- Specified by:
getThisin classAbstractDataSetManagement<ContourDataSetRenderer>- Returns:
- the instance of this ContourDataSetRenderer.
-
getZAxis
public Axis getZAxis()
-
shiftZAxisToRight
public void shiftZAxisToRight()
-
shiftZAxisToLeft
public void shiftZAxisToLeft()
-
render
public void render(javafx.scene.canvas.GraphicsContext gc, Chart chart, int dataSetOffset, javafx.collections.ObservableList<de.gsi.dataset.DataSet> datasets)
-
convolution
public static double convolution(double[][] pixelMatrix)
-
erosionConvolution
public static double erosionConvolution(double[][] pixelMatrix)
-
erosionConvolution2
public static double erosionConvolution2(double[][] pixelMatrix)
-
quantisationLevelsProperty
public javafx.beans.property.IntegerProperty quantisationLevelsProperty()
-
setNumberQuantisationLevels
public ContourDataSetRenderer setNumberQuantisationLevels(int nQuantisation)
-
getNumberQuantisationLevels
public int getNumberQuantisationLevels()
-
minHexTileSizeProperty
public javafx.beans.property.IntegerProperty minHexTileSizeProperty()
-
setMinHexTileSizeProperty
public ContourDataSetRenderer setMinHexTileSizeProperty(int minSize)
-
getMinHexTileSizeProperty
public int getMinHexTileSizeProperty()
-
maxContourSegmentsProperty
public javafx.beans.property.IntegerProperty maxContourSegmentsProperty()
- Returns:
- the property controlling the maximum number of sub-segments allowed for a contour to be drawn.
-
setMaxContourSegments
public ContourDataSetRenderer setMaxContourSegments(int nSegments)
suppresses contour segments being drawn that have more than the specified number of sub-segments- Parameters:
nSegments- the maximum number of segments- Returns:
- itself
-
getMaxContourSegments
public int getMaxContourSegments()
- Returns:
- the maximum number of segments for which a contour is being drawn
-
colorGradientProperty
public javafx.beans.property.ObjectProperty<ColorGradient> colorGradientProperty()
Color gradient (linear) used to encode data point values.- Returns:
- gradient property
-
setColorGradient
public void setColorGradient(ColorGradient value)
Sets the value of thecolorGradientProperty().- Parameters:
value- the gradient to be used
-
getColorGradient
public ColorGradient getColorGradient()
Returns the value of thecolorGradientProperty().- Returns:
- the color gradient used for encoding data values
-
smoothProperty
public javafx.beans.property.BooleanProperty smoothProperty()
Indicates if the chart should smooth colors between data points or render each data point as a rectangle with uniform color.By default smoothing is disabled.
- Returns:
- smooth property
- See Also:
ImageView.setFitWidth(double),ImageView.setFitHeight(double),ImageView.setSmooth(boolean)
-
isSmooth
public boolean isSmooth()
Returns the value of thesmoothProperty().- Returns:
trueif the smoothing should be applied,falseotherwise
-
setSmooth
public void setSmooth(boolean value)
Sets the value of thesmoothProperty().- Parameters:
value-trueto enable smoothing
-
computeLocalRangeProperty
public javafx.beans.property.BooleanProperty computeLocalRangeProperty()
Indicates if the chart should compute the min/max z-Axis for the local (true) or global (false) visible range- Returns:
- computeLocalRange property
-
computeLocalRange
public boolean computeLocalRange()
Returns the value of thecomputeLocalRangeProperty().- Returns:
trueif the local range calculation is applied,falseotherwise
-
setComputeLocalRange
public void setComputeLocalRange(boolean value)
Sets the value of thecomputeLocalRangeProperty().- Parameters:
value-trueif the local range calculation is applied,falseotherwise
-
contourTypeProperty
public javafx.beans.property.ObjectProperty<ContourType> contourTypeProperty()
Indicates if the chart should plot contours (true) or color gradient map (false)- Returns:
- plotContourProperty property
-
getContourType
public ContourType getContourType()
Returns the value of thecontourTypeProperty().- Returns:
- if the chart should plot contours (true) or color gradient map (false)
-
setContourType
public void setContourType(ContourType value)
Sets the value of thecontourTypeProperty().- Parameters:
value- if the chart should plot contours (true) or color gradient map (false)
-
layoutZAxis
protected void layoutZAxis(Axis zAxis, de.gsi.chart.renderer.spi.ContourDataSetRenderer.Cache lCache)
-
drawLegendSymbol
public javafx.scene.canvas.Canvas drawLegendSymbol(de.gsi.dataset.DataSet dataSet, int dsIndex, int width, int height)- Specified by:
drawLegendSymbolin interfaceRenderer- Parameters:
dataSet- the data set for which the representative icon should be generateddsIndex- index within renderer setwidth- requested width of the returning Canvasheight- requested height of the returning Canvas- Returns:
- a graphical icon representation of the given data sets
-
-