public abstract class BdvOverlay extends Object implements OverlayRenderer
BdvFunctions.showOverlay(BdvOverlay, String, BdvOptions)
: This method
will add a dummy Source
and ConverterSetup
to the
BigDataViewer
such that the visibility, display range, and color for
the overlay can be adjusted by the user, like for a normal Source
.
Derived classes need to implement draw(Graphics2D)
. They can access
the current viewer transform using
getCurrentTransform2D(AffineTransform2D)
,
getCurrentTransform3D(AffineTransform3D)
. They can access the
user-set display range and color via info
.
Modifier and Type | Field and Description |
---|---|
protected PlaceHolderOverlayInfo |
info |
protected AffineTransform3D |
sourceTransform |
Constructor and Description |
---|
BdvOverlay() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
draw(Graphics2D g) |
void |
drawOverlays(Graphics g)
Render overlays.
|
protected void |
getCurrentTransform2D(AffineTransform2D transform)
Can be used by derived classes in the
draw(Graphics2D) method to
get the current transform from 2D source coordinates to screen
coordinates. |
protected void |
getCurrentTransform3D(AffineTransform3D transform)
Can be used by derived classes in the
draw(Graphics2D) method to
get the current transform from 3D source coordinates to 3D screen
coordinates (where Z coordinate is distance from the slice shown on the
screen). |
void |
setCanvasSize(int width,
int height)
This is called, when the screen size of the canvas (the component
displaying the image and generating mouse events) changes.
|
void |
setOverlayInfo(PlaceHolderOverlayInfo info) |
void |
setSourceTransform(AffineTransform3D t) |
protected final AffineTransform3D sourceTransform
protected PlaceHolderOverlayInfo info
public void setOverlayInfo(PlaceHolderOverlayInfo info)
public void setSourceTransform(AffineTransform3D t)
public void drawOverlays(Graphics g)
OverlayRenderer
drawOverlays
in interface OverlayRenderer
protected void getCurrentTransform2D(AffineTransform2D transform)
draw(Graphics2D)
method to
get the current transform from 2D source coordinates to screen
coordinates.transform
- protected void getCurrentTransform3D(AffineTransform3D transform)
draw(Graphics2D)
method to
get the current transform from 3D source coordinates to 3D screen
coordinates (where Z coordinate is distance from the slice shown on the
screen).transform
- protected abstract void draw(Graphics2D g)
public void setCanvasSize(int width, int height)
OverlayRenderer
setCanvasSize
in interface OverlayRenderer
width
- the new canvas width.height
- the new canvas height.Copyright © 2015–2021 Fiji. All rights reserved.