@inweb/viewer-visualize
    Preparing search index...

    Interface IMarkup

    2D markup core interface.

    interface IMarkup {
        fontSize: number;
        lineType: string;
        lineWidth: number;
        clearOverlay(): void;
        clearSelected(): void;
        colorizeAllMarkup(r: number, g: number, b: number): void;
        colorizeSelectedMarkups(r: number, g: number, b: number): void;
        createObject(type: string, params: any): IMarkupObject;
        dispose(): void;
        enableEditMode(mode: false | MarkupMode): this;
        getMarkupColor(): { b: number; g: number; r: number };
        getObjects(): IMarkupObject[];
        getSelectedObjects(): IMarkupObject[];
        getViewpoint(viewpoint: IViewpoint): IViewpoint;
        initialize(
            container: HTMLElement,
            containerEvents?: string[],
            viewer?: IEventEmitter,
            worldTransformer?: IWorldTransform,
        ): void;
        selectObjects(objects: IMarkupObject[]): void;
        setMarkupColor(r: number, g: number, b: number): void;
        setViewpoint(viewpoint: IViewpoint): void;
        syncOverlay(): void;
    }

    Implemented by

    Index

    Properties

    fontSize: number

    Font size of new markup text.

    34
    
    lineType: string

    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

    • Releases resources allocated in the initialize().

      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

    • Selects the specified markup objects.

      Parameters

      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

    • Sets the markup state to the specified viewpoint.

      Parameters

      Returns void

    • Creates the markup overlay.

      Returns void