public class TransformedBoxOverlay extends Object implements OverlayRenderer, TransformListener<AffineTransform3D>
OverlayRenderer
showing a TransformedBox
. Displays a
wireframe box and/or intersection with current viewer slice, with various
adjustable parameters.Modifier and Type | Class and Description |
---|---|
static class |
TransformedBoxOverlay.BoxDisplayMode
Specifies whether to show 3D wireframe box (
FULL ), or only
intersection with viewer plane (SECTION ). |
static interface |
TransformedBoxOverlay.HighlightedCornerListener |
Constructor and Description |
---|
TransformedBoxOverlay(Interval interval) |
TransformedBoxOverlay(TransformedBox bbSource) |
Modifier and Type | Method and Description |
---|---|
org.scijava.listeners.ListenableVar<TransformedBoxOverlay.BoxDisplayMode,org.scijava.listeners.ChangeListener> |
boxDisplayMode()
Get/set
BoxDisplayMode , which specifies whether to show 3D
wireframe box (FULL ), or only intersection with viewer plane
(SECTION ). |
void |
drawOverlays(Graphics g)
Render overlays.
|
void |
fillIntersection(boolean fillIntersection) |
void |
getBoxToViewerTransform(AffineTransform3D t)
Get the transformation from the local coordinate frame of the
TransformedBox to viewer coordinates. |
MouseMotionListener |
getCornerHighlighter()
Returns a
MouseMotionListener that can be installed into a bdv
(see ViewerPanel.getDisplay().addHandler(...) ). |
boolean |
getFillIntersection() |
int |
getHighlightedCornerIndex()
Get the index of the highlighted corner (if any).
|
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 |
setHighlightedCornerListener(TransformedBoxOverlay.HighlightedCornerListener highlightedCornerListener) |
void |
setIntersectionFillColor(Color intersectionFillColor) |
void |
setPerspective(double perspective)
Sets the perspective value.
|
void |
setSourceSize(double sourceSize)
Sets the source size (estimated maximum dimension) in global coordinates.
|
void |
showCornerHandles(boolean showCornerHandles) |
void |
transformChanged(AffineTransform3D t) |
public TransformedBoxOverlay(Interval interval)
public TransformedBoxOverlay(TransformedBox bbSource)
public void setPerspective(double perspective)
perspective < 0
means parallel
projection.perspective
- the perspective value.public void showCornerHandles(boolean showCornerHandles)
public void fillIntersection(boolean fillIntersection)
public boolean getFillIntersection()
public void setIntersectionFillColor(Color intersectionFillColor)
public void drawOverlays(Graphics g)
OverlayRenderer
drawOverlays
in interface OverlayRenderer
public void setCanvasSize(int width, int height)
OverlayRenderer
setCanvasSize
in interface OverlayRenderer
width
- the new canvas width.height
- the new canvas height.public void transformChanged(AffineTransform3D t)
transformChanged
in interface TransformListener<AffineTransform3D>
public org.scijava.listeners.ListenableVar<TransformedBoxOverlay.BoxDisplayMode,org.scijava.listeners.ChangeListener> boxDisplayMode()
BoxDisplayMode
, which specifies whether to show 3D
wireframe box (FULL
), or only intersection with viewer plane
(SECTION
).public void getBoxToViewerTransform(AffineTransform3D t)
TransformedBox
to viewer coordinates.t
- is set to the box-to-viewer transform.public int getHighlightedCornerIndex()
-1
if no corner is highlightedpublic MouseMotionListener getCornerHighlighter()
MouseMotionListener
that can be installed into a bdv
(see ViewerPanel.getDisplay().addHandler(...)
). If installed, it
will notify a HighlightedCornerListener
(see
setHighlightedCornerListener(HighlightedCornerListener)
) when
the mouse is over a corner of the box (with some tolerance)/MouseMotionListener
implementing mouse-over for box
cornerspublic void setHighlightedCornerListener(TransformedBoxOverlay.HighlightedCornerListener highlightedCornerListener)
public void setSourceSize(double sourceSize)
sourceSize
- estimated source size in global coordinatesCopyright © 2015–2021 Fiji. All rights reserved.