View

class View()

Index

Properties

Accessors

Methods

Properties

View.domElements

readonly

domElements: DomElements
View.floorplanManager

readonly

floorplanManager: FloorplanManager
View.operatorManager

readonly

operatorManager: OperatorManager
View.overlayManager

readonly

overlayManager: OverlayManager

Accessors

View.axisTriad()
get axisTriad(): AxisTriad

Returns: AxisTriad

View.id()
get id(): number

Returns: number

View.inputMonitor()
get inputMonitor(): InputMonitor

Returns: InputMonitor

View.navCube()
get navCube(): NavCube

Returns: NavCube

Methods

View.addLight()
addLight(light: Light): Promise

Adds a light to the scene. The returned promise may be rejected if there are too many lights in the scene. See [[Light]].

See also:

  • [[clearLights]]
  • [[removeLight]]
  • [[updateLight]]
  • [[setAmbientLightColor]]

Parameters

light: Light

Returns: Promise

View.advanceIncrementalSelection()
advanceIncrementalSelection(handle: IncrementalSelectionId): Promise

Returns the next batch of geometry selected by the supplied selection context.

Parameters

handle: IncrementalSelectionId

The handle to an active area selection context.

Returns: Promise

Returns selected items. If the resulting list is null then there are no more items to select.
View.beginConvexPolyhedronSelection()
beginConvexPolyhedronSelection(volumePlanes: Plane[], heuristicOrigin: Point3, config: IncrementalPickConfig): Promise

Creates a new and active selection context for the provided selection volume. The selection volume is a convex polyhedron defined by the bounded intersection of its half-spaces.

Parameters

volumePlanes: Plane[]

The planes used to define volume. A point p is inside the volume if and only if (plane.determineSide(p) == true) for all supplied planes.

heuristicOrigin: Point3

A point used to compute distances against for prioritizing returned results. This is typically (but not necessarily) the center of the volume.

config: IncrementalPickConfig

The configuration object used for this selection operation.

Returns: Promise

The handle for the selection context.
View.beginRayDrillSelection()
beginRayDrillSelection(rayCssOrigin: Point2, rayCssBoxRadius: number, config: IncrementalPickConfig): Promise

Creates a new and active selection context for the provided selection ray. The ray is created at the supplied ray origin and is cast into the scene. Faces are selected if they lie along the ray. Lines and points are selected if they lie within the ray’s box radius.

Note: Somewhat confusingly ray drill selection is actually a selection by volume. The provided ray origin and radius are used to create a frustum to preform the selection. This has some consequences. For example, the SelectionResults returned by advancing a ray drill selection will not have selection positions, since they were not selected at a single point.

Parameters

rayCssOrigin: Point2

The coordinate in CSS pixel space for the selection ray’s origin.

rayCssBoxRadius: number

The radius around the ray in CSS pixel space used for line and point selection proximity.

config: IncrementalPickConfig

The configuration object used for this selection operation.

Returns: Promise

The handle for the selection context.
View.beginScreenSelectByArea()
beginScreenSelectByArea(areaCssMin: Point2, areaCssMax: Point2, config: IncrementalPickConfig): Promise

Creates a new and active selection context for the provided selection window.

Parameters

areaCssMin: Point2

The minimum coodinate in CSS pixel space for the selection window.

areaCssMax: Point2

The maximum coodinate in CSS pixel space for the selection window.

config: IncrementalPickConfig

The configuration object used for this selection operation.

Returns: Promise

The handle for the selection context.
View.beginSphereSelection()
beginSphereSelection(sphereCenter: Point3, sphereRadius: number, config: IncrementalPickConfig): Promise

Creates a new and active selection context for the provided selection sphere.

Parameters

sphereCenter: Point3

The center of the selection sphere.

sphereRadius: number

The radius of the selection sphere.

config: IncrementalPickConfig

The configuration object used for this selection operation.

Returns: Promise

The handle for the selection context.
View.centerCameraOnNode()
centerCameraOnNode(nodeId: number, duration: number?, camera: Camera?): Promise

Centers the camera on a specified node id.

Parameters

nodeId: number

duration: number = 0

the number of milliseconds to transition to the new camera.

camera: Camera = …

Returns: Promise

View.clearLights()
clearLights(): void

Removes all lights from the scene. When there are no lights, material colors are drawn at full intensity. This has the same visual effect as calling setLightingEnabled(false).

See also:

  • [[InstanceModifier.DoNotLight]]
  • [[setLightingEnabled]]

Returns: void

View.compositePickFromPoint()
compositePickFromPoint(point: Point2, config: PickConfig): Promise

Performs a composite picking operation. This operation will return all candidate Node entities according to the PickConfig.

Parameters

point: Point2

Canvas position to pick from.

config: PickConfig

The configuration object used for this picking operation.

Returns: Promise

An object containing the result of the picking operation.
View.endComparison()
endComparison(): void

Disables a visual comparison of two sets of nodes enabled by [[startComparison]].

Returns: void

View.endIncrementalSelection()
endIncrementalSelection(handle: IncrementalSelectionId): Promise

Deactivates and destroys the provided selection context.

Parameters

handle: IncrementalSelectionId

The selection context to destroy.

Returns: Promise

View.fitBounding()
fitBounding(bounding: Box, duration: number?, camera: Camera?): Promise

Fits the camera to the bounding box.

Parameters

bounding: Box

bounding box to fit the camera.

duration: number = DefaultTransitionDuration

Time in milliseconds for the camera transition to the new camera view.

camera: Camera = …

Returns: Promise

A promise that will be resolved once the transition is complete.
View.fitNodes()
fitNodes(ids: number[], duration: number?): Promise

Fits the camera to the bounding box containing the node ids.

Parameters

ids: number[]

duration: number = DefaultTransitionDuration

Time in milliseconds for the camera transition to the new camera view.

Returns: Promise

A promise that will be resolved once the transition is complete.
View.fitWorld()
fitWorld(duration: number?, camera: Camera): Promise

Fits the view to the model bounding box.

Parameters

duration: number = 0

the number of milliseconds to transition to the new camera.

camera: Camera

Returns: Promise

A promise that will be resolved once the transition is complete.
View.getAmbientLightColor()
getAmbientLightColor(): Color

Gets the color of the ambient light applied to the scene.

See also [[setAmbientLightColor]].

Returns: Color

View.getAmbientOcclusionEnabled()
getAmbientOcclusionEnabled(): boolean

Returns: boolean

boolean value indicating whether ambient occlusion is enabled
View.getAmbientOcclusionRadius()
getAmbientOcclusionRadius(): number

Returns: number

the ambient occlusion radius
View.getAntiAliasingMode()
getAntiAliasingMode(): AntiAliasingMode

Gets the anti-aliasing mode for the scene. The Default value is AntiAliasingMode.SMAA

Returns: AntiAliasingMode

the current anti-aliasing mode.
View.getAxisTriad()
getAxisTriad(): AxisTriad

Returns: AxisTriad

View.getBackfacesVisible()
getBackfacesVisible(): boolean

Gets whether backfaces are being rendered in the scene.

Returns: boolean

Boolean value indicating whether backfaces are being rendered in the scene.
View.getBackgroundColor()
getBackgroundColor(): VerticalGradient

