Class ArrayShapePlotter
- All Implemented Interfaces:
ModePlotter<ShapeStyle>,ShapeModePlotter,Plotter<ShapeStyle>
This plotter does not report positions and point clouds in the usual way, since each row typically corresponds to a large region of the plot surface, and reporting a single point is not very helpful. Instead, the PlotLayers it supplies are doctored to adjust the coordinate ranges to cover the whole of the relevant area for the plotted rows.
- Since:
- 27 Jan 2021
- Author:
- Mark Taylor
-
Nested Class Summary
Nested classes/interfaces inherited from interface uk.ac.starlink.ttools.plot2.layer.ModePlotter
ModePlotter.Form, ModePlotter.Mode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayShapePlotter[]createArrayShapePlotters(ShapeForm[] forms, ShapeMode[] modes) Creates an array of ArrayShapePlotters, using all combinations of the specified list of ShapeForms and ShapeModes.createLayer(DataGeom pointDataGeom, DataSpec dataSpec, ShapeStyle style) Creates a PlotLayer based on the given geometry, data and style.static Function<Tuple,XYArrayData> createXYArrayReader(FloatingArrayCoord xsCoord, FloatingArrayCoord ysCoord, int icXs, int icYs, DataSpec dataSpec) Returns a reader for matched X/Y array data for use with array plotters.intgetModeCoordsIndex(DataGeom geom) Returns the index into a dataspec used by this plotter at which the first of its ShapeMode's "extra" coordinates is found.static booleanmatchesAxis(String axName, Input input) Utility method that identifies whether an Input corresponds to a named axis.Methods inherited from class uk.ac.starlink.ttools.plot2.layer.ShapePlotter
createFlat2dPlotter, createShapePlotters, createStyle, getForm, getMode, getPlotterDescription, getStyleKeysMethods inherited from class uk.ac.starlink.ttools.plot2.layer.AbstractPlotter
getCoordGroup, getPlotterIcon, getPlotterName, getRangeStyleKey, hasReportsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface uk.ac.starlink.ttools.plot2.Plotter
getCoordGroup, getPlotterIcon, getPlotterName, getRangeStyleKey, hasReports
-
Constructor Details
-
ArrayShapePlotter
Constructor.- Parameters:
name- plotter nameform- multiple shape determinermode- colour determiner
-
-
Method Details
-
getModeCoordsIndex
Description copied from class:ShapePlotterReturns the index into a dataspec used by this plotter at which the first of its ShapeMode's "extra" coordinates is found.- Overrides:
getModeCoordsIndexin classShapePlotter- Parameters:
geom- data position coordinate description- Returns:
- index of first mode-specific coordinate
-
createLayer
Description copied from interface:PlotterCreates a PlotLayer based on the given geometry, data and style.The
styleparameter is the result of a call toPlotter.createStyle(uk.ac.starlink.ttools.plot2.config.ConfigMap).The
dataSpecparameter must contain the coordinates defined by this plotter's CoordGroup.The
pointDataGeomparameter is only used if theCoordGroup.getBasicPositionCount()orCoordGroup.getExtraPositionCount()method from this plotter's CoordGroup return a non-zero value, otherwise the plot does not have point positions.It is legal to supply null for any of the parameters; if insufficient data is supplied to generate a plot, then the method should return null.
Creating a layer should be cheap; layers may be created and not used.
- Specified by:
createLayerin interfacePlotter<ShapeStyle>- Overrides:
createLayerin classShapePlotter- Parameters:
pointDataGeom- indicates base position coordinates and their mapping to points in the data spacedataSpec- specifies the data required for the plotstyle- data style as obtained fromcreateStyle- Returns:
- new plot layer, or null if no drawing will take place
-
createArrayShapePlotters
Creates an array of ArrayShapePlotters, using all combinations of the specified list of ShapeForms and ShapeModes. Since these implement theModePlotterinterface, other parts of the UI may be able to group them.- Parameters:
forms- array of shape formsmodes- array of shape modes- Returns:
forms.length*modes.length-element array of plotters
-
matchesAxis
Utility method that identifies whether an Input corresponds to a named axis. This is an ad hoc method put in place to assist in working out how to annotate axes on which array plots are represented.- Parameters:
axName- geometric axis name, e.g. "X"input- coordinate input specification- Returns:
- true iff the input corresponds to an array value specifier intended for the named axis
-
createXYArrayReader
public static Function<Tuple,XYArrayData> createXYArrayReader(FloatingArrayCoord xsCoord, FloatingArrayCoord ysCoord, int icXs, int icYs, DataSpec dataSpec) Returns a reader for matched X/Y array data for use with array plotters. If null is returned from this function, no plotting should be done.- Parameters:
xsCoord- coordinate for X arrayysCoord- coordinate for Y arrayicXs- X array coordinate index in groupicYs- Y array coordinate index in groupdataSpec- data specification- Returns:
- thread-safe function to map tuples to XYArrayData; the function returns null for tuples that should not be plotted/accumulated
-