ThreePresenter API Documentation - v0.1.2
    Preparing search index...

    Class AnnotationManager

    AnnotationManager - Manages annotation markers in a Three.js scene

    Index

    Constructors

    Methods

    • Render annotations in the scene

      Parameters

      • annotations: Annotation[]

        Array of annotations to render

      Returns void

    • Select one or more annotations

      Parameters

      • ids: string[]

        Array of annotation IDs to select

      • additive: boolean = false

        If true, add to selection; if false, replace selection

      Returns void

    • Toggle selection state of an annotation

      Parameters

      • id: string

        Annotation ID to toggle

      Returns void

    • Update marker scales for consistent screen-space size Should be called in the render loop

      Parameters

      • camera: Camera

        Current camera (perspective or orthographic)

      • canvasHeight: number

        Height of the canvas in pixels

      Returns void

    • Get the marker mesh for an annotation (for raycasting)

      Parameters

      • id: string

      Returns
          | Mesh<
              BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
              Material | Material[],
              Object3DEventMap,
          >
          | undefined

    • Get all marker meshes (for raycasting)

      Returns Mesh<
          BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
          Material | Material[],
          Object3DEventMap,
      >[]

    • Find annotation ID from a marker mesh

      Parameters

      • marker: Mesh

      Returns string | null

    • Notify picking callback with a point

      Parameters

      • point: [number, number, number]

        3D point coordinates

      Returns void

    • Create a new marker mesh

      Parameters

      • position: Vector3
      • isSelected: boolean

      Returns Mesh

    • Update a marker's appearance based on selection state

      Parameters

      • marker: Mesh
      • isSelected: boolean

      Returns void

    Properties

    scene: Scene
    config: Required<AnnotationConfig>
    markers: Map<
        string,
        Mesh<
            BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
            Material | Material[],
            Object3DEventMap,
        >,
    > = ...
    selectedIds: Set<string> = ...
    selectionCallbacks: SelectionChangeCallback[] = []
    pickCallback: PointPickedCallback | null = null