Interface AbstractBigViewer.AnnotationOverlay

All Known Implementing Classes:
Bvv.AnnotationOverlay
Enclosing class:
AbstractBigViewer

public static interface AbstractBigViewer.AnnotationOverlay
Common contract for all viewer annotation overlays.

Concrete implementations live inside each viewer subclass (e.g., Bvv.AnnotationOverlay, AbstractBigViewer.AnnotationOverlay) and handle the viewer-specific projection and rendering. Components such as BookmarkManager depend only on this interface.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAnnotation(SNTPoint p, float radius, Color color)
    Adds a single annotation marker at the given world-space position.
    void
    Removes all annotations from the overlay and triggers a repaint.
    int
    Returns the number of annotations currently in the overlay.
    default int
    hitTest(int screenX, int screenY)
    Returns the model index of the annotation whose rendered circle/sphere contains the given screen point, or -1 if none is hit.
    boolean
    Returns true if the overlay is currently rendered.
    default void
    replaceAll(List<SNTPoint> points, List<Float> sizes, List<Color> colors)
    Replaces all annotations atomically and requests a single repaint.
    default void
    setSelectedIndex(int index)
    Highlights the annotation at the given model index by rendering it in a contrasting color.
    void
    setVisible(boolean visible)
    Shows or hides the overlay without removing its annotations.
    void
    Propagates the current annotation list to the underlying renderer and requests a repaint.
  • Method Details

    • addAnnotation

      void addAnnotation(SNTPoint p, float radius, Color color)
      Adds a single annotation marker at the given world-space position.
      Parameters:
      p - the position (world coordinates)
      radius - sphere radius in physical units
      color - fill color
    • clear

      void clear()
      Removes all annotations from the overlay and triggers a repaint.
    • getCount

      int getCount()
      Returns the number of annotations currently in the overlay.
    • isVisible

      boolean isVisible()
      Returns true if the overlay is currently rendered.
    • setVisible

      void setVisible(boolean visible)
      Shows or hides the overlay without removing its annotations.
      Parameters:
      visible - true to show, false to hide
    • updateScene

      void updateScene()
      Propagates the current annotation list to the underlying renderer and requests a repaint. Call after bulk modifications.
    • setSelectedIndex

      default void setSelectedIndex(int index)
      Highlights the annotation at the given model index by rendering it in a contrasting color. Pass -1 to clear any existing highlight.
      Parameters:
      index - model index of the annotation to highlight, or -1 for none
    • hitTest

      default int hitTest(int screenX, int screenY)
      Returns the model index of the annotation whose rendered circle/sphere contains the given screen point, or -1 if none is hit.
      Parameters:
      screenX - x coordinate in viewer-display pixels
      screenY - y coordinate in viewer-display pixels
    • replaceAll

      default void replaceAll(List<SNTPoint> points, List<Float> sizes, List<Color> colors)
      Replaces all annotations atomically and requests a single repaint. Prefer this over calling clear() + addAnnotation() in a loop, which would trigger one repaint per call and may cause visible flicker.
      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