BimCT SDK / WebGL2 Viewer
    Preparing search index...

    Class BaseBimCanvasAbstract

    Abstract base class for BIM canvas, providing core functionalities and event handling.

    Hierarchy (View Summary)

    Index

    Constructors

    • Creates an instance of BaseBimCanvas.

      Parameters

      • divElement: HTMLDivElement

        The HTML div element to attach the canvas to.

      • Optionaloptions: BaseBimCanvasOptions

        Optional configuration options for the canvas.

      Returns BaseBimCanvas

    Accessors

    • get gpuInfo(): GPUInfo

      Gets the GPU information.

      Returns GPUInfo

    • get renderer(): BaseRenderer

      Gets the renderer.

      Returns BaseRenderer

    • set renderer(renderer: BaseRenderer): void

      Sets the renderer.

      Parameters

      Returns void

    • get onCanvasRecreate(): ISignal

      Gets the canvas recreate event dispatcher.

      Returns ISignal

    • get wrapperBounds(): DOMRect

      Gets the bounding rectangle of the wrapper element.

      Returns DOMRect

    • get wrapperWidth(): number

      Gets the width of the wrapper element.

      Returns number

    • get wrapperHeight(): number

      Gets the height of the wrapper element. WARN: Not accurate on zooming windows.

      Returns number

    • get canvasWidth(): number

      Gets the width of the canvas element.

      Returns number

    • get canvasHeight(): number

      Gets the height of the canvas element.

      Returns number

    • get canvasElement(): HTMLCanvasElement

      Gets the canvas element.

      Returns HTMLCanvasElement

    • set customCursor(cursorURL: string): void

      Sets a custom cursor for the canvas.

      Parameters

      • cursorURL: string

        The URL of the custom cursor image.

      Returns void

    • get markupsElement(): HTMLDivElement

      Gets the markups div element.

      Returns HTMLDivElement

    • get legendElement(): HTMLDivElement

      Gets the legend div element.

      Returns HTMLDivElement

    • get markups(): Markups

      Gets the markups instance.

      Returns Markups

    • get legend(): Legend

      Gets the legend instance.

      Returns Legend

    • get pins(): Pins

      Gets the pins instance.

      Returns Pins

    • get viewerElement(): HTMLDivElement

      Gets the viewer div element.

      Returns HTMLDivElement

    • get windowsElement(): HTMLDivElement

      Gets the viewer div element.

      Returns HTMLDivElement

    • set windowsElement(element: HTMLDivElement): void

      Parameters

      • element: HTMLDivElement

      Returns void

    • get docWindowForWindows(): Window

      Gets the document window.

      Returns Window

    • set docWindowForWindows(window: Window): void

      Sets the document window.

      Parameters

      • window: Window

      Returns void

    • get rendererElement(): HTMLDivElement

      Gets the viewer div element.

      Returns HTMLDivElement

    • get containerElement(): HTMLDivElement

      Gets the container div element (supplied in initialization time).

      Returns HTMLDivElement

    Methods

    • Parameters

      • text: string
      • type: NotificationType
      • OptionalcloseCallback: () => void

      Returns void

    • Returns void

    • Returns boolean

    • Parameters

      • text: string

      Returns void

    • Parameters

      • text: string
      • type: NotificationType
      • OptionalcloseCallback: (result?: "yes" | "no") => void

      Returns void

    • Hides the docked notification element and removes its classes.

      Returns void

    • Controls the visibility of the close button and optionally sets a callback for the button's click event.

      Parameters

      • show: boolean

        A boolean indicating whether to show or hide the close button.

      • OptionalcloseButtonCallback: () => void

        An optional callback function to be executed when the close button is clicked.

      • OptionalbuttonTextI18n: string

        An optional text to be displayed on the close button.

      Returns void

    • Updates the close button with the given parameters.

      Parameters

      • disabled: boolean
      • OptionalbuttonTextI18n: string

      Returns void

    • Checks if the close button is visible.

      Returns boolean

      True if the close button is visible, false otherwise.

    • Destroys the canvas and performs cleanup.

      Returns Promise<void>

    • Sets the external mouse move callback.

      Parameters

      • owner: any

        The owner of the callback.

      • externalMouseMoveCallback: (event: MouseEvent) => Promise<void>

        The callback function.

      Returns void

    • Sets the external mouse up callback.

      Parameters

      • owner: any

        The owner of the callback.

      • externalMouseUpCallback: (event: MouseEvent) => void

        The callback function.

      Returns void

    • Sets the resize event callback.

      Parameters

      • owner: any

        The owner of the callback.

      • OptionalresizeEventCallback: (event: ResizeBimEvent) => void

        The callback function.

      Returns void

    • Sets the close event callback.

      Parameters

      • owner: any

        The owner of the callback.

      • OptionalcloseEventCallback: (event: BimEvent) => void

        The callback function.

      Returns void

    • Sets a custom cursor override for a specific class name.

      Parameters

      • className: string

        The class name of the element to override the cursor for (cursor-pan, cursor-rotate, cursor-crosshair, cursor-move, cursor-ne-resize, cursor-nw-resize, cursor-se-resize, cursor-sw-resize, cursor-pointer).

      • url: string

      Returns void

    • Deletes a custom cursor override for a specific class name and resets the cursor to default.

      Parameters

      • className: string

        The class name of the element to delete override the cursor for (cursor-pan, cursor-rotate, cursor-crosshair, cursor-move, cursor-ne-resize, cursor-nw-resize, cursor-se-resize, cursor-sw-resize, cursor-pointer).

      Returns void

    • Recreates the canvas.

      Returns void

    • Resizes the canvas.

      Returns Promise<void>

    • Returns Promise<void>

    • Returns void

    • Takes a snapshot image and maintains aspect ratio.

      Parameters

      • OptionalrequestedWidth: number

        The requested width of the snapshot.

      • OptionalrequestedHeight: number

        The requested height of the snapshot.

      Returns Promise<string>

      A URI that contains the image to download or use.

    • Parameters

      • OptionalrequestedWidth: number
      • OptionalrequestedHeight: number

      Returns Promise<string>

    • Crops a snapshot of the canvas at a specific location with given dimensions. If drawOverlays is true, it includes html overlays in the output.

      Parameters

      • x: number

        The x-coordinate of the top-left corner of the crop area.

      • y: number

        The y-coordinate of the top-left corner of the crop area.

      • width: number

        The width of the crop area.

      • height: number

        The height of the crop area.

      • drawOverlays: boolean = false

        Whether to include overlays in the snapshot.

      • OptionaltransparentBackgroundColor: RGB

      Returns Promise<string>

      A promise that resolves to a URI containing the cropped image.

    • Takes a snapshot of the top view of the canvas.

      Parameters

      • OptionalbBox: BoundingBox3D

        The bounding box to capture.

      • OptionaltransparentBackgroundColor: boolean

      Returns Promise<{ base64: string; width: number; height: number }>

    • Sets the visibility of the splash screen.

      Parameters

      • visible: boolean

        Whether the splash screen should be visible.

      • OptionalgifImagePath: string

        The path to the GIF image for the splash screen.

      Returns void

    • Sets the visibility of the game legend.

      Parameters

      • visible: boolean

        Whether the game legend should be visible.

      Returns void