Class PolygonPainter
- java.lang.Object
-
- com.metsci.glimpse.core.painter.base.GlimpsePainterBase
-
- com.metsci.glimpse.core.painter.shape.PolygonPainter
-
- All Implemented Interfaces:
GlimpsePainter
public class PolygonPainter extends GlimpsePainterBase
Paints large collections of arbitrary polygons (including concave polygons). Polygons can have timestamps associated with them, and can be efficiently filtered by time (only drawing those polygons which fall within a particular time window.- Author:
- ulman
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PolygonPainter.PolygonPainterFlatColorProgram
static class
PolygonPainter.PolygonPainterLineProgram
static class
PolygonPainter.TessellatedPolygon
In PolygonPainter, a Polygon is converted to a TessellatedPolygon, which is then converted to an IdPolygon.
-
Constructor Summary
Constructors Constructor Description PolygonPainter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPolygon(Object groupId, Object polygonId, float[] dataX, float[] dataY, float z)
void
addPolygon(Object groupId, Object polygonId, long startTime, long endTime, float[] dataX, float[] dataY, float z)
void
addPolygon(Object groupId, Object polygonId, long startTime, long endTime, PolygonPainter.TessellatedPolygon tessellated, float z)
void
addPolygon(Object groupId, Object polygonId, long startTime, long endTime, Polygon geometry, float z)
void
addPolygon(Object groupId, Object polygonId, long startTime, long endTime, Shape shape, float z)
void
addPolygon(Object groupId, Object polygonId, PolygonPainter.TessellatedPolygon tessellated, float z)
void
addPolygon(Object groupId, Object polygonId, Polygon geometry, float z)
void
addPolygon(Object groupId, Object polygonId, Shape shape, float z)
static Polygon
buildPolygon(float[] geometryX, float[] geometryY)
static Polygon
buildPolygon(Shape shape)
void
clearGroup(Object groupId)
Clears an individual Polygon group, deleting all the polygons its contains but retaining its display settings.void
deleteAll()
Deletes all Polygon groups, removing their display settings and reclaiming memory.void
deleteGroup(Object groupId)
Deletes an individual Polygon group, removing its display settings and reclaiming memory.void
deletePolygon(Object groupId, Object polygonId)
void
displayTimeRange(double startTime, double endTime)
void
displayTimeRange(int groupId, long startTime, long endTime)
void
displayTimeRange(long startTime, long endTime)
void
displayTimeRange(Object groupId, double startTime, double endTime)
void
doDispose(GlimpseContext context)
void
doPaintTo(GlimpseContext context)
void
setFill(Object groupId, boolean show)
void
setFillColor(Object groupId, float[] rgba)
void
setFillColor(Object groupId, float r, float g, float b, float a)
void
setLineColor(Object groupId, float[] rgba)
void
setLineColor(Object groupId, float r, float g, float b, float a)
void
setLineDotted(Object groupId, boolean dotted)
void
setLineDotted(Object groupId, int stippleFactor, short stipplePattern)
void
setLineStyle(Object groupId, LineStyle style)
void
setLineWidth(Object groupId, float width)
void
setPolyDotted(Object groupId, boolean dotted)
void
setPolyDotted(Object groupId, byte[] stipple)
void
setShowLines(Object groupId, boolean show)
-
Methods inherited from class com.metsci.glimpse.core.painter.base.GlimpsePainterBase
dispose, getAxis1D, getAxis2D, getBounds, getGL3, isDisposed, isVisible, paintTo, requireAxis1D, requireAxis2D, setLookAndFeel, setVisible
-
-
-
-
Method Detail
-
addPolygon
public void addPolygon(Object groupId, Object polygonId, float[] dataX, float[] dataY, float z)
-
addPolygon
public void addPolygon(Object groupId, Object polygonId, PolygonPainter.TessellatedPolygon tessellated, float z)
-
addPolygon
public void addPolygon(Object groupId, Object polygonId, long startTime, long endTime, float[] dataX, float[] dataY, float z)
-
addPolygon
public void addPolygon(Object groupId, Object polygonId, long startTime, long endTime, Polygon geometry, float z)
-
addPolygon
public void addPolygon(Object groupId, Object polygonId, long startTime, long endTime, PolygonPainter.TessellatedPolygon tessellated, float z)
-
addPolygon
public void addPolygon(Object groupId, Object polygonId, long startTime, long endTime, Shape shape, float z)
-
displayTimeRange
public void displayTimeRange(Object groupId, double startTime, double endTime)
-
displayTimeRange
public void displayTimeRange(double startTime, double endTime)
-
displayTimeRange
public void displayTimeRange(int groupId, long startTime, long endTime)
-
displayTimeRange
public void displayTimeRange(long startTime, long endTime)
-
setLineColor
public void setLineColor(Object groupId, float[] rgba)
-
setLineColor
public void setLineColor(Object groupId, float r, float g, float b, float a)
-
setLineWidth
public void setLineWidth(Object groupId, float width)
-
setShowLines
public void setShowLines(Object groupId, boolean show)
-
setPolyDotted
public void setPolyDotted(Object groupId, byte[] stipple)
-
setPolyDotted
public void setPolyDotted(Object groupId, boolean dotted)
-
setLineDotted
public void setLineDotted(Object groupId, boolean dotted)
-
setLineDotted
public void setLineDotted(Object groupId, int stippleFactor, short stipplePattern)
-
setFill
public void setFill(Object groupId, boolean show)
-
setFillColor
public void setFillColor(Object groupId, float[] rgba)
-
setFillColor
public void setFillColor(Object groupId, float r, float g, float b, float a)
-
deleteAll
public void deleteAll()
Deletes all Polygon groups, removing their display settings and reclaiming memory.
-
deleteGroup
public void deleteGroup(Object groupId)
Deletes an individual Polygon group, removing its display settings and reclaiming memory.- Parameters:
groupId
- the id of the group to delete
-
clearGroup
public void clearGroup(Object groupId)
Clears an individual Polygon group, deleting all the polygons its contains but retaining its display settings.- Parameters:
groupId
- the id of the group to clear
-
doPaintTo
public void doPaintTo(GlimpseContext context)
-
buildPolygon
public static Polygon buildPolygon(float[] geometryX, float[] geometryY)
-
doDispose
public void doDispose(GlimpseContext context)
-
-