public class TrackPainter extends GlimpseDataPainter2D
TrackPainter
allows very fast
selection of specified time segments within the set of tracks, hiding
all segments outside this time window.AnimatedGeoPlotExample
Modifier and Type | Field and Description |
---|---|
static Comparator<Point> |
comparator |
static int |
QUAD_TREE_BIN_MAX |
static long |
SPATIAL_SELECTION_UPDATE_RATE |
static int |
TRACK_LABEL_OFFSET_X |
static int |
TRACK_LABEL_OFFSET_Y |
static int |
TRACK_SIZE_ESTIMATE |
BYTES_PER_FLOAT, logger
Constructor and Description |
---|
TrackPainter() |
TrackPainter(boolean enableSpatialIndex) |
Modifier and Type | Method and Description |
---|---|
void |
addPoint(Object trackId,
Object pointId,
double x,
double y,
long time) |
void |
addPoints(Object trackId,
List<Point> points) |
void |
addSpatialSelectionListener(Axis2D axis,
SpatialSelectionListener<Point> listener) |
void |
addTemporalSelectionListener(TemporalSelectionListener<Point> listener) |
void |
clearTrack(Object trackId) |
void |
deleteAll() |
void |
deleteTrack(Object trackId) |
void |
displayTimeRange(double startTime,
double endTime) |
void |
displayTimeRange(long startTime,
long endTime) |
void |
displayTimeRange(long startTime,
long endTime,
long selectedTime) |
void |
displayTimeRange(Object trackId,
double startTime,
double endTime) |
void |
displayTimeRange(Object trackId,
long startTime,
long endTime) |
void |
displayTimeRange(Object trackId,
long startTime,
long endTime,
long selectedTime) |
void |
dispose(javax.media.opengl.GLContext context) |
void |
gcDataBuffer()
Reclaims direct host memory used to move track vertices between the host and device.
|
Collection<Point> |
getGeoRange(double minX,
double maxX,
double minY,
double maxY)
Returns all Points within the given bounding box in axis coordinates (regardless
of time stamp).
|
Point |
getNearestPoint(Axis2D axis,
double centerX,
double centerY,
int maxPixelDistance)
Returns the closest point to the cursor position.
|
Point |
getNearestPoint(Axis2D axis,
int centerPixelX,
int centerPixelY,
int maxPixelDistance)
Returns the closest point to the cursor position.
|
Point |
getNearestPoint(GlimpseMouseEvent mouseEvent,
int maxPixelDistance)
Returns the closest Point to the mouse position specified in the given GlimpseMouseEvent.
|
Collection<Point> |
getPixelRange(Axis2D axis,
double centerX,
double centerY,
int pixelWidth,
int pixelHeight)
Returns all the Points within the bounding box specified with a center in axis coordinates
and width/height specified in pixels.
|
Collection<Point> |
getTimeGeoRange(double minX,
double maxX,
double minY,
double maxY) |
Collection<Point> |
getTimeGeoRange(double minTime,
double maxTime,
double minX,
double maxX,
double minY,
double maxY) |
Collection<Point> |
getTimeGeoRange(long minTime,
long maxTime,
double minX,
double maxX,
double minY,
double maxY) |
Collection<Point> |
getTimePixelRange(Axis2D axis,
double minTime,
double maxTime,
double centerX,
double centerY,
int pixelWidth,
int pixelHeight) |
Point |
getTrackHead(Object trackId) |
Collection<Point> |
getTrackHeads() |
void |
paintTo(javax.media.opengl.GL2 gl,
GlimpseBounds bounds,
Axis2D axis) |
void |
removeTemporalSelectionListener(TemporalSelectionListener<Point> listener) |
void |
setDotted(Object trackId,
boolean dotted) |
void |
setDotted(Object trackId,
int stippleFactor,
short stipplePattern) |
void |
setHeadPointColor(Object trackId,
float[] color) |
void |
setHeadPointColor(Object trackId,
float r,
float g,
float b,
float a) |
void |
setHeadPointSize(Object trackId,
float size) |
void |
setLabel(Object trackId,
String label) |
void |
setLabelColor(Object trackId,
float[] color) |
void |
setLabelColor(Object trackId,
float r,
float g,
float b,
float a) |
void |
setLabelLineColor(Object trackId,
float[] color) |
void |
setLabelLineColor(Object trackId,
float r,
float g,
float b,
float a) |
void |
setLineColor(Object trackId,
float[] color) |
void |
setLineColor(Object trackId,
float r,
float g,
float b,
float a) |
void |
setLineWidth(Object trackId,
float width) |
void |
setPointColor(Object trackId,
float[] color) |
void |
setPointColor(Object trackId,
float r,
float g,
float b,
float a) |
void |
setPointSize(Object trackId,
float size) |
void |
setShowHeadPoint(Object trackId,
boolean show) |
void |
setShowLabel(Object trackId,
boolean show) |
void |
setShowLabelLine(Object trackId,
boolean show) |
void |
setShowLines(Object trackId,
boolean show) |
void |
setShowPoints(Object trackId,
boolean show) |
isAlphaBlend, isLineSmooth, isPointSmooth, paintTo, setAlphaBlend, setLineSmooth, setPointSmooth
paintTo
dispose, isDisposed, isVisible, paintTo, setErrorHandling, setLookAndFeel, setVisible
public static final int QUAD_TREE_BIN_MAX
public static final long SPATIAL_SELECTION_UPDATE_RATE
public static final int TRACK_SIZE_ESTIMATE
public static final int TRACK_LABEL_OFFSET_X
public static final int TRACK_LABEL_OFFSET_Y
public static final Comparator<Point> comparator
public TrackPainter()
public TrackPainter(boolean enableSpatialIndex)
public void addTemporalSelectionListener(TemporalSelectionListener<Point> listener)
public void removeTemporalSelectionListener(TemporalSelectionListener<Point> listener)
public void addSpatialSelectionListener(Axis2D axis, SpatialSelectionListener<Point> listener)
public Collection<Point> getTrackHeads()
public void deleteAll()
public void deleteTrack(Object trackId)
public void clearTrack(Object trackId)
public void setLineColor(Object trackId, float[] color)
public void setLineColor(Object trackId, float r, float g, float b, float a)
public void setLineWidth(Object trackId, float width)
public void setPointColor(Object trackId, float[] color)
public void setPointColor(Object trackId, float r, float g, float b, float a)
public void setPointSize(Object trackId, float size)
public void setShowPoints(Object trackId, boolean show)
public void setHeadPointColor(Object trackId, float[] color)
public void setHeadPointColor(Object trackId, float r, float g, float b, float a)
public void setHeadPointSize(Object trackId, float size)
public void setShowHeadPoint(Object trackId, boolean show)
public void setShowLines(Object trackId, boolean show)
public void setDotted(Object trackId, boolean dotted)
public void setDotted(Object trackId, int stippleFactor, short stipplePattern)
public void setLabelColor(Object trackId, float[] color)
public void setLabelColor(Object trackId, float r, float g, float b, float a)
public void setLabelLineColor(Object trackId, float[] color)
public void setLabelLineColor(Object trackId, float r, float g, float b, float a)
public void setShowLabelLine(Object trackId, boolean show)
public void setShowLabel(Object trackId, boolean show)
public void displayTimeRange(Object trackId, double startTime, double endTime)
public void displayTimeRange(double startTime, double endTime)
public void displayTimeRange(Object trackId, long startTime, long endTime)
public void displayTimeRange(Object trackId, long startTime, long endTime, long selectedTime)
public void displayTimeRange(long startTime, long endTime)
public void displayTimeRange(long startTime, long endTime, long selectedTime)
public Collection<Point> getGeoRange(double minX, double maxX, double minY, double maxY)
minX
- left edge of the bounding boxmaxX
- right edge of the bounding boxminY
- bottom edge of the bounding boxmaxY
- top edge of the bounding boxpublic Collection<Point> getTimePixelRange(Axis2D axis, double minTime, double maxTime, double centerX, double centerY, int pixelWidth, int pixelHeight)
public Collection<Point> getPixelRange(Axis2D axis, double centerX, double centerY, int pixelWidth, int pixelHeight)
Returns all the Points within the bounding box specified with a center in axis coordinates and width/height specified in pixels.
This is useful for querying for points near the cursor. When used in this way, the pixelWidth and pixelHeight arguments control how close the user must get to a point before it is selected. The Axis2D argument is usually obtained from a GlimpseMouseListener.
axis
- the axis to use to convert pixel values into axis coordinates.centerX
- the x center of the query box in axis coordinatescenterY
- the y center of the query box in axis coordinatespixelWidth
- the width of the query box in pixelspixelHeight
- the height of the query box in pixelspublic Point getNearestPoint(Axis2D axis, double centerX, double centerY, int maxPixelDistance)
axis
- the axis to use to convert pixel values into axis coordinatescenterX
- the x center of the query box in axis coordinatescenterY
- the y center of the query box in axis coordinatesmaxPixelDistance
- only search for nearby points within this pixel radiuspublic Point getNearestPoint(GlimpseMouseEvent mouseEvent, int maxPixelDistance)
mouseEvent
- event containing a mouse positionmaxPixelDistance
- the farthest point allowedpublic Point getNearestPoint(Axis2D axis, int centerPixelX, int centerPixelY, int maxPixelDistance)
axis
- the axis to use to convert pixel values into axis coordinatescenterPixelX
- the x center of the query box in pixel coordinatescenterPixelY
- the y center of the query box in pixel coordinatesmaxPixelDistance
- only search for nearby points within this pixel radiuspublic Collection<Point> getTimeGeoRange(double minTime, double maxTime, double minX, double maxX, double minY, double maxY)
public Collection<Point> getTimeGeoRange(long minTime, long maxTime, double minX, double maxX, double minY, double maxY)
public Collection<Point> getTimeGeoRange(double minX, double maxX, double minY, double maxY)
public void gcDataBuffer()
public void paintTo(javax.media.opengl.GL2 gl, GlimpseBounds bounds, Axis2D axis)
paintTo
in class GlimpseDataPainter2D
public void dispose(javax.media.opengl.GLContext context)
Copyright © 2013 Metron, Inc.. All rights reserved.