MarkupManager

class Communicator.MarkupManager()

This class provides an interface into working with markup in the viewer. More information can be found here.


Methods

activateMarkupView

MarkupManager.activateMarkupView(uniqueId[, duration])
Deprecated

Use activateMarkupViewWithPromise instead.

Arguments
  • uniqueId (Uuid) –

  • duration (number()) – optional

Return type

boolean

activateMarkupViewWithPromise

MarkupManager.activateMarkupViewWithPromise(uniqueId[, duration])

Activates a MarkupView

Arguments
  • uniqueId (Uuid) – the handle for the MarkupView object to activate

  • duration (number()) – optional the time in milliseconds for the transition to this view

Return type

Promise <boolean>

addMarkupElement

MarkupManager.addMarkupElement(element)

Add an HTML element to the markup element layer. The element will have its ID set to a system generated unique identifier.

Arguments
  • element (HTMLElement()) – the HTML Element to add

Return type

Uuid

Returns

system generated unique identifier which is the id of the passed in object

createMarkupView

MarkupManager.createMarkupView([name[, triggerEvent[, visibilityState[, colorMap[, snapshotImage]]]]])

Creates a new view based on the current camera, line, and face visibility values.

Arguments
  • name (string()) – optional optional name for the view. If omitted or null, the system will generate a default name

  • triggerEvent (boolean()) – optional optional parameter indicating whether a CallbackMap.viewCreated event should be triggered. This parameter defaults to true

  • visibilityState (VisibilityState() | null) – optional optional parameter

  • colorMap (Map <NodeId, Color()> | null) – optional

  • snapshotImage (HTMLImageElement | null()) – optional

Return type

Uuid

Returns

Unique identifier for the new view

deleteMarkupView

MarkupManager.deleteMarkupView(uniqueId)

Deletes a MarkupView object.

Arguments
  • uniqueId (Uuid) – the handle for the view object to delete

Return type

boolean

Returns

true if a MarkupView with the supplied uniqueId was deleted, false otherwise

exportMarkup

MarkupManager.exportMarkup()

export markup from the viewer

Return type

MarkupData()

Returns

Serialized markup objects

getActiveMarkupView

MarkupManager.getActiveMarkupView()

Returns the currently active MarkupView

Return type

MarkupView() | null

Returns

MarkupView object for the currently active view, or null if no view is active

getMarkupView

MarkupManager.getMarkupView(uniqueId)

Gets a MarkupView object from the viewer.

Arguments
  • uniqueId (Uuid) – the handle for the view object to retreive

Return type

MarkupView() | null

Returns

MarkupView object for the corresponding ID or null if no view was found

getMarkupViewKeys

MarkupManager.getMarkupViewKeys()
Return type

[Uuid]

Returns

an array of string keys for all markup views

getPickTolerance

MarkupManager.getPickTolerance()

Gets the pick tolerance in pixels for picking a MarkupItem

Return type

number

Returns

Current tolerance

getRenderer

MarkupManager.getRenderer()

Returns a the interface to the MarkupRenderer

Return type

MarkupRenderer()

Returns

MarkupRenderer interface

getSelectedMarkup

MarkupManager.getSelectedMarkup()

Returns the currently selected MarkupItem or null if nothing is currently selected

Return type

MarkupItem() | null

Returns

selected MarkupItem

loadMarkupData

MarkupManager.loadMarkupData(json)

Loads markup data into the viewer.

Arguments
Return type

Promise <boolean>

pickMarkupItem

MarkupManager.pickMarkupItem(point)

Picks a MarkupItem Tests scene based and markup attached to the active view (if any)

Arguments
  • point (Point2()) – position to pick against

Return type

MarkupItem() | null

Returns

MarkupItem that was selected or null if none was picked

refreshMarkup

MarkupManager.refreshMarkup()

Redraws the markup without rendering the scene. Useful when markup is added or removed but the scene is not affected.

Return type

void

registerMarkup

MarkupManager.registerMarkup(markupItem)

Registers a MarkupItem to be rendered with the 3D view.

Arguments
Return type

Uuid

Returns

unique handle to this MarkupItem

registerMarkupTypeManager

MarkupManager.registerMarkupTypeManager(markupType, markupTypeManager)

Registers a MarkupTypeManager to add markup to exported data.

Arguments
Return type

void

removeMarkupElement

MarkupManager.removeMarkupElement(id)

Removes a markup element from the markup element layer

Arguments
Return type

void

selectMarkup

MarkupManager.selectMarkup(markupItem)

Selects a MarkupItem Pass null to clear the selection.

Arguments
  • markupItem (MarkupItem() | null) – The MarkupItem to select.

Return type

void

setPickTolerance

MarkupManager.setPickTolerance(tolerance)

Sets the pick tolerance in pixels for picking a MarkupItem

Arguments
  • tolerance (number()) – The new tolerance

Return type

void

unregisterMarkup

MarkupManager.unregisterMarkup(uniqueId)

Unregisters a MarkupItem It will no longer be rendered with the 3D view.

Arguments
  • uniqueId (Uuid) – unique handle to the object that was returned from registerMarkup

Return type

void

updateLater

MarkupManager.updateLater()
Return type

void