Class WAbstractGridData
- Direct Known Subclasses:
WEquidistantGridData
,WGridData
public abstract class WAbstractGridData extends WAbstractDataSeries3D
General information can be found at WAbstractDataSeries3D
. Information on how the
model is structured is provided in the subclasses. GridData can be represented in three ways.
This is indicated by Series3DType
and can be either PointSeries3D, SurfaceSeries3D or
BarSeries3D. Note that points and surfaces can only be added to charts of type ScatterPlot
, while bars can only be added to charts of type CategoryChart
.
When the data is shown as a surface, a mesh can be added to the surface. This draws lines over the surface at the positions of the x- and y-values. For bar-series data, it is possible to adjust the width of the bars in both directions.
The three types of data-representation are illustrated below.
The three representation types of grid-based data
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
Field Summary
Fields Modifier and Type Field Description static int
BAR_BUFFER_LIMIT
static int
SURFACE_SIDE_LIMIT
protected static float
zeroBarCompensation
Fields inherited from class eu.webtoolkit.jwt.chart.WAbstractDataSeries3D
chart_, model_, pointSprite_
-
Constructor Summary
Constructors Constructor Description WAbstractGridData(WAbstractItemModel model)
Constructor. -
Method Summary
Modifier and Type Method Description abstract WString
axisLabel(int u, Axis axis)
protected abstract void
barDataFromModel(java.util.List<java.nio.ByteBuffer> simplePtsArrays)
protected abstract void
barDataFromModel(java.util.List<java.nio.ByteBuffer> simplePtsArrays, java.util.List<java.nio.ByteBuffer> coloredPtsArrays, java.util.List<java.nio.ByteBuffer> coloredPtsColors)
JSlot
changeClippingMax(Axis axis)
JSlot
to change the value above which the data series will be clipped on the given axis.JSlot
changeClippingMin(Axis axis)
JSlot
to change the value below which the data series will be clipped on the given axis.void
deleteAllGLResources()
Delete GL resources.double
getBarWidthX()
Returns the bar-width in the X-axis direction.double
getBarWidthY()
Returns the bar-width in the Y-axis direction.WColor
getClippingLinesColor()
Gets the color of the clipping lines.float
getClippingMax(Axis axis)
Gets the value above which the data series will be clipped on the given axis.float
getClippingMin(Axis axis)
Gets the value below which the data series will be clipped on the given axis.java.util.List<java.lang.Object>
getGlObjects()
WAbstractColorMap
getIsoColorMap()
Get the color map for the isolines.java.util.List<java.lang.Double>
getIsoLevels()
Get all of the isoline levels.abstract int
getNbXPoints()
abstract int
getNbYPoints()
WPen
getPen()
Returns the pen that is used for drawing the mesh.Series3DType
getType()
Returns the type of representation that will be used for the data.void
initializeGL()
Initialize GL resources.boolean
isClippingLinesEnabled()
Returns whether clipping lines are enabled.boolean
isSurfaceMeshEnabled()
Returns whether the surface-mesh is enabled for this dataseries.abstract double
maximum(Axis axis)
Returns the computed maximum value of this dataseries along the given axis.abstract double
minimum(Axis axis)
Returns the computed minimum value of this dataseries along the given axis.void
paintGL()
Update the client-side painting function.WBarSelection
pickBar(int x, int y)
Return the bar that is closest to the look point at the given pixel.java.util.List<WSurfaceSelection>
pickSurface(int x, int y)
Find all points on the surface that are projected to the given pixel.void
resizeGL()
Act on resize events.void
setBarWidth(double xWidth, double yWidth)
Sets the bar-width.void
setChart(WCartesian3DChart chart)
void
setClippingLinesColor(WColor clippingLinesColor)
Sets the color of the clipping lines.void
setClippingLinesEnabled(boolean clippingLinesEnabled)
Sets whether clipping lines should be drawn where a surface is clipped.void
setClippingMax(Axis axis, float v)
Set the value above which the data series will be clipped on the given axis.void
setClippingMin(Axis axis, float v)
Set the value below which the data series will be clipped on the given axis.void
setIsoColorMap(WAbstractColorMap colormap)
Set the color map for the isolines.void
setIsoLevels(java.util.List<java.lang.Double> isoLevels)
Set isoline levels.void
setPen(WPen pen)
Sets theWPen
that is used for drawing the mesh.void
setSurfaceMeshEnabled()
Enables or disables a mesh for when a surface is drawn.void
setSurfaceMeshEnabled(boolean enabled)
Enables or disables a mesh for when a surface is drawn.void
setType(Series3DType type)
Sets the type of representation that will be used for the data.void
updateGL()
Update GL resources.Methods inherited from class eu.webtoolkit.jwt.chart.WAbstractDataSeries3D
getChart, getChartpaletteColor, getColorMap, getColorMapSide, getModel, getPointSize, getPointSprite, getPointSpriteTexture, getTitle, isColorMapVisible, isHidden, isLegendEnabled, loadPointSpriteTexture, setColorMap, setColorMapSide, setColorMapVisible, setColorMapVisible, setDefaultTitle, setHidden, setHidden, setLegendEnabled, setLegendEnabled, setModel, setPointSize, setPointSprite, setTitle
Methods inherited from class eu.webtoolkit.jwt.WObject
addChild, getId, getObjectName, remove, setFormData, setObjectName, tr
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
SURFACE_SIDE_LIMIT
public static final int SURFACE_SIDE_LIMIT- See Also:
- Constant Field Values
-
BAR_BUFFER_LIMIT
public static final int BAR_BUFFER_LIMIT- See Also:
- Constant Field Values
-
zeroBarCompensation
protected static final float zeroBarCompensation- See Also:
- Constant Field Values
-
-
Constructor Details
-
WAbstractGridData
Constructor.
-
-
Method Details
-
minimum
Description copied from class:WAbstractDataSeries3D
Returns the computed minimum value of this dataseries along the given axis.- Specified by:
minimum
in classWAbstractDataSeries3D
- See Also:
WAbstractDataSeries3D.maximum(Axis axis)
-
maximum
Description copied from class:WAbstractDataSeries3D
Returns the computed maximum value of this dataseries along the given axis.- Specified by:
maximum
in classWAbstractDataSeries3D
- See Also:
WAbstractDataSeries3D.minimum(Axis axis)
-
setType
Sets the type of representation that will be used for the data.All representations in
Series3DType
are possible for the data. Note that PointSeries3D and SurfaceSeries3D can only be used on a chart that is configured as aScatterPlot
and BarSeries3D can only be used on a chart that is configured to be aCategoryChart
.The default value is PointSeries3D.
-
getType
Returns the type of representation that will be used for the data.- See Also:
setType(Series3DType type)
-
setSurfaceMeshEnabled
public void setSurfaceMeshEnabled(boolean enabled)Enables or disables a mesh for when a surface is drawn.The default value is false. This option only takes effect when the type of this
WGridData
isSurfaceSeries3D
. The mesh is drawn at the position of the x-axis and y-axis values. -
setSurfaceMeshEnabled
public final void setSurfaceMeshEnabled()Enables or disables a mesh for when a surface is drawn. -
isSurfaceMeshEnabled
public boolean isSurfaceMeshEnabled()Returns whether the surface-mesh is enabled for this dataseries.- See Also:
setSurfaceMeshEnabled(boolean enabled)
-
setBarWidth
public void setBarWidth(double xWidth, double yWidth)Sets the bar-width.This option only takes effect when the type of this
WGridData
is BarSeries3D. The values provided should be between 0 and 1, where 1 lets the bars each take up 1/(nb of x/y-values) of the axis.The default bar-width is 0.5 in both directions.
-
getBarWidthX
public double getBarWidthX()Returns the bar-width in the X-axis direction. -
getBarWidthY
public double getBarWidthY()Returns the bar-width in the Y-axis direction. -
setPen
Sets theWPen
that is used for drawing the mesh.Used when drawing the mesh on a surface or the lines around bars. The default is a default constructed
WPen
(black and one pixel wide).Note: only the width and color of this
WPen
are used.- See Also:
setSurfaceMeshEnabled(boolean enabled)
-
getPen
Returns the pen that is used for drawing the mesh.- See Also:
setPen(WPen pen)
-
pickSurface
Find all points on the surface that are projected to the given pixel.A ray is cast from the given pixel's x,y position (from the top left of the chart, in screen coordinates) and every intersection with the surface is returned, along with its distance from the look point. Note that the coordinates of the intersection points are interpolated between the data points that make up the surface.
-
pickBar
Return the bar that is closest to the look point at the given pixel.A ray is cast from the given pixel's x,y position (from the top left of the chart, in screen coordinates), and the closest bar on this
WAbstractGridData
is returned, along with its distance from the look point.Note that if this
WAbstractGridData
is hidden, this method still returns the closest bar as if it was visible. Also, if multiple bars are on the same bar chart, the bar that is returned may be behind another data series. Use the distance field of the returnedWBarSelection
to determine which data series is in front from the given angle.If there is no bar at the given pixel, then a selection with an invalid
WModelIndex
is returned. The distance is then set to positive infinity. -
setIsoLevels
public void setIsoLevels(java.util.List<java.lang.Double> isoLevels)Set isoline levels.Isolines are drawn on the top or ground plane of the chart. Only applies if the type is SurfaceSeries3D.
The isoline levels are set in the coordinate system of the item model.
-
getIsoLevels
public java.util.List<java.lang.Double> getIsoLevels()Get all of the isoline levels. -
setIsoColorMap
Set the color map for the isolines.When no color map is defined for the isolines, i.e.
getIsoColorMap()
is set to NULL, the color map of thisWAbstractGridData
will be used.The isolines are only drawn if the type is SurfaceSeries3D.
-
getIsoColorMap
Get the color map for the isolines. -
setClippingMin
Set the value below which the data series will be clipped on the given axis.This only affects data series whose type is SurfaceSeries3D.
-
getClippingMin
Gets the value below which the data series will be clipped on the given axis.- See Also:
setClippingMin(Axis axis, float v)
-
changeClippingMin
JSlot
to change the value below which the data series will be clipped on the given axis.The
JSlot
takes one extra argument: the value to clip below.The jsRef() of this
JSlot
is only valid when thisWAbstractGridData
has been added to aWCartesian3DChart
. If thisWAbstractGridData
moves to anotherWCartesian3DChart
, the jsRef() of theJSlot
changes.- See Also:
setClippingMin(Axis axis, float v)
-
setClippingMax
Set the value above which the data series will be clipped on the given axis.This only affects data series whose type is SurfaceSeries3D.
-
getClippingMax
Gets the value above which the data series will be clipped on the given axis.- See Also:
setClippingMax(Axis axis, float v)
-
changeClippingMax
JSlot
to change the value above which the data series will be clipped on the given axis.The
JSlot
takes one extra argument: the value to clip below.The jsRef() of this
JSlot
is only valid when thisWAbstractGridData
has been added to aWCartesian3DChart
. If thisWAbstractGridData
moves to anotherWCartesian3DChart
, the jsRef() of theJSlot
changes.- See Also:
setClippingMax(Axis axis, float v)
-
setClippingLinesEnabled
public void setClippingLinesEnabled(boolean clippingLinesEnabled)Sets whether clipping lines should be drawn where a surface is clipped.Clipping lines are disabled by default. Note that rendering will be significantly slower when enabled.
-
isClippingLinesEnabled
public boolean isClippingLinesEnabled()Returns whether clipping lines are enabled. -
setClippingLinesColor
Sets the color of the clipping lines. -
getClippingLinesColor
Gets the color of the clipping lines. -
getNbXPoints
public abstract int getNbXPoints() -
getNbYPoints
public abstract int getNbYPoints() -
axisLabel
-
setChart
- Overrides:
setChart
in classWAbstractDataSeries3D
-
getGlObjects
public java.util.List<java.lang.Object> getGlObjects()- Overrides:
getGlObjects
in classWAbstractDataSeries3D
-
initializeGL
public void initializeGL()Description copied from class:WAbstractDataSeries3D
Initialize GL resources.This function is called by
initializeGL()
in the chart to which this dataseries was added.- Specified by:
initializeGL
in classWAbstractDataSeries3D
-
paintGL
public void paintGL()Description copied from class:WAbstractDataSeries3D
Update the client-side painting function.This function is called by
paintGL()
in the chart to which this dataseries was added.- Specified by:
paintGL
in classWAbstractDataSeries3D
-
updateGL
public void updateGL()Description copied from class:WAbstractDataSeries3D
Update GL resources.This function is called by
updateGL()
in the chart to which this dataseries was added. Before this function is called,deleteAllGLResources()
is called.- Specified by:
updateGL
in classWAbstractDataSeries3D
- See Also:
WAbstractDataSeries3D.deleteAllGLResources()
-
resizeGL
public void resizeGL()Description copied from class:WAbstractDataSeries3D
Act on resize events.This function is called by
resizeGL()
in the chart to which this dataseries was added.- Specified by:
resizeGL
in classWAbstractDataSeries3D
-
deleteAllGLResources
public void deleteAllGLResources()Description copied from class:WAbstractDataSeries3D
Delete GL resources.This function is called by
updateGL()
in the chart to which this dataseries was added.- Specified by:
deleteAllGLResources
in classWAbstractDataSeries3D
-
barDataFromModel
protected abstract void barDataFromModel(java.util.List<java.nio.ByteBuffer> simplePtsArrays) -
barDataFromModel
protected abstract void barDataFromModel(java.util.List<java.nio.ByteBuffer> simplePtsArrays, java.util.List<java.nio.ByteBuffer> coloredPtsArrays, java.util.List<java.nio.ByteBuffer> coloredPtsColors)
-