uk.ac.starlink.ttools.plot2.layer
Interface Outliner

All Known Implementing Classes:
PixOutliner, SizeForm.SizeOutliner, SizeXyForm.SizeXyOutliner

@Equality
public interface Outliner

Paints the shape of per-point markers. When painting, this object will not manipulate the colours; any colouring is done externally.

This interface provides two ways of drawing the same thing: with a Outliner.ShapePainter, which does it a point at a time, and with a BinPlan, which accumulates all the pixel values for the whole grid ready to paint in one go. They should represent the same data, it's up to the caller which it uses.

Since:
18 Feb 2013
Author:
Mark Taylor

Nested Class Summary
static interface Outliner.ShapePainter
          Interface to define the actual shape drawing.
 
Method Summary
 Object calculateBinPlan(Surface surface, DataGeom geom, Map<AuxScale,Range> auxRanges, DataStore dataStore, DataSpec dataSpec, Object[] knownPlans)
          Calculates an opaque object which contains the drawing of this outliner represented as an array of bins, one per pixel.
 Outliner.ShapePainter create2DPainter(Surface surface, DataGeom geom, Map<AuxScale,Range> auxRanges, PaperType2D paperType)
          Creates a ShapePainter object for plotting onto 2-dimensional surfaces.
 Outliner.ShapePainter create3DPainter(CubeSurface surface, DataGeom geom, Map<AuxScale,Range> auxRanges, PaperType3D paperType)
          Creates a ShapePainter object for plotting onto 3-dimensional surfaces.
 Map<AuxScale,AuxReader> getAuxRangers(DataGeom geom)
          Defines what non-axis ranging information is required by this outliner.
 int[] getBinCounts(Object binPlan)
          Returns the bin contents for a given bin plan produced by this object.
 Icon getLegendIcon()
          Returns an icon suitable for identifying points painted by this object in a plot legend.
 long getPointCount(Object binPlan)
          Returns the number of data positions which contributed to a BinPlan generated by this object.
 

Method Detail

getLegendIcon

Icon getLegendIcon()
Returns an icon suitable for identifying points painted by this object in a plot legend. The returned icon does not manipulate the colour of the graphics context it operates on.

Returns:
legend icon for this outliner

getAuxRangers

Map<AuxScale,AuxReader> getAuxRangers(DataGeom geom)
Defines what non-axis ranging information is required by this outliner. The return value is a map in which the keys define the ranges that must be supplied to the painting methods, and the values are reader objects that can acquire these ranges from a dataset.

Parameters:
geom - data geometry
Returns:
map of required scale keys to scale reader objects

create2DPainter

Outliner.ShapePainter create2DPainter(Surface surface,
                                      DataGeom geom,
                                      Map<AuxScale,Range> auxRanges,
                                      PaperType2D paperType)
Creates a ShapePainter object for plotting onto 2-dimensional surfaces.

Parameters:
surface - plot surface
geom - coordinate geometry
auxRanges - map of scale information required for plot
paperType - 2-d paper type
Returns:
new 2-d painter

create3DPainter

Outliner.ShapePainter create3DPainter(CubeSurface surface,
                                      DataGeom geom,
                                      Map<AuxScale,Range> auxRanges,
                                      PaperType3D paperType)
Creates a ShapePainter object for plotting onto 3-dimensional surfaces.

Parameters:
surface - 3-d plot surface
geom - coordinate geometry
auxRanges - map of scale information required for plot
paperType - 3-d paper type
Returns:
new 3-d painter

calculateBinPlan

Object calculateBinPlan(Surface surface,
                        DataGeom geom,
                        Map<AuxScale,Range> auxRanges,
                        DataStore dataStore,
                        DataSpec dataSpec,
                        Object[] knownPlans)
Calculates an opaque object which contains the drawing of this outliner represented as an array of bins, one per pixel. To make sense of the returned object, use the getBinCounts(java.lang.Object) and getPointCount(java.lang.Object) methods.

If one of the supplied knowPlans fits the bill, it will be returned without further calculation.

Parameters:
surface - plot surface
geom - coordinate geometry
auxRanges - map of scale information required for plot
dataStore - data storage
dataSpec - coordinate specification
knownPlans - list of existing plans
Returns:
bin plan, either newly calculated or taken from knownPlans

getBinCounts

int[] getBinCounts(Object binPlan)
Returns the bin contents for a given bin plan produced by this object.

Parameters:
binPlan - bin plan returned from calculateBinPlan
Returns:
array of counts, one element per bin

getPointCount

long getPointCount(Object binPlan)
Returns the number of data positions which contributed to a BinPlan generated by this object. This may or may not be the same as the sum of the pixel counts in the binCounts array; if each data position might contribute multiple pixel hits, the numbers will not be the same.

Parameters:
binPlan - bin plan returned from calculateBinPlan
Returns:
number of data positions in plan


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.