Returns the background colors of the canvas.

Returns: VerticalGradient

the canvas background colors.
View.getBloomEnabled()
getBloomEnabled(): boolean

Returns whether bloom is enabled.

See [[setBloomEnabled]].

Returns: boolean

View.getBloomIntensityScale()
getBloomIntensityScale(): number

Gets the intensity of the bloom effect.

See [[setBloomIntensityScale]].

Returns: number

View.getBloomLayers()
getBloomLayers(): BloomLayerInfo[]

Returns an array of objects describing each layer in the bloom effect.

See [[setBloomLayers]].

Returns: BloomLayerInfo[]

View.getBloomThreshold()
getBloomThreshold(): number

Returns the minimum luminance value a pixel must have for it to contribute to bloom.

See [[setBloomThreshold]], [[getBloomThresholdRampWidth]].

Returns: number

View.getBloomThresholdRampWidth()
getBloomThresholdRampWidth(): number

Returns how much greater than the threshold set by [[setBloomThreshold]] a pixel’s luminance value must be before it contributes fully to the bloom effect.

See [[setBloomThresholdRampWidth]].

Returns: number

View.getBoundingCalculationIgnoresInvisible()
getBoundingCalculationIgnoresInvisible(): boolean

Returns: boolean

whether or not bounding calculations by this View object ignores invisible geometry.
View.getCamera()
getCamera(): Camera

Gets the current camera

Returns: Camera

the current camera
View.getCanvasSize()
getCanvasSize(): Point2

Returns the size of the viewer canvas.

Returns: Point2

the current size of the viewer canvas.
View.getDrawMode()
getDrawMode(): DrawMode

Returns: DrawMode

The current draw mode
View.getDrawStrategy()
getDrawStrategy(): DrawStrategy

Gets the draw strategy.

Returns: DrawStrategy

The current draw strategy.
View.getEyeDomeLightingBlurEdgeDistance()
getEyeDomeLightingBlurEdgeDistance(): Promise

Returns a value that controls the maximum Z-distance between samples taken by the blur filter used in eye-dome lighting for point clouds. The value is a proportion of the screen size.

Returns: Promise

View.getEyeDomeLightingBlurInterval()
getEyeDomeLightingBlurInterval(): Promise

Returns the distance in pixels between samples taken by the blur filter used in eye-dome lighting for point clouds.

Returns: Promise

View.getEyeDomeLightingBlurSamples()
getEyeDomeLightingBlurSamples(): Promise

Returns the diameter of the blur filter used in eye-dome lighting for point clouds. A value of 0 means that blurring is disabled.

Returns: Promise

View.getEyeDomeLightingEnabled()
getEyeDomeLightingEnabled(): Promise

Returns: Promise

boolean value indicating if eye-dome lighting is enabled or disabled.
View.getEyeDomeLightingOpacity()
getEyeDomeLightingOpacity(): Promise

Returns the opacity of the shading rendered by eye-dome lighting for point clouds. The value is in the range [0,1].

Returns: Promise

View.getEyeDomeLightingShadingEdgeDistance()
getEyeDomeLightingShadingEdgeDistance(): Promise

Returns a value that controls the shading contrast in eye-dome lighting for point clouds. The value is a number of pixels.

Returns: Promise

View.getFaceVisibility()
getFaceVisibility(): boolean

Gets the face visibility for the view.

Returns: boolean

whether faces are currently being drawn.
View.getFullCameraMatrix()
getFullCameraMatrix(): Matrix

This is equivalent to (projectionMatrix * viewMatrix).

Returns: Matrix

The current full camera matrix.
View.getGoochBaseColorProminence()
getGoochBaseColorProminence(): number

Gets the prominence of the object’s base color in Gooch shading.

Returns: number

View.getGoochBlue()
getGoochBlue(): number

Gets the value to use as the blue tone in Gooch shading.

Returns: number

View.getGoochLuminanceShiftStrength()
getGoochLuminanceShiftStrength(): number

Gets the strength of the luminance shift in Gooch shading.

Returns: number

View.getGoochYellow()
getGoochYellow(): number

Gets the value to use as the yellow tone in Gooch shading.

Returns: number

View.getGroundPlane()
getGroundPlane(): GroundPlane

Returns information about the invisible ground plane onto which simple shadows and reflections are projected.

See also:

  • [[setGroundPlane]]

Returns: GroundPlane

View.getHardEdgeColor()
getHardEdgeColor(): Color

Returns the color of hard edges.

See also:

  • [[setHardEdgeColor]]
  • [[setHardEdgesEnabled]]

Returns: Color

View.getHardEdgeOpacity()
getHardEdgeOpacity(): number

Returns the opacity of hard edges.

See also:

  • [[setHardEdgeOpacity]]
  • [[setHardEdgesEnabled]]

Returns: number

View.getHardEdgesEnabled()
getHardEdgesEnabled(): boolean

Returns whether hard edges are enabled. Hard edges are edges between two faces whose normals diverge beyond a given angle.

Hard edges are always enabled in hidden line mode, regardless of the return value.

See [[setHardEdgesEnabled]].

Returns: boolean

View.getHardEdgeThreshold()
getHardEdgeThreshold(): number

Returns the angle threshold for hard edges. Edges will be drawn between two faces whose normals diverge beyond this angle.

See also:

  • [[setHardEdgeThreshold]]
  • [[setHardEdgeThresholdRampWidth]]
  • [[setHardEdgesEnabled]]

Returns: number

View.getHardEdgeThresholdRampWidth()
getHardEdgeThresholdRampWidth(): number

Returns the value set by [[setHardEdgeThresholdRampWidth]].

This value is added to the one set by [[setHardEdgeThreshold]] to create a secondary threshold. Angles greater than the secondary threshold will result in edges with full opacity, and angles between the two thresholds will result in edges with reduced opacity.

A value of 0 means that all edges are drawn at full opacity.

See also:

  • [[setHardEdgeThresholdRampWidth]]
  • [[setHardEdgesEnabled]]

Returns: number

View.getHiddenLineSettings()
getHiddenLineSettings(): HiddenLineSettings

Returns: HiddenLineSettings

a [[HiddenLineSettings]] object.
View.getImageBasedLightingEnabled()
getImageBasedLightingEnabled(): boolean

Returns whether image-based lighting is enabled for physically-based materials.

See also:

  • [[setImageBasedLightingEnabled]]
  • [[setImageBasedLightingIntensity]]
  • [[setImageBasedLightingOrientation]]

Returns: boolean

View.getImageBasedLightingIntensity()
getImageBasedLightingIntensity(): number

Returns the intensity (brightness) of image-based lighting applied to physically-based materials.

The default value is 1.

See also:

  • [[setImageBasedLightingIntensity]]
  • [[setImageBasedLightingEnabled]]
  • [[setImageBasedLightingOrientation]]

Returns: number

View.getImageBasedLightingOrientation()
getImageBasedLightingOrientation(): ImageBasedLightingOrientation

Returns the orientation of the image-based lighting environment applied to physically-based materials.

See also:

  • [[setImageBasedLightingOrientation]]
  • [[setImageBasedLightingEnabled]]
  • [[setImageBasedLightingIntensity]]

Returns: ImageBasedLightingOrientation

