Communicator.MarkupManager

 MarkupManager

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

Methods

activateMarkupView    [deprecated]

  • activateMarkupView(uniqueId: Uuid, duration?: number): boolean

activateMarkupViewWithPromise

  • activateMarkupViewWithPromise(uniqueId: Uuid, duration?: number): Promise<boolean>
  • Activates a MarkupView.

    Parameters

    • uniqueId: Uuid

      the handle for the MarkupView object to activate

    • Optional duration: number

      the time in milliseconds for the transition to this view

    Returns Promise<boolean>

addMarkupElement

  • addMarkupElement(element: HTMLElement): Uuid
  • Add an HTML element to the markup element layer. The element will have its ID set to a system generated unique identifier.

    Parameters

    • element: HTMLElement

      the HTML Element to add

    Returns Uuid

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

createMarkupView

  • createMarkupView(name?: string, triggerEvent?: boolean, visibilityState?: VisibilityState | null, colorMap?: Map<NodeId, Color> | null, snapshotImage?: HTMLImageElement | null): Uuid
  • Creates a new view based on the current camera, line, and face visibility values.

    Parameters

    • Optional name: string

      optional name for the view. If omitted or null, the system will generate a default name

    • Optional triggerEvent: boolean

      optional parameter indicating whether a CallbackMap.viewCreated event should be triggered. This parameter defaults to true

    • Optional visibilityState: VisibilityState | null

      optional parameter

    • Optional colorMap: Map<NodeId, Color> | null
    • Optional snapshotImage: HTMLImageElement | null

    Returns Uuid

    Unique identifier for the new view

deleteMarkupView

  • deleteMarkupView(uniqueId: Uuid): boolean
  • Deletes a MarkupView object.

    Parameters

    • uniqueId: Uuid

      the handle for the view object to delete

    Returns boolean

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

exportMarkup

  • export markup from the viewer

    Returns MarkupData

    Serialized markup objects

getActiveMarkupView

getMarkupView

  • Gets a MarkupView object from the viewer.

    Parameters

    • uniqueId: Uuid

      the handle for the view object to retreive

    Returns MarkupView | null

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

getMarkupViewKeys

  • getMarkupViewKeys(): Uuid[]
  • Returns Uuid[]

    an array of string keys for all markup views

getPickTolerance

  • getPickTolerance(): number
  • Gets the pick tolerance in pixels for picking a MarkupItem

    Returns number

    Current tolerance

getRenderer

getSelectedMarkup

loadMarkupData

  • loadMarkupData(json: string | MarkupData): Promise<boolean>
  • Loads markup data into the viewer.

    Parameters

    Returns Promise<boolean>

pickMarkupItem

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

    Parameters

    • point: Point2

      position to pick against

    Returns MarkupItem | null

    MarkupItem that was selected or null if none was picked

refreshMarkup

  • refreshMarkup(): void
  • Redraws the markup without rendering the scene. Useful when markup is added or removed but the scene is not affected.

    Returns void

registerMarkup

registerMarkupTypeManager

  • registerMarkupTypeManager(markupType: string, markupTypeManager: MarkupTypeManager): void
  • Registers a MarkupTypeManager to add markup to exported data.

    Parameters

    Returns void

removeMarkupElement

  • removeMarkupElement(id: Uuid): void
  • Removes a markup element from the markup element layer

    Parameters

    Returns void

selectMarkup

  • selectMarkup(markupItem: MarkupItem | null): void

setPickTolerance

  • setPickTolerance(tolerance: number): void
  • Sets the pick tolerance in pixels for picking a MarkupItem

    Parameters

    • tolerance: number

      The new tolerance

    Returns void

unregisterMarkup

  • unregisterMarkup(uniqueId: Uuid): void
  • Unregisters a MarkupItem. It will no longer be rendered with the 3D view.

    Parameters

    Returns void

updateLater

  • updateLater(): void
  • Returns void