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
-
-
Field Summary
Fields Modifier and Type Field Description static ConfigKey<MarkShape>
MINSHAPE_KEY
Config key for the replacement marker shape.static ConfigKey<java.lang.Integer>
MINSIZE_KEY
Config key for the replacement marker threshold size.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ShapePainter
create2DPainter(Surface surf, DataGeom geom, java.util.Map<AuxScale,Span> auxSpans, PaperType2D paperType)
Creates a ShapePainter object for plotting onto 2-dimensional surfaces.ShapePainter
create3DPainter(CubeSurface surf, DataGeom geom, java.util.Map<AuxScale,Span> auxSpans, PaperType3D paperType)
Creates a ShapePainter object for plotting onto 3-dimensional surfaces.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.static PolygonOutliner
createFixedOutliner(int np, PolygonMode.Glypher polyGlypher, int minSize, MarkShape minShape)
Returns an outliner for polygons with a fixed number of vertices.static PolygonOutliner
createPlaneAreaOutliner(AreaCoord<PlaneDataGeom> coord, int icArea, PolygonMode.Glypher polyGlypher, int minSize, MarkShape minShape)
Returns an outliner for drawing Area objects to a Plane plot.static PolygonOutliner
createSkyAreaOutliner(AreaCoord<SkyDataGeom> coord, int icArea, PolygonMode.Glypher polyGlypher, int minSize, MarkShape minShape)
Returns an outliner for drawing Area objects to a Sky plot.static PolygonOutliner
createSphereAreaOutliner(AreaCoord<SphereDataGeom> areaCoord, int icArea, FloatingCoord radialCoord, int icRadial, PolygonMode.Glypher polyGlypher, int minSize, MarkShape minShape)
Returns an outliner for drawing Area objects to a Sphere plot.boolean
equals(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.Icon
getLegendIcon()
Returns an icon suitable for identifying points painted by this object in a plot legend.int
hashCode()
-
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:Outliner
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
public java.util.Map<AuxScale,AuxReader> getAuxRangers(DataGeom geom)
Description copied from interface:Outliner
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
public ShapePainter create2DPainter(Surface surf, DataGeom geom, java.util.Map<AuxScale,Span> auxSpans, PaperType2D paperType)
Description copied from interface:Outliner
Creates 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:Outliner
Creates 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:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
createFixedOutliner
public static PolygonOutliner createFixedOutliner(int np, PolygonMode.Glypher polyGlypher, int minSize, MarkShape minShape)
Returns an outliner for polygons with a fixed number of vertices.- Parameters:
np
- number of verticespolyGlypher
- polygon painterminSize
- threshold size for replacement markersminShape
- shape for replacement markers- Returns:
- outliner
-
createPlaneAreaOutliner
public static PolygonOutliner createPlaneAreaOutliner(AreaCoord<PlaneDataGeom> coord, int icArea, PolygonMode.Glypher polyGlypher, int minSize, MarkShape minShape)
Returns an outliner for drawing Area objects to a Plane plot.- Parameters:
coord
- coordinate for reading area objectsicArea
- coordinate index in tuple for area coordinatepolyGlypher
- polygon painterminSize
- threshold size for replacement markersminShape
- shape for replacement markers- Returns:
- outliner
-
createSkyAreaOutliner
public static PolygonOutliner createSkyAreaOutliner(AreaCoord<SkyDataGeom> coord, int icArea, PolygonMode.Glypher polyGlypher, int minSize, MarkShape minShape)
Returns an outliner for drawing Area objects to a Sky plot.- Parameters:
coord
- coordinate for reading area objectsicArea
- coordinate index in tuple for area coordinatepolyGlypher
- polygon painterminSize
- threshold size for replacement markersminShape
- shape for replacement markers- Returns:
- outliner
-
createSphereAreaOutliner
public static PolygonOutliner createSphereAreaOutliner(AreaCoord<SphereDataGeom> areaCoord, int icArea, FloatingCoord radialCoord, int icRadial, PolygonMode.Glypher polyGlypher, int minSize, MarkShape minShape)
Returns an outliner for drawing Area objects to a Sphere plot.- Parameters:
areaCoord
- coordinate for reading area objectsicArea
- coordinate index in tuple for area coordinateradialCoord
- coordinate for reading radial distance of areaicRadial
- coordinate index in tuple for radial coordinatepolyGlypher
- polygon painterminSize
- threshold size for replacement markersminShape
- shape for replacement markers- 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
-
-