View.getInteractiveDrawLimitIncreaseEnabled()
getInteractiveDrawLimitIncreaseEnabled(): Promise

Gets whether or not the viewer will periodically attempt to increase the amount drawn during interaction.

Returns: Promise

boolean value indicating whether this feature is enabled or not
View.getLight()
getLight(key: LightKey): Promise

Get a Light given its key if it exists.

Parameters

key: LightKey

The key of the light to get.

Returns: Promise

A Light given its key if it exists.
View.getLightingEnabled()
getLightingEnabled(): boolean

Returns whether lighting is enabled.

See also [[setLightingEnabled]].

Returns: boolean

View.getLightKeys()
getLightKeys(): Promise

Get the list of light keys in the scene.

Returns: Promise

The list of light keys in the scene.
View.getLineJitterEnabled()
getLineJitterEnabled(): boolean

Returns whether line jitter is enabled.

Line jitter makes lines look ‘sketchy’ by drawing them multiple times with randomized offsets applied to the vertices.

See also:

  • [[setLineJitterEnabled]]
  • [[getLineJitterInstanceCount]]
  • [[getLineJitterRadius]]
  • [[getLineJitterFrequency]]

Returns: boolean

View.getLineJitterFrequency()
getLineJitterFrequency(): number

Returns the frequency of the noise used to offset line vertices when line jitter is enabled. The default value is 5.

See also:

  • [[getLineJitterEnabled]]
  • [[getLineJitterInstanceCount]]
  • [[getLineJitterRadius]]
  • [[setLineJitterFrequency]]

Returns: number

View.getLineJitterInstanceCount()
getLineJitterInstanceCount(): number

Returns the number of times lines are drawn when line jitter is enabled. The default value is 4.

See also:

  • [[getLineJitterEnabled]]
  • [[setLineJitterInstanceCount]]
  • [[getLineJitterRadius]]
  • [[getLineJitterFrequency]]

Returns: number

View.getLineJitterRadius()
getLineJitterRadius(): number

Returns the radius of the random offset applied to line vertices when line jitter is enabled. The default value is 0.005.

The value is specified as a proportion of the canvas height, where 1 means the full height of the canvas.

See also:

  • [[getLineJitterEnabled]]
  • [[getLineJitterInstanceCount]]
  • [[setLineJitterRadius]]
  • [[getLineJitterFrequency]]

Returns: number

View.getLineVisibility()
getLineVisibility(): boolean

Gets the line visibility for the view.

Returns: boolean

whether lines are currently being drawn.
View.getMassageExtremeCameras()
getMassageExtremeCameras(): boolean

Returns: boolean

View.getNavCube()
getNavCube(): NavCube

Returns: NavCube

View.getPointShape()
getPointShape(): Promise

Gets the PointShape. See [[PointShape]]

Returns: Promise

View.getPointSize()
getPointSize(): Promise

Gets the diameter of rendered points. See [[PointSizeUnit]].

Returns: Promise

View.getProjectionMatrix()
getProjectionMatrix(): Matrix

Gets the projection matrix.

Returns: Matrix

The current projection matrix.
View.getProjectionMode()
getProjectionMode(): Projection

Gets the projection mode.

Returns: Projection

The current projection mode.
View.getSilhouetteColor()
getSilhouetteColor(): Color

Returns the color of silhouette edges.

See also:

  • [[setSilhouetteColor]]
  • [[setSilhouetteEnabled]]

Returns: Color

View.getSilhouetteEnabled()
getSilhouetteEnabled(): boolean

Returns whether silhouette edges are enabled.

Silhouette edges are always enabled in hidden line mode, regardless of the return value.

See [[setSilhouetteEnabled]].

Returns: boolean

View.getSilhouetteOpacity()
getSilhouetteOpacity(): number

Returns the opacity of silhouette edges.

See also:

  • [[setSilhouetteOpacity]]
  • [[setSilhouetteEnabled]]

Returns: number

View.getSilhouetteThreshold()
getSilhouetteThreshold(): number

Returns the distance threshold for silhouette edges. This value affects the minimum z-distance required between two pixels for an edge to be drawn. A smaller value will result in more edges being drawn on finer details.

The value is a proportion of the canvas size and not a world-space distance.

See also:

  • [[setSilhouetteThreshold]]
  • [[setSilhouetteThresholdRampWidth]]
  • [[setSilhouetteEnabled]]

Returns: number

View.getSilhouetteThresholdRampWidth()
getSilhouetteThresholdRampWidth(): number

Returns the value set by [[setSilhouetteThresholdRampWidth]].

This value is added to the one set by [[setSilhouetteThreshold]] to create a secondary threshold. Distances greater than the secondary threshold will result in edges with full opacity, and distances between the two thresholds will result in edges with reduced opacity.

A value of 0 means that all edges are drawn at full opacity.

See also:

  • [[setSilhouetteThresholdRampWidth]]
  • [[setSilhouetteEnabled]]

Returns: number

View.getSimpleReflectionAttenuation()
getSimpleReflectionAttenuation(): { farDistance: number, nearDistance: number, unit: SimpleReflectionAttenuationUnit }

Returns properties that control how objects drawn in simple reflections fade as they move further from the ground plane.

Attenuation begins at nearDistance and increases linearly such that the model is not visible in the reflection beyond farDistance.

Attenuation is disabled if farDistance is less than or equal to nearDistance.

See also:

  • [[setSimpleReflectionAttenuation]]
  • [[setSimpleReflectionEnabled]]

Returns: { farDistance: number, nearDistance: number, unit: SimpleReflectionAttenuationUnit }

An object with the following properties:
View.getSimpleReflectionBlurInterval()
getSimpleReflectionBlurInterval(): [number, BlurIntervalUnit]

Returns the distance between samples taken by the blur filter used for simple reflections.

See also:

  • [[setSimpleReflectionBlurInterval]]
  • [[setSimpleReflectionEnabled]]

Returns: [number, BlurIntervalUnit]

View.getSimpleReflectionBlurSamples()
getSimpleReflectionBlurSamples(): number

Returns the diameter of the blur filter used for simple reflections. A value less than or equal to 1 means that blurring is disabled.

See also:

  • [[setSimpleReflectionBlurSamples]]
  • [[setSimpleReflectionEnabled]]

Returns: number

View.getSimpleReflectionEnabled()
getSimpleReflectionEnabled(): boolean

Returns whether simple reflections are enabled.

See [[setSimpleReflectionEnabled]].

Returns: boolean

View.getSimpleReflectionFadeAngle()
getSimpleReflectionFadeAngle(): number

Returns the angle, in degrees, between the view vector and the ground plane at which simple reflections begin to fade.

A value to 0 means that the fading effect is disabled.

Regardless of the value, simple reflections will not be drawn if the camera is below the ground plane.

See also:

  • [[setSimpleReflectionFadeAngle]]
  • [[setSimpleReflectionEnabled]]

Returns: number

View.getSimpleReflectionOpacity()
getSimpleReflectionOpacity(): number

Returns the opacity of simple reflections.

See also:

  • [[setSimpleReflectionOpacity]]
  • [[setSimpleReflectionEnabled]]

Returns: number

View.getSimpleShadowBlurInterval()
getSimpleShadowBlurInterval(): number

