Package sc.fiji.snt.viewer
Class Bvv.AnnotationOverlay
java.lang.Object
sc.fiji.snt.viewer.Bvv.AnnotationOverlay
- All Implemented Interfaces:
AbstractBigViewer.AnnotationOverlay
- Enclosing class:
Bvv
public static class Bvv.AnnotationOverlay
extends Object
implements AbstractBigViewer.AnnotationOverlay
Renders spherical annotations at
SNTPoint world coordinates.
Rendered with CPU (Java2D) but optimized with caching and batched rendering.-
Method Summary
Modifier and TypeMethodDescriptionvoidaddAnnotation(SNTPoint p, float radius, Color color) Add a single annotation.voidaddAnnotations(Collection<SNTPoint> points, float radius, Color color) Add annotations to the current list.voidclear()Remove all annotations.intgetCount()Returns the number of annotations currently in the overlay.inthitTest(int screenX, int screenY) Hit-tests the last-rendered screen circles against (screenX, screenY).booleanReturns true if the overlay is currently rendered.voidReplaces all annotations in one shot with a single repaint.voidsetAnnotations(Collection<SNTPoint> points, float radius, Color color) Replace the current annotations with the provided list.voidsetSelectedIndex(int index) Highlights the annotation at the given model index by rendering it in a contrasting color.voidsetVisible(boolean visible) Show/hide annotationsvoidEnsure renderers/nodes reflect current annotation list.
-
Method Details
-
setAnnotations
Replace the current annotations with the provided list. -
addAnnotations
Add annotations to the current list. -
addAnnotation
Add a single annotation.- Specified by:
addAnnotationin interfaceAbstractBigViewer.AnnotationOverlay- Parameters:
p- the position (world coordinates)radius- sphere radius in physical unitscolor- fill color
-
clear
public void clear()Remove all annotations.- Specified by:
clearin interfaceAbstractBigViewer.AnnotationOverlay
-
isVisible
public boolean isVisible()Description copied from interface:AbstractBigViewer.AnnotationOverlayReturns true if the overlay is currently rendered.- Specified by:
isVisiblein interfaceAbstractBigViewer.AnnotationOverlay
-
getCount
public int getCount()Returns the number of annotations currently in the overlay.- Specified by:
getCountin interfaceAbstractBigViewer.AnnotationOverlay
-
setVisible
public void setVisible(boolean visible) Show/hide annotations- Specified by:
setVisiblein interfaceAbstractBigViewer.AnnotationOverlay- Parameters:
visible- true to show, false to hide
-
updateScene
public void updateScene()Ensure renderers/nodes reflect current annotation list.- Specified by:
updateScenein interfaceAbstractBigViewer.AnnotationOverlay
-
setSelectedIndex
public void setSelectedIndex(int index) Description copied from interface:AbstractBigViewer.AnnotationOverlayHighlights the annotation at the given model index by rendering it in a contrasting color. Pass -1 to clear any existing highlight.- Specified by:
setSelectedIndexin interfaceAbstractBigViewer.AnnotationOverlay- Parameters:
index- model index of the annotation to highlight, or -1 for none
-
hitTest
public int hitTest(int screenX, int screenY) Hit-tests the last-rendered screen circles against (screenX, screenY). Uses a minimum hit radius of 4 px so tiny markers remain clickable.- Specified by:
hitTestin interfaceAbstractBigViewer.AnnotationOverlay- Parameters:
screenX- x coordinate in viewer-display pixelsscreenY- y coordinate in viewer-display pixels
-
replaceAll
Replaces all annotations in one shot with a single repaint. Overrides the default to avoid the per-call repaints from clear() and addAnnotation(), which can produce visible flicker.- Specified by:
replaceAllin interfaceAbstractBigViewer.AnnotationOverlay- Parameters:
points- list of positions (world coordinates); null entries are skippedsizes- sphere radii in physical units, parallel to pointscolors- fill colors, parallel to points; null entries use Color.YELLOW
-