AnnotationAPI¶
Interface AnnotationAPI
changeAnnotation(
annotationId: number,
properties: AnnotationProperties,
): AnnotationProperties;
changeAnnotation(
annotationID: number,
label?: string,
visible?: boolean,
anchorPosition?: number[] | Float32Array<ArrayBufferLike>,
labelPosition?: number[] | Float32Array<ArrayBufferLike>,
active?: boolean,
transform?: number[] | Float32Array<ArrayBufferLike>,
): void;
createAnnotation(properties?: AnnotationProperties): number;
createAnnotation(
nodeID: number,
label: string,
visible?: boolean,
anchorPosition?: number[] | Float32Array<ArrayBufferLike>,
labelOffset?: number[] | Float32Array<ArrayBufferLike>,
): number;
getAnnotationData(annotationId: number): AnnotationData;
getAnnotations(): number[];
removeAnnotation(annotationId: number, safe?: boolean): RemoveState;
requestAnnotationData(annotationId: number): Promise<AnnotationProperties>;
}
Hierarchy (View Summary)
- AnnotationAPI
Methods
change Annotation
- changeAnnotation(
annotationId: number,
properties: AnnotationProperties,
): AnnotationProperties Changes one or more properties of an Annotation with the specified id.
Parameters
- annotationId: number
The id of the Annotation you want to change.
- properties: AnnotationProperties
The properties of the Annotation you want change.
Returns AnnotationProperties
An Object with the changed Properties.
- annotationId: number
- changeAnnotation(
annotationID: number,
label?: string,
visible?: boolean,
anchorPosition?: number[] | Float32Array<ArrayBufferLike>,
labelPosition?: number[] | Float32Array<ArrayBufferLike>,
active?: boolean,
transform?: number[] | Float32Array<ArrayBufferLike>,
): void Parameters
- annotationID: number
The ID of the Annotation.
Optional
label: stringThe text of the Annotation.
Optional
visible: booleanIndicates if the Annotation should be visible or hidden.
Optional
anchorPosition: number[] | Float32Array<ArrayBufferLike>Anchor position in world space coordinates.
Optional
labelPosition: number[] | Float32Array<ArrayBufferLike>The position of the label.
Optional
active: booleanDEPRECATED
Optional
transform: number[] | Float32Array<ArrayBufferLike>The transformation of the Annotation.
Returns void
- annotationID: number
create Annotation
- createAnnotation(properties?: AnnotationProperties): number
Creates a new Annotation.
Parameters
Optional
properties: AnnotationPropertiesInitial properties of the created Annotation.
Returns number
The id of the newly created Annotation.
- createAnnotation(
nodeID: number,
label: string,
visible?: boolean,
anchorPosition?: number[] | Float32Array<ArrayBufferLike>,
labelOffset?: number[] | Float32Array<ArrayBufferLike>,
): number Parameters
- nodeID: number
The ID of the node that the Annotation belongs to.
- label: string
The text of the Annotation.
Optional
visible: booleanIndicates if the Annotation should be visible or hidden.
Optional
anchorPosition: number[] | Float32Array<ArrayBufferLike>Anchor position in world space coordinates.
Optional
labelOffset: number[] | Float32Array<ArrayBufferLike>The offset between anchorPosition and where the label should be displayed.
Returns number
The ID of the new annotation.
- nodeID: number
get Annotation Data
- getAnnotationData(annotationId: number): AnnotationData
Parameters
- annotationId: number
The ID of the Annotation.
Returns AnnotationData
The content and properties of an annotation.
- annotationId: number
get Annotations
remove Annotation
- removeAnnotation(annotationId: number, safe?: boolean): RemoveState
Removes the Annotation from the scene and all related Snapshots.
Parameters
- annotationId: number
The ID of the Annotation.
Optional
safe: booleanPerforms a safe remove which interrupt the removal process if the Annotation is part of one or more Snapshots.
Returns RemoveState
- annotationId: number
request Annotation Data
- requestAnnotationData(annotationId: number): Promise<AnnotationProperties>
Returns the AnnotationData for the specified Annotation id.
Parameters
- annotationId: number
The id of the Annotation you want to request the data for.
Returns Promise<AnnotationProperties>
The requested Annotation data.
- annotationId: number
These functions allow the creation and management of Annotations.