Returns the distance in pixels between samples taken by the blur filter used for simple shadows.

See also:

  • [[setSimpleShadowBlurInterval]]
  • [[setSimpleShadowEnabled]]

Returns: number

View.getSimpleShadowBlurSamples()
getSimpleShadowBlurSamples(): number

Returns the diameter of the blur filter used for simple shadows.

See also:

  • [[setSimpleShadowBlurSamples]]
  • [[setSimpleShadowEnabled]]

Returns: number

View.getSimpleShadowColor()
getSimpleShadowColor(): Color

Returns the color of simple shadows.

See also:

  • [[setSimpleShadowColor]]
  • [[setSimpleShadowEnabled]]

Returns: Color

View.getSimpleShadowEnabled()
getSimpleShadowEnabled(): boolean

Returns whether simple shadows are enabled.

See [[setSimpleShadowEnabled]].

Returns: boolean

View.getSimpleShadowInteractiveUpdateEnabled()
getSimpleShadowInteractiveUpdateEnabled(): boolean

Returns whether simple shadows will be updated during user interaction.

See also:

  • [[setSimpleShadowInteractiveUpdateEnabled]]
  • [[setSimpleShadowEnabled]]

Returns: boolean

View.getSimpleShadowOpacity()
getSimpleShadowOpacity(): number

Returns the opacity of simple shadows.

See also:

  • [[setSimpleShadowOpacity]]
  • [[setSimpleShadowEnabled]]

Returns: number

View.getSimpleShadowResolution()
getSimpleShadowResolution(): number

Returns the width and height in pixels of the texture image into which simple shadows are drawn.

See also:

  • [[getSimpleShadowResolution]]
  • [[setSimpleShadowEnabled]]

Returns: number

View.getToonShadingBandCount()
getToonShadingBandCount(): number

Gets the current number of discrete shading bands that will be used when toon shading is enabled.

Returns: number

View.getToonShadingSpecularFactor()
getToonShadingSpecularFactor(): number

Gets the current toon shading specular scale factor.

Returns: number

View.getViewMatrix()
getViewMatrix(): Matrix

Gets the view matrix.

Returns: Matrix

The current view matrix.
View.getViewOrientationCamera()
getViewOrientationCamera(orientation: ViewOrientation, bounding: Box, preserveModelUp: boolean?): Promise

Returns a camera set to a ViewOrientation

Parameters

orientation: ViewOrientation

The desired view orientation for the camera.

bounding: Box

Optional bounding to fit the camera about. If not supplied, the model bounding will be used.

preserveModelUp: boolean = true

Returns: Promise

View.injectViewOrientationChangeEvent()
injectViewOrientationChangeEvent(): void

hidden

Returns: void

View.isolateNodes()
isolateNodes(nodeIds: number[], duration: number?, fitNodes: boolean?, initiallyHiddenStayHidden: (None | boolean)?): Promise

Hides all nodes except those specified. Also fits the camera to those nodes’ bounding box.

Parameters

nodeIds: number[]

An array of the node IDs to be isolated.

duration: number = DefaultTransitionDuration

Time in milliseconds for the camera transition to the new camera view.

fitNodes: boolean = true

If true, then the view is fitted around the isolated nodes.

initiallyHiddenStayHidden: (None | boolean) = null

Controls whether or not initially hidden geometries stay hidden. Default behavior is driven by [[setBehaviorInitiallyHidden]].

Returns: Promise

View.pickAllFromPoint()
pickAllFromPoint(point: Point2, config: PickConfig): Promise

Performs a picking operation from the given position on the canvas. All candidate entities are returned. This method does not trigger a selection event. This method will reject if the point is outside the canvas area.

Parameters

point: Point2

Canvas position to pick from.

config: PickConfig

The configuration object used for this picking operation.

Returns: Promise

An object containing the result of the picking operation.
View.pickAllFromRay()
pickAllFromRay(ray: Ray, config: PickConfig): Promise

Performs a selection operation from the given world-space ray. All candidate entities are returned. This method does not trigger a selection event.

Parameters

ray: Ray

The world-space ray to perform the selection with.

config: PickConfig

The configuration object used for this picking operation.

Returns: Promise

An object containing the result of the picking operation.
View.pickFromPoint()
pickFromPoint(point: Point2, config: PickConfig): Promise

Performs a picking operation from the given position on the canvas. The best candidate entity is be returned. This method does not trigger a selection event. This method will reject if the point is outside the canvas area.

Parameters

point: Point2

Canvas position to pick from.

config: PickConfig

The configuration object used for this picking operation.

Returns: Promise

An object containing the result of the picking operation.
View.pickFromRay()
pickFromRay(ray: Ray, config: PickConfig): Promise

Performs a selection operation from the given world-space ray. The best candidate entity is be returned. This method does not trigger a selection event.

Parameters

ray: Ray

The world-space ray to perform the selection with.

config: PickConfig

The configuration object used for this picking operation.

Returns: Promise

An object containing the result of the picking operation.
View.pointToWindowPosition()
pointToWindowPosition(pt: Point2): Point2

Creates a normalized window position in the range of (-1, 1) for a given point in window space.

Parameters

pt: Point2

Returns: Point2

the normalized window position
View.projectPoint()
projectPoint(source: Point3, camera: Camera): Point3

Projects a 3d world space point to a 3d screen space point.

Parameters

source: Point3

camera: Camera

if a camera is provided, its projection and view matrix will be used.

Returns: Point3

point projected into 3d screen space.
View.raycastFromPoint()
raycastFromPoint(point: Point2): (None | Ray)

Creates a ray based on a viewport position.

Parameters

point: Point2

The (X, Y) viewport position.

Returns: (None | Ray)

The ray if it was generated, otherwise null.
View.redraw()
redraw(callback: () => void): void

Forces the a redraw of this view.

Parameters

callback: () => void

A function to be called once the draw is complete. This is provided instead of a Promise to ensure the callback is called before the start of another redraw.

Returns: void

View.removeLight()
removeLight(key: LightKey): void

removes a light from the scene. See [[Light]].

See also:

  • [[addLight]]
  • [[clearLights]]
  • [[updateLight]]

Parameters

Returns: void

View.resetCamera()
resetCamera(duration: number?): Promise

Resets the camera to the initial view of the model when first loaded.

Parameters

duration: number = DefaultTransitionDuration

the amount of time in milliseconds that the camera transition between the current and initial view should take.

Returns: Promise

View.setAmbientLightColor()
setAmbientLightColor(value: Color): void

Sets the color of the ambient light applied to the scene. This is a constant source of light that affects every point in the scene in the same way regardless of position or surface normal.

See also [[getAmbientLightColor]].

Parameters

value: Color

Returns: void

View.setAmbientOcclusionEnabled()
setAmbientOcclusionEnabled(enabled: boolean?): Promise

Sets whether ambient occlusion is enabled

Parameters

enabled: boolean = true

sets whether ambient occlusion will be enabled

Returns: Promise

View.setAmbientOcclusionRadius()
setAmbientOcclusionRadius(radius: number): Promise

Sets the ambient occlusion radius. This value represents the maximum screen-proportional distance between two points such that one will cast a shadow on the other.

