Skip to content

Class: AnnotationManager ​

Defined in: annotations.ts:37

Lightweight per-vertex annotations rendered as small markers attached to surfaces. Designed to be efficient (shared geometry) and easy to control (activate/deactivate).

Constructors ​

Constructor ​

ts
new AnnotationManager(viewer, defaults?): AnnotationManager;

Defined in: annotations.ts:59

Parameters ​

viewer ​

NeuroSurfaceViewer

defaults? ​
radius? ​

number

colorOn? ​

number

colorOff? ​

number

Returns ​

AnnotationManager

Methods ​

add() ​

ts
add(
   surfaceId, 
   vertexIndex, 
   data?, 
   options?
): string | null;

Defined in: annotations.ts:71

Parameters ​

surfaceId ​

string

vertexIndex ​

number

data? ​

any

options? ​

AnnotationOptions = {}

Returns ​

string | null


addAnchor() ​

ts
addAnchor(
   surfaceId, 
   anchor, 
   data?, 
   options?
): string | null;

Defined in: annotations.ts:151

Add an exact triangle attachment after explicit domain binding on the surface mesh.

Parameters ​

surfaceId ​

string

anchor ​

SurfaceAnchor

data? ​

unknown

options? ​

AnnotationOptions = {}

Returns ​

string | null


moveAnchor() ​

ts
moveAnchor(id, anchor): boolean;

Defined in: annotations.ts:159

Parameters ​

id ​

string

anchor ​

SurfaceAnchor

Returns ​

boolean


updatePositions() ​

ts
updatePositions(): void;

Defined in: annotations.ts:171

Called once before a viewer paint. Camera-only changes do no local-coordinate work.

Returns ​

void


list() ​

ts
list(surfaceId?): AnnotationRecord[];

Defined in: annotations.ts:198

Parameters ​

surfaceId? ​

string

Returns ​

AnnotationRecord[]


removeBySurface() ​

ts
removeBySurface(surfaceId): void;

Defined in: annotations.ts:203

Parameters ​

surfaceId ​

string

Returns ​

void


move() ​

ts
move(id, vertexIndex): boolean;

Defined in: annotations.ts:211

Parameters ​

id ​

string

vertexIndex ​

number

Returns ​

boolean


get() ​

ts
get(id): AnnotationRecord | undefined;

Defined in: annotations.ts:238

Parameters ​

id ​

string

Returns ​

AnnotationRecord | undefined


remove() ​

ts
remove(id): void;

Defined in: annotations.ts:242

Parameters ​

id ​

string

Returns ​

void


reset() ​

ts
reset(): void;

Defined in: annotations.ts:258

Returns ​

void


dispose() ​

ts
dispose(): void;

Defined in: annotations.ts:279

Returns ​

void


activate() ​

ts
activate(id, options?): void;

Defined in: annotations.ts:290

Parameters ​

id ​

string

options? ​
exclusive? ​

boolean

Returns ​

void


forEach() ​

ts
forEach(callback): void;

Defined in: annotations.ts:305

Parameters ​

callback ​

(annotation) => void

Returns ​

void


setDefaults() ​

ts
setDefaults(defaults): void;

Defined in: annotations.ts:309

Parameters ​

defaults ​
radius? ​

number

colorOn? ​

number

colorOff? ​

number

Returns ​

void

Released under the MIT License.