AnnotationManager
class AnnotationManager
Manager class for Annotation
constructor
new AnnotationManager(view3D)
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
view3D | View3D |
Properties
list
List of annotations
Type: Array<Annotation>
wrapper
Wrapper element for annotations
Type: HTMLElement
Methods
init
Init AnnotationManager
destroy
Destroy all annotations & event handlers
resize
Resize annotations
collect
Collect annotations inside the wrapper element
load
Load annotation JSON from URL
Returns: Promise<Annotation[]>
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
url | string | URL to annotations json |
parse
Parse an array of annotation data
Returns: Annotation[]
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
data | Array<object> | An array of annotation data |
render
Render annotations
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
camera | THREE.PerspectiveCamera | ✔️ | ||
size | THREE.Vector2 | ✔️ |
add
Add new annotation to the scene
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
annotations | Annotation | Annotations to add |
remove
Remove annotation at the given index
Returns: Annotation | null
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
index | number | Index of the annotation to remove |
reset
Remove all annotations
toJSON
Save annotations as JSON