Parameters

radius: number

the ambient occlusion radius.

Returns: Promise

View.setAntiAliasingMode()
setAntiAliasingMode(antiAliasingMode: AntiAliasingMode): Promise

Sets the anti-aliasing mode for the scene.

Parameters

antiAliasingMode: AntiAliasingMode

Returns: Promise

View.setBackfacesVisible()
setBackfacesVisible(visible: boolean): Promise

Sets whether backfaces should be rendered in the scene.

Parameters

visible: boolean

Boolean value indicating whether backfaces should be rendered.

Returns: Promise

Promise that is resolved when this operation has completed.
View.setBackgroundColor()
setBackgroundColor(top: (None | Color)?, bottom: (None | Color)?): Promise

Sets the viewer background color to a gradient interpolating from the top to bottom color. For a solid color, the top and bottom color should have the same values. Background Transparency is only available with client-side rendering. To re-enable a transparent background, pass null to the parameters of this function.

When draw mode is set to HiddenLine, the background color is defined in pouet``HiddenLineSettings HiddenLineSettings``pouet. See pouet``HiddenLineSettings.setBackgroundColor HiddenLineSettings.setBackgroundColor``pouet.

Parameters

top: (None | Color) = null

the top color for the the background gradient.

bottom: (None | Color) = null

the bottom color for the the background gradient.

Returns: Promise

a promise that resolves when the operation has completed.
View.setBloomEnabled()
setBloomEnabled(value: boolean?): void

Sets whether bloom is enabled.

See [[getBloomEnabled]].

Parameters

value: boolean = true

Returns: void

View.setBloomIntensityScale()
setBloomIntensityScale(value: number): void

Sets the intensity of the bloom effect. This value is multiplied by the intensities of the individual layers set by [[setBloomLayers]].

See [[getBloomIntensityScale]].

Parameters

value: number

Returns: void

View.setBloomLayers()
setBloomLayers(layers: BloomLayerInfo[]): void

Sets the number of layers in the bloom effect and the layers’ attributes.

The bloom effect is achieved by applying a luminance filter to the source image, then progressively downsampling, blurring, and adding the results together. The result of each downsample/blur operation is fed into the next, which is executed at half the resolution of the previous. The number of stages and the behavior of each stage are controlled by this function.

See [[BloomLayerInfo]], [[getBloomLayers]].

Parameters

layers: BloomLayerInfo[]

Returns: void

View.setBloomThreshold()
setBloomThreshold(value: number): void

Sets the minimum luminance value a pixel must have for it to contribute to bloom. The value should be in the range [0,1].

See [[getBloomThreshold]], [[setBloomThresholdRampWidth]].

Parameters

value: number

Returns: void

View.setBloomThresholdRampWidth()
setBloomThresholdRampWidth(value: number): void

Sets how much greater than the threshold set by [[setBloomThreshold]] a pixel’s luminance value must be before it contributes fully to the bloom effect.

If the pixel’s luminance value does not exceed the threshold by at least the amount set by this function, the pixel’s contribution will be diminished based on how close its luminance value is to the threshold.

See [[getBloomThresholdRampWidth]].

Parameters

value: number

Returns: void

View.setBoundingCalculationIgnoresInvisible()
setBoundingCalculationIgnoresInvisible(value: boolean): void

Sets whether or not bounding calculations by this View object ignores invisible geometry.

Parameters

value: boolean

Returns: void

View.setCamera()
setCamera(camera: (None | Camera), duration: number?): boolean

Sets the current camera

Parameters

camera: (None | Camera)

the camera to set

duration: number = 0

camera transition time in milliseconds

Returns: boolean

View.setDisplayIncompleteFrames()
setDisplayIncompleteFrames(value: boolean): Promise

Sets whether intermediate frames of an incremental draw will be displayed. (default: true)

If false, the image will only be displayed once completely drawn, except immediately after certain operations, such as setting the camera. To disable these exceptions, call [[setInteractiveDrawDelay]] with a value of 0.

Parameters

value: boolean

Returns: Promise

View.setDrawMode()
setDrawMode(drawMode: DrawMode): Promise

Sets the drawing mode for the scene.

Parameters

drawMode: DrawMode

The drawing mode to set.

Returns: Promise

View.setEyeDomeLightingBlurEdgeDistance()
setEyeDomeLightingBlurEdgeDistance(value: number): Promise

Controls the maximum Z-distance between samples taken by the blur filter used in eye-dome lighting for point clouds. The value is taken as a proportion of the screen size. Decreasing the value will result in sharper edges, and increasing the value will result in softer edges. (default: .03)

Parameters

value: number

Returns: Promise

View.setEyeDomeLightingBlurInterval()
setEyeDomeLightingBlurInterval(value: number): Promise

Sets the distance in pixels between samples taken by the blur filter used in eye-dome lighting for point clouds. (default: 1)

Parameters

value: number

Returns: Promise

View.setEyeDomeLightingBlurSamples()
setEyeDomeLightingBlurSamples(value: number): Promise

Sets the diameter of the blur filter used in eye-dome lighting for point clouds. Setting the value to 0 will disable blurring. (default: 7)

Parameters

value: number

Returns: Promise

View.setEyeDomeLightingEnabled()
setEyeDomeLightingEnabled(enabled: boolean?): Promise

Enables or disables eye-dome lighting for point clouds. (default: disabled)

Parameters

enabled: boolean = true

Returns: Promise

View.setEyeDomeLightingOpacity()
setEyeDomeLightingOpacity(value: number): Promise

Sets the opacity of the shading rendered by eye-dome lighting for point clouds. (default: 1)

Parameters

value: number

A number in the range [0,1].

Returns: Promise

View.setEyeDomeLightingShadingEdgeDistance()
setEyeDomeLightingShadingEdgeDistance(value: number): Promise

Controls the shading contrast in eye-dome lighting for point clouds. The value is taken as a number of pixels. Increasing the value will result in overall lighter shading, and decreasing the value will result in overall darker shading. (default: 2)

Parameters

value: number

Returns: Promise

View.setFaceVisibility()
setFaceVisibility(faceVisibility: boolean): Promise

Sets the face visibility for the view.

Parameters

faceVisibility: boolean

indicates whether to draw faces.

Returns: Promise

View.setGoochBaseColorProminence()
setGoochBaseColorProminence(prominence: number): void

Sets the prominence of the object’s base color in Gooch shading.

Parameters

prominence: number

this scalar value determines the amount of the object’s base color is applied to the final shaded color.

Returns: void

View.setGoochBlue()
setGoochBlue(blue: number): void

Sets the value to use as the blue tone in Gooch shading.

Parameters

blue: number

the blue tone. This value should be in the range [0,1]

Returns: void

View.setGoochLuminanceShiftStrength()
setGoochLuminanceShiftStrength(shiftStrength: number): void

Sets the strength of the luminance shift in Gooch shading.

Parameters

shiftStrength: number

this scalar values determines the amount of luminance shift that is applied to the object’s base color

Returns: void

View.setGoochYellow()
setGoochYellow(yellow: number): void

Sets the value to use as the yellow tone in Gooch shading.

Parameters

yellow: number

the yellow tone. This value should be in the range [0,1]

Returns: void

