ViewerAPI#
Interface ViewerAPI
Hierarchy
- ViewerDrawingAPI
- ViewerInteractionAPI
- ViewerGizmoAPI
- ViewerHighlightAPI
- ViewerPolylineAPI
- ViewerUserGeometryAPI
- ViewerAPI
Index
Methods
Methods
animate View To Viewmatrix
- animate
View To Viewmatrix(matrix: Float32Array | [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number], transitionTime?: number): Promise<void> -
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: numberDefines the transition time for the camera movement
Returns Promise<void>
-
cancel Drawing Mode
change Polyline
- change
Polyline(polylineId: number, properties: PolylineProperties): 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
-
change Setting
- change
Setting<T>(viewerSetting: T, value: ViewerSettingType<T>): boolean -
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
-
create Collection From Gizmo
create Geometry
create Polyline
- create
Polyline(positions: number[], properties?: PolylineProperties): number -
Creates a new Polyline with the specified positions and properties.
Parameters
-
positions: number[]
List of 3D positions which defines the Polyline.
-
Optional
properties: PolylinePropertiesThe properties of the Polyline.
Returns number
-
dehighlight Entity
destroy
enable Navigation
-
Toggles the state of the 3D navigation (on or off).
Parameters
-
Optional
flag: boolean
Returns void
-
enable Snapping
enter Color Compare Mode
enter Drawing Mode
fit View
- fit
View(view?: Float32Array | [number, number, number], up?: Float32Array | [number, number, number], transitionTime?: number): Promise<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: numberDefines the transition time for the camera movement
Returns Promise<void>
-
fit View To Aux Node
- fit
View To Aux Node(nodeID: number, transitionTime?: number): 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: numberDefines the transition time for the camera movement
Returns Promise<void>
-
fit View To Direction
- fit
View To Direction(direction?: ViewDirection, transitionTime?: number): Promise<void> -
Positions the camera such that it looks from a specific direction.
Parameters
-
Optional
direction: ViewDirectionThe direction to fit.
-
Optional
transitionTime: numberDefines the transition time for the camera movement
Returns Promise<void>
-
fit View To Node
- fit
View To Node(nodeID: number, view?: Float32Array | [number, number, number], up?: Float32Array | [number, number, number], transitionTime?: number): 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: numberDefines the transition time for the camera movement
Returns Promise<void>
-
fit View To Rectangle
- fit
View To Rectangle(x: number, y: number, width: number, height: number, transitionTime?: number): 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: numberDefines the transition time for the camera movement.
Returns Promise<void>
-
fit View To Volume
- fit
View To Volume(volume: BoxVolume, view?: Float32Array | [number, number, number], up?: Float32Array | [number, number, number], transitionTime?: number): 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: numberDefines the transition time for the camera movement
Returns Promise<void>
-
fit View To Volume From Direction
- fit
View To Volume From Direction(volume: BoxVolume, direction?: ViewDirection, transitionTime?: number): 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: ViewDirectionThe direction to fit.
-
Optional
transitionTime: numberDefines the transition time for the camera movement
Returns Promise<void>
-
flip Aux To View
get Active Item
- get
Active Item(): ActiveItemInfo -
Returns ActiveItemInfo
get Available Gizmo Transformation Modes
get Box Gizmo Properties
- get
Box Gizmo Properties(): BoxGizmoProperties -
Returns the properties of the BoxGizmo
Returns BoxGizmoProperties
The properties of the BoxGizmo
get Camera Position
get Camera Projection Type
- get
Camera Projection Type(): CameraProjectionType -
Return the current Camera projection tyxpe
Returns CameraProjectionType
The current Camera projection tyxpe
get Center Of Rotation
get Context
- get
Context(): ContextAPI -
Returns ContextAPI
get Current Gizmo Type
get Gizmo Size
get Gizmo Transform
- get
Gizmo Transform(): Float32Array | [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number] -
Returns Float32Array | [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]
get Gizmo Transformation Mode
- get
Gizmo Transformation Mode(): GizmoTransformationMode -
Returns GizmoTransformationMode
getID
get Projection Matrix
- get
Projection Matrix(): Float32Array | [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number] -
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
get To Coordinate System Matrix
- get
To Coordinate System Matrix(): Float32Array | [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number] -
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
get View Matrix
- get
View Matrix(): Float32Array | [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number] -
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
hide All Line Markers
hide All Markers
hide All Point Markers
hide Gizmo
hide Point Marker
highlight Arc
- highlight
Arc(pickedPt1: Float32Array | [number, number, number], pickedPt3: Float32Array | [number, number, number], center: Float32Array | [number, number, number], axis: Float32Array | [number, number, number], angle: number, measurementID: number): number -
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
-
highlightBBox
highlight Entity
- highlight
Entity(handle: ITopologyDataSelector, highlightParameters?: ViewerHighlightParameters): Promise<number> -
Enable highlighting of the entity , which matches the attributes informed in the viewerDataSelector
Parameters
-
handle: ITopologyDataSelector
: IViewerHighlightSelector
-
Optional
highlightParameters: ViewerHighlightParameters
Returns Promise<number>
the highlightHandle, which it reqed to remove the highlighting
-
highlight Line
highlight Point
is Snapping Enabled
leave Color Compare Mode
leave Drawing Mode
- leave
Drawing Mode(options?: ViewerDrawingProcessOptions): Promise<ViewerDrawingResult> -
Leaves the 2D Drawing Mode and returns the processed 2D drawing data which can be used to create a Drawing with the help of the DrawingAPI.
Parameters
-
Optional
options: ViewerDrawingProcessOptionsOptions to configure the result of the processing.
Returns Promise<ViewerDrawingResult>
The processed 2D drawing data.
-
read Setting
remove Geometry
remove Polyline
request Node Ids By Rect
- request
Node Ids By Rect(x: number, y: number, width: number, height: number, includeOverlappingNodes?: boolean): Promise<number[]> -
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: booleanSpecifies 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.
-
request Screenshot
- request
Screenshot(width?: number, height?: number, mimeType?: "image/png" | "image/jpeg", resetCanvasSize?: boolean): Promise<string> -
Requests a screenshot from the current view.
- A string containing the requested screenshot as dataUrl.
Parameters
-
Optional
width: numberThe width of the requested screenshot. If not specified it uses the width of the current view.
-
Optional
height: numberThe 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>
request Topology Handles By Rect
- request
Topology Handles By Rect(x: number, y: number, width: number, height: number): Promise<TopologyHandle[]> -
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.
-
reset
reset Setting
restore Init View
set Active Item
- set
Active Item(id: number, type: ActiveItemType): void -
Parameters
-
id: number
-
type: ActiveItemType
Returns void
-
setCORGizmo Visible
set Center Of Rotation
- set
Center Of Rotation(center?: Float32Array | [number, number, number]): Promise<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>
-
set Gizmo Transformation Mode
- set
Gizmo Transformation Mode(mode: GizmoTransformationMode): void -
Parameters
-
mode: GizmoTransformationMode
Returns void
-
set Projection Matrix
- set
Projection Matrix(matrix: Float32Array | [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]): 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
-
set View
- set
View(position: Float32Array | [number, number, number], target: Float32Array | [number, number, number], upVector?: Float32Array | [number, number, number], transitionTime?: number): Promise<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: numberDefines the transition time for the camera movement
Returns Promise<void>
-
set View Matrix
- set
View Matrix(matrix: Float32Array | [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number], transitionTime?: number): 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: numberDefines the transition time for the camera movement
Returns Promise<void>
-
show Axis Marker
show Box Gizmo
- show
Box Gizmo(properties?: BoxGizmoProperties): void -
Shows the BoxGizmo based on the specified properties. If the BoxGizmo is already visible the specified properties will be updated.
Parameters
-
Optional
properties: BoxGizmoPropertiesThe properties of the BoxGizmo.
Returns void
-
show Clipping Box Gizmo
show Point Marker
show Selection Box Gizmo
- show
Selection Box Gizmo(size?: Float32Array | [number, number, number], transform?: Float32Array | [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]): 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
-
show Selection Box Gizmo From Volume
show Selection Transformation Gizmo
take Screenshot
- take
Screenshot(callback: ((dataUrl: string) => void), mimeType?: string, width?: number, height?: number): void -
Takes a screenshot from the current view.
Deprecated
takeScreenshot is deprecated, please use requestScreenshot instead
Parameters
-
callback: ((dataUrl: string) => void)
A callback containing the result which is executed after all Rendering operations are finished.
-
- (dataUrl: string): void
-
Parameters
-
dataUrl: string
Returns void
-
-
-
Optional
mimeType: stringA string indicating the image format. The default type is image/png.
-
Optional
width: numberThe width of the requested screenshot. If not specified it uses the width of the current view.
-
Optional
height: numberThe height of the requested screenshot. If not specified it uses the height of the current view.
Returns void
-
The ViewerDrawingAPI provides basic functionalities to control the 2D Drawing Mode and the processed Output.