ViewerAPI

Interface ViewerAPI

The ViewerDrawingAPI provides basic functionalities to control the 2D Drawing Mode and the processed Output.

Hierarchy

Methods

  • Animates to the given viewmatrix

    Parameters

    • matrix: Float32Array | [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]

      The new view matrix for the camera

    • Optional transitionTime: number

      Defines the transition time for the camera movement

    Returns Promise<void>

  • Changes the properties of the Polyline with the specified Id.

    Parameters

    • polylineId: number

      The Id of the Polyline which should be removed.

    • properties: PolylineProperties

      The properties which should be changed.

    Returns void

  • Changes the viewer setting with the given name to the given value.

    Type Parameters

    • T extends string

    Parameters

    • viewerSetting: T

      Specifies a particular viewer setting which one would like to change.

    • value: ViewerSettingType<T>

      A new value for the specified setting.

    Returns boolean

    A boolean which indicates if the setting has changed

  • Parameters

    • userGeoData: UserGeometryData

    Returns number

  • Creates a new Polyline with the specified positions and properties.

    Parameters

    • positions: number[]

      List of 3D positions which defines the Polyline.

    • Optional properties: PolylineProperties

      The properties of the Polyline.

    Returns number

  • Disable highlighting for the handle

    Parameters

    • Optional highlightHandle: number

      : number

    Returns void

  • Returns void

  • Toggles the state of the 3D navigation (on or off).

    Parameters

    • Optional flag: boolean

    Returns void

  • Enters the color compare mode which renders Nodes depending on the COMPARISON_GROUP-Property.

    Returns void

  • Positions the camera such that the whole geometry is fitting into the view. The view and up parameter allow to define a viewing direction and roll for the resulting camera pose.

    Parameters

    • Optional view: Float32Array | [number, number, number]

      Defines the desired viewing direction

    • Optional up: Float32Array | [number, number, number]

      Defines the desired camera orientation in conjunction with the viewing direction

    • Optional transitionTime: number

      Defines the transition time for the camera movement

    Returns Promise<void>

  • Positions the camera such that the aux node is fitting into the view.

    Parameters

    • nodeID: number

      The ID of the node on which one wants to fit the view

    • Optional transitionTime: number

      Defines the transition time for the camera movement

    Returns Promise<void>

  • Positions the camera such that it looks from a specific direction.

    Parameters

    • Optional direction: ViewDirection

      The direction to fit.

    • Optional transitionTime: number

      Defines the transition time for the camera movement

    Returns Promise<void>

  • Positions the camera such that the node’s bounding box is fitting into the view. The view and up parameter allow to define a viewing direction and roll for the resulting camera pose.

    Parameters

    • nodeID: number

      The ID of the node on which one wants to fit the view

    • Optional view: Float32Array | [number, number, number]

      The direction in which the camera will look on the node

    • Optional up: Float32Array | [number, number, number]

      The orientation in which the camera will look on the node

    • Optional transitionTime: number

      Defines the transition time for the camera movement

    Returns Promise<void>

  • Positions the camera such that the view is focused onto the given rectangle.

    Parameters

    • x: number

      Specifies the X-Coordinate of the 2D screen space Rectangle.

    • y: number

      Specifies the Y-Coordinate of the 2D screen space Rectangle.

    • width: number

      Specifies the width of the 2D screen space Rectangle.

    • height: number

      Specifies the height of the 2D screen space Rectangle.

    • Optional transitionTime: number

      Defines the transition time for the camera movement.

    Returns Promise<void>

  • Positions the camera such that the view is focused onto the given volume. The view and up parameter allow to define a viewing direction and roll for the resulting camera pose.

    Parameters

    • volume: BoxVolume

      A particular volume on which the view will be fitted

    • Optional view: Float32Array | [number, number, number]

      Specifies the direction in which the camera will look on the volume

    • Optional up: Float32Array | [number, number, number]

      Specifies the orientation in which the camera will look on the volume

    • Optional transitionTime: number

      Defines the transition time for the camera movement

    Returns Promise<void>

  • Positions the camera such that it looks from the specified direction onto the specified volume.

    Parameters

    • volume: BoxVolume

      The volume on which the camera will be fitted

    • Optional direction: ViewDirection

      The direction to fit.

    • Optional transitionTime: number

      Defines the transition time for the camera movement

    Returns Promise<void>

  • Flips the auxiliaries with respect to the current view

    Returns void

  • Return the current Camera position

    Returns Float32Array | [number, number, number]

    The current Camera position

  • Returns the center of rotation being the point around which the camera rotates around.

    Returns Float32Array

  • Returns Float32Array | [number, number, number]

  • Returns Float32Array | [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]

  • Returns string

  • Returns the current projection matrix.

    Returns Float32Array | [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]

    The current projection matrix

  • Returns a 4x4 rotation matrix which is used to transform the internal default right-handed coordinate system with X and Y as front plane axis to the configured one.

    Returns Float32Array | [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]

    The toCoordinateSystem Matrix

  • Returns the current view matrix.

    Returns Float32Array | [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]

    The current view matrix of the camera

  • Parameters

    • pickedPt1: Float32Array | [number, number, number]
    • pickedPt3: Float32Array | [number, number, number]
    • center: Float32Array | [number, number, number]
    • axis: Float32Array | [number, number, number]
    • angle: number
    • measurementID: number

    Returns number

  • Parameters

    • center: Float32Array | [number, number, number]
    • size: Float32Array | [number, number, number]

    Returns number

  • Enable highlighting of the entity , which matches the attributes informed in the viewerDataSelector

    Parameters

    Returns Promise<number>

    the highlightHandle, which it reqed to remove the highlighting

  • Parameters

    • values: number[]
    • scale: number
    • markerIndex: number

    Returns void

  • Parameters

    • position: Float32Array | [number, number, number]
    • markerIndex: number

    Returns void

  • Leave the color compare render mode.

    Returns void

  • Returns the value of a viewer setting.

    Type Parameters

    • T extends string

    Parameters

    • viewerSetting: T

      The name of a particular setting whose value one wants to read

    Returns ViewerSettingType<T>

    The value of the specified setting

  • Parameters

    • id: number

    Returns void

  • Removes the Polyline with the specified Id.

    Parameters

    • polylineId: number

      The Id of the Polyline which should be removed.

    Returns void

  • Returns a List of all NodeIds which are included or overlapped by the specified 2D screen space Rectangle.

    Parameters

    • x: number

      Specifies the X-Coordinate of the 2D screen space Rectangle.

    • y: number

      Specifies the Y-Coordinate of the 2D screen space Rectangle.

    • width: number

      Specifies the width of the 2D screen space Rectangle.

    • height: number

      Specifies the height of the 2D screen space Rectangle.

    • Optional includeOverlappingNodes: boolean

      Specifies that the result should include Nodes which overlap the specified 2D screen space Rectangle as well.

    Returns Promise<number[]>

    List of all NodeIds which are included or overlapped by the specified 2D screen space Rectangle.

  • Requests a screenshot from the current view.

    Parameters

    • Optional width: number

      The width of the requested screenshot. If not specified it uses the width of the current view.

    • Optional height: number

      The height of the requested screenshot. If not specified it uses the height of the current view.

    • Optional mimeType: "image/png" | "image/jpeg"

      A string indicating the image format. The default type is image/png.

    • Optional resetCanvasSize: boolean

    Returns Promise<string>

    • A string containing the requested screenshot as dataUrl.
  • Returns a List of all TopologyHandles which ared included & overlapped by the specified 2D screen space Rectangle.

    Parameters

    • x: number

      Specifies the X-Coordinate of the 2D screen space Rectangle.

    • y: number

      Specifies the Y-Coordinate of the 2D screen space Rectangle.

    • width: number

      Specifies the width of the 2D screen space Rectangle.

    • height: number

      Specifies the height of the 2D screen space Rectangle.

    Returns Promise<TopologyHandle[]>

    List of all TopologyHandles which are included & overlapped by the specified 2D screen space Rectangle.

  • The viewer is destroyed and reinitialized with renderSetup selection

    Returns void

  • Resets the value of a viewer setting.

    Parameters

    • viewerSetting: string

      The name of the viewer setting that should be reset.

    Returns void

  • Sets the camera to the initial position

    Returns void

  • Sets the center of rotation being the point around which the inspection camera rotates. If no center parameter is supplied the center of rotation is set to the center of all currently loaded models.

    Parameters

    • Optional center: Float32Array | [number, number, number]

      The center of rotation

    Returns Promise<void>

  • Sets the current projection matrix.

    Parameters

    • matrix: Float32Array | [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]

      The new projection matrix

    Returns void

  • Sets the camera position, its target and the up-vector. If the up-vector is not defined, the previous up-vector is kept.

    Parameters

    • position: Float32Array | [number, number, number]

      Specifies the new position or center of the camera

    • target: Float32Array | [number, number, number]

      Specifies the point on which the camera will look

    • Optional upVector: Float32Array | [number, number, number]

      Specifies the new orientation of the camera

    • Optional transitionTime: number

      Defines the transition time for the camera movement

    Returns Promise<void>

  • Sets the camera view matrix.

    Parameters

    • matrix: Float32Array | [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]

      The new view matrix for the camera

    • Optional transitionTime: number

      Defines the transition time for the camera movement

    Returns Promise<void>

  • Parameters

    • values: Float32Array | [number, number, number, number, number, number]
    • Optional scale: number
    • Optional index: number

    Returns void

  • Shows the BoxGizmo based on the specified properties. If the BoxGizmo is already visible the specified properties will be updated.

    Parameters

    Returns void

  • Parameters

    • position: Float32Array | [number, number, number]
    • Optional index: number

    Returns void

  • Parameters

    • Optional size: Float32Array | [number, number, number]
    • Optional transform: Float32Array | [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]

    Returns void

  • Takes a screenshot from the current view.

    Parameters

    • callback: ((dataUrl) => void)

      A callback containing the result which is executed after all Rendering operations are finished.

        • (dataUrl): void
        • Parameters

          • dataUrl: string

          Returns void

    • Optional mimeType: string

      A string indicating the image format. The default type is image/png.

    • Optional width: number

      The width of the requested screenshot. If not specified it uses the width of the current view.

    • Optional height: number

      The height of the requested screenshot. If not specified it uses the height of the current view.

    Returns void

    Deprecated

    takeScreenshot is deprecated, please use requestScreenshot instead

  • Parameters

    • id: number
    • data: UserGeometryData

    Returns void