2D markup core.

Implements

Properties

fontSize: number

Font size of new markup text.

34
lineType: MarkupLineType

Line type of new markup objects. Can be solid, dot or dash.

solid

lineWidth: number

Line width of new markup objects.

4

Methods

  • Deletes all markup objects and clears the markup overlay.

    Returns void

  • Clears the markup objects selection.

    Returns void

  • Colors all markup objects with the specified color.

    Parameters

    • r: number

      The red component of the color, as a number between 0 and 255.

    • g: number

      The green component of the color, as a number between 0 and 255.

    • b: number

      The blue component of the color, as a number between 0 and 255.

    Returns void

  • Colors the selected markup objects with the specified color.

    Parameters

    • r: number

      The red component of the color, as a number between 0 and 255.

    • g: number

      The green component of the color, as a number between 0 and 255.

    • b: number

      The blue component of the color, as a number between 0 and 255.

    Returns void

  • Enables mouse interactions to select or draw markups.

    Parameters

    • mode: false | MarkupMode

      Edit mode. Matches the type of markup object being created. Specify false to exit edit mode.

    Returns this

  • Returns the color of new markup objects.

    Returns { b: number; g: number; r: number }

  • Initializes the markup instance. Call dispose() to release allocated resources.

    Parameters

    • container: HTMLElement

      Container element used to operate on. This is usually a <canvas> or <div> on top of which the markup is drawn. If the container is a <canvas> element, its content will be combined with the markup in the viewpoint snapshot.

    • OptionalcontainerEvents: string[]

      List of container events, such as mouse events or pointer events or touch events that the markup should redirect to the viewer.

    • Optionalviewer: IEventEmitter

      Viewer instance that receives pointing device events.

    • OptionalworldTransformer: IWorldTransform

      Transformer of screen space into the viewer world space and vice versa. If a transformer is defined, markup objects will be stored at the viewpoint in world coordinates, otherwise in screen coordinates.

    Returns void

  • Sets the default color of new markup objects.

    Parameters

    • r: number

      The red component of the color, as a number between 0 and 255.

    • g: number

      The green component of the color, as a number between 0 and 255.

    • b: number

      The blue component of the color, as a number between 0 and 255.

    Returns void

  • Creates the markup overlay.

    Returns void