Class PolygonOutliner
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.layer.PixOutliner
-
- uk.ac.starlink.ttools.plot2.layer.PolygonOutliner
-
- All Implemented Interfaces:
Outliner
public class PolygonOutliner extends PixOutliner
Outliner implementations for plotting shapes defined by listing three or more vertices in data space. There are lots of implementation details hidden in this class, but external users should just need the public static factory methods.- Since:
- 5 Mar 2019
- Author:
- Mark Taylor
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ShapePaintercreate2DPainter(Surface surf, DataGeom geom, java.util.Map<AuxScale,Span> auxSpans, PaperType2D paperType)Creates a ShapePainter object for plotting onto 2-dimensional surfaces.ShapePaintercreate3DPainter(CubeSurface surf, DataGeom geom, java.util.Map<AuxScale,Span> auxSpans, PaperType3D paperType)Creates a ShapePainter object for plotting onto 3-dimensional surfaces.static PolygonOutlinercreateArrayOutliner(FloatingArrayCoord arrayCoord, boolean includePos, PolygonMode.Glypher polyGlypher)Returns an outliner for polygons defined by an array-valued coordinate providing interleaved coordinates in user data space.static PolygonOutlinercreateFixedOutliner(int np, PolygonMode.Glypher polyGlypher)Returns an outliner for polygons with a fixed number of vertices.booleanequals(java.lang.Object o)java.util.Map<AuxScale,AuxReader>getAuxRangers(DataGeom geom)Defines what non-axis ranging information is required by this outliner.javax.swing.IcongetLegendIcon()Returns an icon suitable for identifying points painted by this object in a plot legend.inthashCode()-
Methods inherited from class uk.ac.starlink.ttools.plot2.layer.PixOutliner
calculateBinPlan, getBinCounts, getPointCount
-
-
-
-
Method Detail
-
getLegendIcon
public javax.swing.Icon getLegendIcon()
Description copied from interface:OutlinerReturns 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
public java.util.Map<AuxScale,AuxReader> getAuxRangers(DataGeom geom)
Description copied from interface:OutlinerDefines 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
public ShapePainter create2DPainter(Surface surf, DataGeom geom, java.util.Map<AuxScale,Span> auxSpans, PaperType2D paperType)
Description copied from interface:OutlinerCreates a ShapePainter object for plotting onto 2-dimensional surfaces.- Parameters:
surf- plot surfacegeom- coordinate geometryauxSpans- map of scale information required for plotpaperType- 2-d paper type- Returns:
- new 2-d painter
-
create3DPainter
public ShapePainter create3DPainter(CubeSurface surf, DataGeom geom, java.util.Map<AuxScale,Span> auxSpans, PaperType3D paperType)
Description copied from interface:OutlinerCreates a ShapePainter object for plotting onto 3-dimensional surfaces.- Parameters:
surf- 3-d plot surfacegeom- coordinate geometryauxSpans- map of scale information required for plotpaperType- 3-d paper type- Returns:
- new 3-d painter
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
createFixedOutliner
public static PolygonOutliner createFixedOutliner(int np, PolygonMode.Glypher polyGlypher)
Returns an outliner for polygons with a fixed number of vertices.- Parameters:
np- number of verticespolyGlypher- polygon painter- Returns:
- outliner
-
createArrayOutliner
public static PolygonOutliner createArrayOutliner(FloatingArrayCoord arrayCoord, boolean includePos, PolygonMode.Glypher polyGlypher)
Returns an outliner for polygons defined by an array-valued coordinate providing interleaved coordinates in user data space. Each array instance may be of length N*D, where D is the number of coordinates per point in user space. For instance a triangle in plane coordinates would be (x1,y1, x2,y2, x3,y3), and in sky coordinates (lon1,lat1, lon2,lat2, lon3,lat3).- Parameters:
arrayCoord- array-valued coordinateincludePos- if true, positional coordinate is included as the first vertex, if false it is ignoredpolyGlypher- polygon painter- Returns:
- outliner
-
-