View.setGroundPlane()
setGroundPlane(plane: GroundPlane): void

Defines the invisible ground plane onto which simple shadows and reflections are projected.

See also:

  • [[getGroundPlane]]
  • [[setSimpleShadowEnabled]]
  • [[setSimpleReflectionEnabled]]

Parameters

plane: GroundPlane

The plane to set.

Returns: void

View.setHardEdgeColor()
setHardEdgeColor(value: Color): void

Sets the color of hard edges.

See also:

  • [[getHardEdgeColor]]
  • [[setHardEdgesEnabled]]

Parameters

value: Color

The color to set.

Returns: void

View.setHardEdgeOpacity()
setHardEdgeOpacity(value: number): void

Sets the opacity of hard edges.

See also:

  • [[getHardEdgeOpacity]]
  • [[setHardEdgesEnabled]]

Parameters

value: number

The opacity to set.

Returns: void

View.setHardEdgesEnabled()
setHardEdgesEnabled(value: boolean?): void

Enables or disables hard edges. Hard edges are edges between two faces whose normals diverge beyond a given angle.

Hard edges are always enabled in hidden line mode.

See also:

  • [[getHardEdgesEnabled]]
  • [[setHardEdgeColor]]
  • [[setHardEdgeOpacity]]
  • [[setHardEdgeThreshold]]
  • [[setHardEdgeThresholdRampWidth]]

Parameters

value: boolean = true

Whether hard edges should be enabled.

Returns: void

View.setHardEdgeThreshold()
setHardEdgeThreshold(degrees: number): void

Sets the angle threshold for hard edges. Edges will be drawn between two faces whose normals diverge beyond this angle.

See also:

  • [[getHardEdgeThreshold]]
  • [[setHardEdgeThresholdRampWidth]]
  • [[setHardEdgesEnabled]]

Parameters

degrees: number

The threshold to set.

Returns: void

View.setHardEdgeThresholdRampWidth()
setHardEdgeThresholdRampWidth(degrees: number): void

Controls how quickly edges fade as the angle between adjacent faces decreases.

This value is added to the one set by [[setHardEdgeThreshold]] to create a secondary threshold. Angles greater than the secondary threshold will result in edges with full opacity, and angles between the two thresholds will result in edges with reduced opacity.

Setting this value to 0 will cause all edges to be drawn at full opacity.

See also:

  • [[getHardEdgeThresholdRampWidth]]
  • [[setHardEdgesEnabled]]

Parameters

degrees: number

Returns: void

View.setImageBasedLightingEnabled()
setImageBasedLightingEnabled(value: boolean): void

Sets whether image-based lighting is enabled for physically-based materials.

See also:

  • [[getImageBasedLightingEnabled]]
  • [[setImageBasedLightingIntensity]]
  • [[setImageBasedLightingOrientation]]

Parameters

value: boolean

Returns: void

View.setImageBasedLightingEnvironment()
setImageBasedLightingEnvironment(data: (None | Uint8Array)): void

Sets the environment image used by image-based lighting applied to physically-based materials.

Passing null will cause the default environment image to be used.

The image should be a cube map in KTX2 format with a space-separated list of spherical harmonics coefficients stored under the “sh” metadata key.

A compatible image can be created from an equirectangular source image (such as those found at HDRI Haven) with the following process:

cmgen -x out --format=ktx --size=256 in.hdr
ktx2ktx2 -o uncompressed.ktx2 out/out_ibl.ktx
ktxsc --zcmp 20 -o out.ktx2 uncompressed.ktx2

Parameters

data: (None | Uint8Array)

Returns: void

View.setImageBasedLightingIntensity()
setImageBasedLightingIntensity(value: number): void

Sets the intensity (brightness) of image-based lighting applied to physically-based materials.

The default value is 1.

See also:

  • [[getImageBasedLightingIntensity]]
  • [[setImageBasedLightingEnabled]]
  • [[setImageBasedLightingOrientation]]

Parameters

value: number

Returns: void

View.setImageBasedLightingOrientation()
setImageBasedLightingOrientation(value: ImageBasedLightingOrientation): void

Sets the orientation of the image-based lighting environment applied to physically-based materials.

See also:

  • [[getImageBasedLightingOrientation]]
  • [[setImageBasedLightingEnabled]]
  • [[setImageBasedLightingIntensity]]

Parameters

Returns: void

View.setInitialCamera()
setInitialCamera(camera: Camera): void

Sets the camera that will be used for the initial camera view.

Parameters

camera: Camera

Returns: void

View.setInteractiveDrawDelay()
setInteractiveDrawDelay(value: number): Promise

Sets how long after certain operations, such as setting the camera, to wait before starting a redraw. This delay exists in order to prevent flicker during continuous interaction. The initial value is 200ms.

Parameters

value: number

The delay in milliseconds

Returns: Promise

View.setInteractiveDrawLimitIncreaseEnabled()
setInteractiveDrawLimitIncreaseEnabled(enable: boolean): void

Sets whether or not the viewer will periodically attempt to increase the amount drawn during interaction. Setting this to false may improve periodic framerate dips caused by such adjustments.

Parameters

enable: boolean

Returns: void

View.setLightingEnabled()
setLightingEnabled(enabled: boolean?): Promise

Sets whether lighting is enabled. When disabled, material colors are drawn at full intensity.

See also [[InstanceModifier.DoNotLight]], [[clearLights]].

Parameters

enabled: boolean = true

Returns: Promise

View.setLineJitterEnabled()
setLineJitterEnabled(value: boolean?): void

Sets whether line jitter is enabled.

Line jitter makes lines look ‘sketchy’ by drawing them multiple times with randomized offsets applied to the vertices.

See also:

  • [[getLineJitterEnabled]]
  • [[setLineJitterInstanceCount]]
  • [[setLineJitterRadius]]
  • [[setLineJitterFrequency]]

Parameters

value: boolean = true

Returns: void

View.setLineJitterFrequency()
setLineJitterFrequency(value: number): void

Sets the frequency of the noise used to offset line vertices when line jitter is enabled. The default value is 5.

Decreasing this value causes lines to appear smoother, while increasing it causes lines to look more noisy.

See also:

  • [[setLineJitterEnabled]]
  • [[setLineJitterInstanceCount]]
  • [[setLineJitterRadius]]
  • [[getLineJitterFrequency]]

Parameters

value: number

Returns: void

View.setLineJitterInstanceCount()
setLineJitterInstanceCount(value: number): void

Sets the number of times lines are drawn when line jitter is enabled. The default value is 4.

Increasing this number can make the lines look more ‘sketchy.’

See also:

  • [[setLineJitterEnabled]]
  • [[getLineJitterInstanceCount]]
  • [[setLineJitterRadius]]
  • [[setLineJitterFrequency]]

Parameters

value: number

Returns: void

View.setLineJitterRadius()
setLineJitterRadius(value: number): void

Sets the radius of the random offset applied to line vertices when line jitter is enabled. The default value is 0.005.

The value is specified as a proportion of the canvas height, where 1 means the full height of the canvas.

See also:

  • [[setLineJitterEnabled]]
  • [[setLineJitterInstanceCount]]
  • [[getLineJitterRadius]]
  • [[setLineJitterFrequency]]

Parameters

