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 Details

    • setAnnotations

      public void setAnnotations(Collection<SNTPoint> points, float radius, Color color)
      Replace the current annotations with the provided list.
    • addAnnotations

      public void addAnnotations(Collection<SNTPoint> points, float radius, Color color)
      Add annotations to the current list.
    • addAnnotation

      public void addAnnotation(SNTPoint p, float radius, Color color)
      Add a single annotation.
      Specified by:
      addAnnotation in interface AbstractBigViewer.AnnotationOverlay
      Parameters:
      p - the position (world coordinates)
      radius - sphere radius in physical units
      color - fill color
    • clear

      public void clear()
      Remove all annotations.
      Specified by:
      clear in interface AbstractBigViewer.AnnotationOverlay
    • isVisible

      public boolean isVisible()
      Description copied from interface: AbstractBigViewer.AnnotationOverlay
      Returns true if the overlay is currently rendered.
      Specified by:
      isVisible in interface AbstractBigViewer.AnnotationOverlay
    • getCount

      public int getCount()
      Returns the number of annotations currently in the overlay.
      Specified by:
      getCount in interface AbstractBigViewer.AnnotationOverlay
    • setVisible

      public void setVisible(boolean visible)
      Show/hide annotations
      Specified by:
      setVisible in interface AbstractBigViewer.AnnotationOverlay
      Parameters:
      visible - true to show, false to hide
    • updateScene

      public void updateScene()
      Ensure renderers/nodes reflect current annotation list.
      Specified by:
      updateScene in interface AbstractBigViewer.AnnotationOverlay
    • setSelectedIndex

      public void setSelectedIndex(int index)
      Description copied from interface: AbstractBigViewer.AnnotationOverlay
      Highlights the annotation at the given model index by rendering it in a contrasting color. Pass -1 to clear any existing highlight.
      Specified by:
      setSelectedIndex in interface AbstractBigViewer.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:
      hitTest in interface AbstractBigViewer.AnnotationOverlay
      Parameters:
      screenX - x coordinate in viewer-display pixels
      screenY - y coordinate in viewer-display pixels
    • replaceAll

      public void replaceAll(List<SNTPoint> points, List<Float> sizes, List<Color> colors)
      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:
      replaceAll in interface AbstractBigViewer.AnnotationOverlay
      Parameters:
      points - list of positions (world coordinates); null entries are skipped
      sizes - sphere radii in physical units, parallel to points
      colors - fill colors, parallel to points; null entries use Color.YELLOW