Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

Properties

ctrlId

ctrlId: string

This is the actual name of the component

el

el: ExtElement

rendered

rendered: boolean

self

self: { TypeStr: string }

Type declaration

  • TypeStr: string

Static TypeStr

TypeStr: string

Methods

getCtrlPropValue

  • getCtrlPropValue(propertyName: string): any

getHeight

  • getHeight(): number

getSize

  • getSize(): { height: number; width: number }

getViewer

  • getViewer(): Promise<any>
  • Waits until the viewer was fully loaded & bootstrapped before returning the viewer instance.

    Returns Promise<any>

    A Viewer instance or throws if an unexpected error occurs during bootstrapping.

hasCls

  • hasCls(cls: string): boolean

injectViewer

  • injectViewer(ViewerClass: any): void
  • When setting the viewer controls version property to Injected, this function is used to provide the viewer which should be used by the control.

    Example usage:

    import { Viewer } from '@combeenation/3d-viewer';
    // ...
    CfgrUtils.onCfgrReady(() => {
      // ...
      CtrlUtils.getViewerCtrl('viewer3d').injectViewer(Viewer);
      // ...
    });
    

    See Combeenation docs for more details on how to use this.

    Parameters

    • ViewerClass: any

      The Viewer class which should be used by the control

    Returns void

on

  • on(eventName: string, callback: Function, scope?: any, options?: object): void

onAfterSpecCreated

  • onAfterSpecCreated(callback: (spec: any) => void): void
  • Can be used to adjust the viewer control's auto generated spec to your likings e.g. by changing default engine settings, adding named animations & positions or manually defining variant elements etc.

    You can directly manipulate the control's auto generated spec which is passed as the only argument to the callback.

    E.g.:

    CtrlUtils.getViewerCtrl('viewer3d').onAfterSpecCreated(spec => {
      spec.scene.engine.options.useHighPrecisionMatrix = true;
      spec.scene.placements = {
        insideCar: {
          position: '(a, b, c)',
          target: '(x, y, z)',
        }
      }
    });
    

    See Combeenation docs for more details on how to use this.

    Parameters

    • callback: (spec: any) => void

      Called right after the spec has been generated and before the viewer is beeing created with the spec.
      Arguments passed to the callback:
      - spec: AutoSpecStructureJson

        • (spec: any): void
        • Parameters

          • spec: any

          Returns void

    Returns void

onBeforeBootstrap

  • onBeforeBootstrap(callback: (viewer: any, initialParams: any[]) => void): void
  • Typical use case for this is to create custom parameter observers in the callback but it can also be used to adjust the initial tag manager parameter values, add event listeners to the viewer etc.

    E.g.:

    CtrlUtils.getViewerCtrl('viewer3d').onBeforeBootstrap((viewer, initialParams) => {
      // Add custom parameter named "PivotPoint" which allows adjustment of a nodes pivot point
      viewer.tagManager.setParameterObserver('PivotPoint', async ({ nodes, newValue }) => {
        nodes
          .filter(node => node instanceof AbstractMesh)
          .forEach(node => {
            const pivotPoint = Parameter.parseVector(newValue);
            node.setPivotPoint(pivotPoint);
          });
    
        return true;
      });
    
      // Add a new initial value using the new custom parameter "PivotPoint".
      // When using the viewer control's `set parameter values` slot, you can also add these values
      // there which should be preferred whenever possible.
      initialParams.push({
        nodeName: 'doorhandle',
        parameterName: 'PivotPoint',
        value: '(x, y, z)',
      });
    });
    

    See Combeenation docs for more details on how to use this.

    Parameters

    • callback: (viewer: any, initialParams: any[]) => void

      Called right after the viewer has been created and before it is being bootstrapped with the initial tag manager parameter values.
      Arguments passed to the callback:
      - viewer: Viewer
      - initialParams: TagManagerParameterValue[]

        • (viewer: any, initialParams: any[]): void
        • Parameters

          • viewer: any
          • initialParams: any[]

          Returns void

    Returns void

setCtrlBckgr

  • setCtrlBckgr(value: string): void

setCtrlHeight

  • setCtrlHeight(value: string | number): void

setCtrlVisibility

  • setCtrlVisibility(value: boolean | Show | Hide | PluggedOut, updateCtrlProperty?: boolean): void

setCtrlWidth

  • setCtrlWidth(value: string): void

setDisabled

  • setDisabled(value: boolean): void

setUserCssClass

  • setUserCssClass(cls: string): void

startAR

  • Starts augmented reality session for the current scene content of the viewer control.

    This includes:

    • preparation and optimization of the 3d model for AR
    • redirection to AR endpoint on AR capable devices (mobiles)
    • create QR code with link to AR endpoint on non AR capable devices (desktops)
    • handle popups blocked by browsers by showing a manual link to the AR endpoint instead of performing the automatic redirect

    See Combeenation docs for more details on how to use this.

    Parameters

    Returns void

un

  • un(eventName: string, callback: Function, scope?: any): void

Generated using TypeDoc