value: number

Returns: void

View.setLineVisibility()
setLineVisibility(lineVisibility: boolean): Promise

Sets the line visibility for the view.

Parameters

lineVisibility: boolean

indicates whether to draw lines.

Returns: Promise

View.setMassageExtremeCameras()
setMassageExtremeCameras(value: boolean): void

Sets whether to change cad view cameras with extreme values to functionally identical cameras with better behavior. This should be disabled if it is important that cameras have their authored values Default: true

Parameters

value: boolean

Whether to modify cameras

Returns: void

View.setMinimumFramerate()
setMinimumFramerate(minimum: number): void

Sets a minimum frame rate that will be maintained by this views. The view will use various culling techniques in order to maintain the value passed in.

Passing 0 will cause the entire scene to be drawn for every frame.

Parameters

minimum: number

The minimum framerate to be maintained by this view.

Returns: void

View.setPointShape()
setPointShape(shape: PointShape): Promise

Controls the appearance of rendered points. (default: Square) See [[PointShape]].

Parameters

shape: PointShape

Returns: Promise

View.setPointSize()
setPointSize(size: number, unit: PointSizeUnit): Promise

Sets the diameter of rendered points. (default: 1, ScreenPixels) See [[PointSizeUnit]].

Parameters

size: number

unit: PointSizeUnit

Returns: Promise

View.setPointVisibilityTest()
setPointVisibilityTest(points: Point3[]): void

Sets a list of points whose visibility will be tested every time a frame is drawn by comparing them to the frame’s depth buffer. Points that are partially obscured by transparent objects are considered visible.

The results are passed to the [[CallbackMap.frameDrawn]] callback so that UI elements may be updated in sync with rendering.

See also [[testPointVisibility]].

Parameters

points: Point3[]

The points to test. An empty array will disable the test.

Returns: void

View.setProjectionMode()
setProjectionMode(projectionMode: Projection): void

Sets the projection mode.

Parameters

projectionMode: Projection

Returns: void

View.setSilhouetteColor()
setSilhouetteColor(value: Color): void

Sets the color of silhouette edges.

See also:

  • [[getSilhouetteColor]]
  • [[setSilhouetteEnabled]]

Parameters

value: Color

The color to set.

Returns: void

View.setSilhouetteEnabled()
setSilhouetteEnabled(value: boolean?): void

Enables or disables silhouette edges.

Silhouette edges are always enabled in hidden line mode.

See also:

  • [[getSilhouetteEnabled]]
  • [[setSilhouetteColor]]
  • [[setSilhouetteOpacity]]
  • [[setSilhouetteThreshold]]
  • [[setSilhouetteThresholdRampWidth]]

Parameters

value: boolean = true

Whether silhouette edges should be enabled.

Returns: void

View.setSilhouetteOpacity()
setSilhouetteOpacity(value: number): void

Sets the opacity of silhouette edges.

See also:

  • [[getSilhouetteOpacity]]
  • [[setSilhouetteEnabled]]

Parameters

value: number

The opacity to set.

Returns: void

View.setSilhouetteThreshold()
setSilhouetteThreshold(value: number): void

Sets the distance threshold for silhouette edges. This value affects the minimum z-distance required between two pixels for an edge to be drawn. A smaller value will result in more edges being drawn on finer details.

The value is a proportion of the canvas size and not a world-space distance.

See also:

  • [[getSilhouetteThreshold]]
  • [[setSilhouetteThresholdRampWidth]]
  • [[setSilhouetteEnabled]]

Parameters

value: number

The threshold to set.

Returns: void

View.setSilhouetteThresholdRampWidth()
setSilhouetteThresholdRampWidth(value: number): void

Controls how quickly edges fade as z-distance between pixels decreases.

This value is added to the one set by [[setSilhouetteThreshold]] to create a secondary threshold. Distances greater than the secondary threshold will result in edges with full opacity, and distances between the two thresholds will result in edges with reduced opacity.

Setting this value to 0 will cause all edges to be drawn at full opacity.

See also:

  • [[getSilhouetteThresholdRampWidth]]
  • [[setSilhouetteEnabled]]

Parameters

value: number

Returns: void

View.setSimpleReflectionAttenuation()
setSimpleReflectionAttenuation(nearDistance: number, farDistance: number, unit: SimpleReflectionAttenuationUnit?): void

Controls how objects drawn in simple reflections fade as they move further from the ground plane.

Attenuation begins at nearDistance and increases linearly such that the model is not visible in the reflection beyond farDistance.

Attenuation is disabled if farDistance is less than or equal to nearDistance.

See also:

  • [[getSimpleReflectionAttenuation]]
  • [[setSimpleReflectionEnabled]]

Parameters

nearDistance: number

The distance from the ground plane at which objects begin to fade.

farDistance: number

The distance from the ground plane at which objects are completely faded.

unit: SimpleReflectionAttenuationUnit = SimpleReflectionAttenuationUnit.World

The unit in which nearDistance and farDistance are specified. If unspecified, [[SimpleReflectionAttenuationUnit.World]] will be used.

Returns: void

View.setSimpleReflectionBlurInterval()
setSimpleReflectionBlurInterval(value: number, unit: BlurIntervalUnit?): void

Sets the distance between samples taken by the blur filter used for simple reflections.

See also:

  • [[getSimpleReflectionBlurInterval]]
  • [[setSimpleReflectionEnabled]]

Parameters

value: number

The interval to set.

unit: BlurIntervalUnit = BlurIntervalUnit.Pixels

The unit in which the value argument is specified.

Returns: void

View.setSimpleReflectionBlurSamples()
setSimpleReflectionBlurSamples(value: number): void

Sets the diameter of the blur filter used for simple reflections. Setting the value less than or equal to 1 will disable blurring.

See also:

  • [[getSimpleReflectionBlurSamples]]
  • [[setSimpleReflectionEnabled]]

Parameters

value: number

Returns: void

View.setSimpleReflectionEnabled()
setSimpleReflectionEnabled(value: boolean?): void

Enables or disables simple reflections projected onto an invisible ground plane.

See also:

  • [[getSimpleReflectionEnabled]]
  • [[setSimpleReflectionOpacity]]
  • [[setSimpleReflectionBlurSamples]]
  • [[setSimpleReflectionBlurInterval]]
  • [[setSimpleReflectionFadeAngle]]

Parameters

value: boolean = true

Returns: void

View.setSimpleReflectionFadeAngle()
setSimpleReflectionFadeAngle(degrees: number): void

Sets the angle, in degrees, between the view vector and the ground plane at which simple reflections begin to fade.

Settings the value to 0 will disable the fading effect.

Regardless of the value, simple reflections will not be drawn if the camera is below the ground plane.

See also:

  • [[getSimpleReflectionFadeAngle]]
  • [[setSimpleReflectionEnabled]]

Parameters

degrees: number

The angle in degrees.

Returns: void

View.setSimpleReflectionOpacity()
setSimpleReflectionOpacity(value: number): void

Sets the opacity of simple reflections.

See also:

  • [[getSimpleReflectionOpacity]]
  • [[setSimpleReflectionEnabled]]

Parameters

value: number

Returns: void

View.setSimpleShadowBlurInterval()
setSimpleShadowBlurInterval(value: number): void

