ViewerAPI#
Interface ViewerAPI
Hierarchy
- ViewerDrawingAPI
- ViewerInteractionAPI
- ViewerGizmoAPI
- ViewerHighlightAPI
- ViewerPolylineAPI
- ViewerUserGeometryAPI
- ViewerStateAPI
- ViewerMagnifierAPI
- ViewerAPI
Index
Methods
Methods
animate View To Viewmatrix
- animate
View To Viewmatrix(matrix, transitionTime?): 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 Magnifier
- change
Magnifier(properties): ViewerMagnifierProperties -
Changes the properties of the viewers magnifier.
Parameters
-
properties: ViewerMagnifierProperties
Object of Properties which should be changed.
Returns ViewerMagnifierProperties
An Object with the changed Properties.
-
change Polyline
- change
Polyline(polylineId, properties): 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, value): 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, properties?): 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?, up?, transitionTime?): 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, transitionTime?): 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?, transitionTime?): 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, view?, up?, transitionTime?): 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, y, width, height, transitionTime?): 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, view?, up?, transitionTime?): 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, direction?, transitionTime?): 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
force Render Mode
- force
Render Mode(renderMode): void -
Forces the viewer to render in the specified render mode regardless of any other render mode settings. If Unset is passed, the viewer will switch back to the default behaviour.
Parameters
-
renderMode: RenderMode
The render mode to force the viewer to render in.
Returns void
-
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 Interaction Level
- get
Interaction Level(): ViewerInteractionLevel -
Returns the Viewer interaction level.
Returns ViewerInteractionLevel
The current interaction level.
get Magnifier Properties
- get
Magnifier Properties(): ViewerMagnifierProperties -
Returns the current properties of the magnifier.
Returns ViewerMagnifierProperties
The current properties of the magnifier.
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 State
- get
State(): ViewerState -
Returns ViewerState
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 Float32Array | [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]
The toCoordinateSystem Matrix
Deprecated
use getCoordinateSystemMatrix instead
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.
get View Matrix
- get
View Matrix(): [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number] -
Returns the current view matrix.
Returns [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, pickedPt3, center, axis, angle, measurementID): 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 Circular Arc
- highlight
Circular Arc(circularArcDescriptor): number -
Parameters
-
circularArcDescriptor: TopologyCircularArcDescriptor
Returns number
-
highlight Entity
- highlight
Entity(handle, highlightParameters?): Promise<number> -
Enable highlighting of the entity , which matches the attributes informed in the viewerDataSelector
Parameters
-
handle: TopologyHandle
: 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?): 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, y, width, height, includeOverlappingNodes?): 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?, height?, mimeType?, resetCanvasSize?): Promise<string> -
Requests a screenshot from the current view.
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>
- A string containing the requested screenshot as dataUrl.
-
request Topology Handles By Rect
- request
Topology Handles By Rect(x, y, width, height): 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
- reset
Setting(viewerSetting): void -
Resets the value of a viewer setting.
Parameters
-
viewerSetting: ViewerSettingStrings
The name of the viewer setting that should be reset.
Returns void
-
restore Init View
set Active Item
- set
Active Item(id, type): void -
Parameters
-
id: number
-
type: ActiveItemType
Returns void
-
setCORGizmo Visible
set Center Of Rotation
- set
Center Of Rotation(center?): 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): void -
Parameters
-
mode: GizmoTransformationMode
Returns void
-
set Interaction Level
- set
Interaction Level(level): void -
Sets the Viewer interaction level.
Parameters
-
level: ViewerInteractionLevel
Specifies the interaction level.
Returns void
-
set Projection Matrix
set View
- set
View(position, target, upVector?, transitionTime?): 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, transitionTime?): 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?): 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 From Volume
- show
Selection Box Gizmo From Volume(volume?): void -
Parameters
-
Optional
volume: BoxVolume
Returns void
-
show Selection Transformation Gizmo
take Screenshot
- take
Screenshot(callback, mimeType?, width?, height?): 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: 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
Deprecated
takeScreenshot is deprecated, please use requestScreenshot instead
-
The ViewerDrawingAPI provides basic functionalities to control the 2D Drawing Mode and the processed Output.