Sets the distance in pixels between samples taken by the blur filter used for simple shadows.

See also:

  • [[getSimpleShadowBlurInterval]]
  • [[setSimpleShadowEnabled]]

Parameters

value: number

The interval to set.

Returns: void

View.setSimpleShadowBlurSamples()
setSimpleShadowBlurSamples(value: number): void

Sets the diameter of the blur filter used for simple shadows. Setting the value to 0 will disable blurring.

See also:

  • [[getSimpleShadowBlurSamples]]
  • [[setSimpleShadowEnabled]]

Parameters

value: number

The number of samples.

Returns: void

View.setSimpleShadowColor()
setSimpleShadowColor(color: Color): void

Sets the color of simple shadows.

See also:

  • [[getSimpleShadowColor]]
  • [[setSimpleShadowEnabled]]

Parameters

color: Color

The color to set.

Returns: void

View.setSimpleShadowEnabled()
setSimpleShadowEnabled(value: boolean?): void

Enables or disables a full-scene shadow projected onto an invisible ground plane.

See also:

  • [[getSimpleShadowEnabled]]
  • [[setSimpleShadowColor]]
  • [[setSimpleShadowOpacity]]
  • [[setGroundPlane]]
  • [[setSimpleShadowResolution]]
  • [[setSimpleShadowInteractiveUpdateEnabled]]

Parameters

value: boolean = true

Whether simple shadows should be enabled.

Returns: void

View.setSimpleShadowInteractiveUpdateEnabled()
setSimpleShadowInteractiveUpdateEnabled(value: boolean?): void

Enables or disables updates to simple shadows during user interaction.

See also:

  • [[getSimpleShadowInteractiveUpdateEnabled]]
  • [[setSimpleShadowEnabled]]

Parameters

value: boolean = true

Returns: void

View.setSimpleShadowOpacity()
setSimpleShadowOpacity(opacity: number): void

Sets the opacity of simple shadows.

See also:

  • [[getSimpleShadowOpacity]]
  • [[setSimpleShadowEnabled]]

Parameters

opacity: number

The opacity to set.

Returns: void

View.setSimpleShadowResolution()
setSimpleShadowResolution(pixels: number): void

Sets the width and height in pixels of the texture image into which simple shadows are drawn.

See also:

  • [[getSimpleShadowResolution]]
  • [[setSimpleShadowEnabled]]

Parameters

pixels: number

The resolution to set.

Returns: void

View.setStatisticsDisplayVisibility()
setStatisticsDisplayVisibility(visibility: boolean): Promise

Sets the display for the default statistic overlay.

Parameters

visibility: boolean

Returns: Promise

View.setToonShadingBandCount()
setToonShadingBandCount(bandCount: number): void

Sets the number of discrete shading bands that will be used when toon shading is enabled. Each band represents a shade between dark and light which will control the final color of the pixel based on its light intensity. The default band count is 3.

Parameters

bandCount: number

Returns: void

View.setToonShadingSpecularFactor()
setToonShadingSpecularFactor(specularFactor: number): void

Sets a scale factor which controls the size of specular highlights when toon shading is enabled. The default value is 1.0.

Parameters

specularFactor: number

Returns: void

View.setTransparencyMode()
setTransparencyMode(mode: TransparencyMode): void

Sets how transparent objects are blended.

Parameters

Returns: void

View.setViewOrientation()
setViewOrientation(orientation: ViewOrientation, duration: number?, bounding: Box, preserveModelUp: boolean?): Promise

Sets the view to a standard orientation.

Parameters

orientation: ViewOrientation

The desired view orientation for the camera.

duration: number = DefaultTransitionDuration

The number of milliseconds used to transition to the new camera.

bounding: Box

Optional bounding to fit the camera about. If not supplied, the model bounding will be used.

preserveModelUp: boolean = true

Indicates whether the camera up will be set according to model up or current camera.

Returns: Promise

View.setXRayColor()
setXRayColor(element: ElementType, color: Color, group: XRayGroup?): Promise

Sets the color applied to nodes in x-ray mode. By default, the color is unset.

See [[unsetXRayColor]].

Parameters

element: ElementType

the type of geometry to apply the color to

color: Color

the color to apply

group: XRayGroup = XRayGroup.Selected

the category of nodes that will be affected. If unspecified, [[XRayGroup.Selected]] will be used.

Returns: Promise

View.setXRayOpacity()
setXRayOpacity(opacity: number, element: ElementType): Promise

Sets the opacity of unselected items in x-ray mode.

Parameters

opacity: number

a number between 0 and 1

element: ElementType

the type of element to which the opacity will apply. If unspecified, the opacity will apply to all element types.

Returns: Promise

View.setXRayTransparencyMode()
setXRayTransparencyMode(mode: TransparencyMode): Promise

Sets how transparent (unselected) objects are blended in x-ray mode.

Parameters

Returns: Promise

View.startComparison()
startComparison(nodeIdSet1: number[], nodeIdSet2: number[], config: ComparisonConfig): void

Enables a visual comparison of two sets of nodes. The nodes specified by nodeIdSet1 are filled with one color, the nodes specified by nodeIdSet2 with another color, and overlapping areas are filled with a third color.

See [[endComparison]].

Parameters

nodeIdSet1: number[]

the nodes to compare against nodeIdSet2

nodeIdSet2: number[]

the nodes to compare against nodeIdSet1

config: ComparisonConfig

settings controlling the behavior of the comparison

Returns: void

View.testPointVisibility()
testPointVisibility(points: Point3[]): Promise

Tests whether the given points are visible by comparing them to the depth buffer of the most-recently-drawn frame. Points that are partially obscured by transparent objects are considered visible.

If the test is to be run every time a frame is drawn, [[setPointVisibilityTest]] should be used instead for proper synchronization.

Parameters

points: Point3[]

The points to test.

Returns: Promise

A list of indices of the visible points.
View.unprojectPoint()
unprojectPoint(point: Point2, z: number): (None | Point3)

Unprojects a 2d screen space point to a 3d world space point.

Parameters

point: Point2

2d screen space

z: number

z value, default 0

Returns: (None | Point3)

point world space point
View.unsetDefaultCamera()
unsetDefaultCamera(): void

Unsets the default camera. After this is called the next camera to be set will be the new default

Returns: void

View.unsetXRayColor()
unsetXRayColor(element: ElementType, group: XRayGroup?): Promise

Unsets the color applied to selected items in x-ray mode. Selected items will be displayed without overriding their colors.

See [[setXRayColor]].

Parameters

element: ElementType

the type of geometry affected by the change

group: XRayGroup = XRayGroup.Selected

the category of nodes that will be affected. If unspecified, [[XRayGroup.Selected]] will be used.

Returns: Promise

View.updateCamera()
updateCamera(camera: Camera): Camera

Updates camera properties individually. This method should be used to incrementally update camera properties individually.

Parameters

camera: Camera

the camera to set.

Returns: Camera

updated camera object.
View.updateLight()
updateLight(key: LightKey, light: Light): void

Updates a light in the scene. See [[Light]].

See also:

  • [[addLight]]
  • [[clearLights]]
  • [[removeLight]]

Parameters

key: LightKey

light: Light

Returns: void