CuttingManager

class CuttingManager()

Main interface into the cutting functionality of the viewer. The object manages a number of individual CuttingSections which can be activated individually.

Methods

CuttingManager.activateCuttingSections()
activateCuttingSections(): Promise

Activates all cutting sections, and restores any planes contained to the scene.

Returns: Promise

CuttingManager.clearAllCuttingSections()
clearAllCuttingSections(): Promise

Clears all cutting sections. This causes all cutting sections to be deactivated and all their cutting planes removed.

Returns: Promise

CuttingManager.createReferenceGeometryFromAxis()
createReferenceGeometryFromAxis(axis: Axis, modelBounding: Box): Point3[]

generates reference geometry for a cutting plane.

Parameters

axis: Axis

axis for reference geometry.

modelBounding: Box

modelBounding for geometry size.

Returns: Point3[]

CuttingManager.createReferenceGeometryFromFaceNormal()
createReferenceGeometryFromFaceNormal(normal: Point3, position: Point3, modelBounding: Box): Point3[]

Uses a selection normal and position to create reference geometry for a cutting plane.

Parameters

normal: Point3

face normal.

position: Point3

face position.

modelBounding: Box

model bounding for geometry size.

Returns: Point3[]

CuttingManager.deactivateAllCuttingSections()
deactivateAllCuttingSections(): Promise

Deactivates all cutting sections. Cutting planes are not removed from section and can be restored using [[activateCuttingSections]]

Returns: Promise

CuttingManager.delayCapping()
delayCapping(): void

Delays capping processing by a fixed time interval.

Returns: void

CuttingManager.enableCappingIdleCallback()
enableCappingIdleCallback(enable: boolean): Promise

Enables or disables activation of “cappingIdle” callback event.

Parameters

enable: boolean

Enables or disables activation of “cappingIdle” callback event.

Returns: Promise

A promise returning whether or not capping generation was idle when this call resolves.
CuttingManager.fromJson()
fromJson(json: any): Promise

Removes any cutting planes in the scene, and restores cutting planes from a json object.

Parameters

json: any

Returns: Promise

CuttingManager.getActiveCuttingSectionCount()
getActiveCuttingSectionCount(): number

Returns: number

the number of active cutting sections.
CuttingManager.getCappingFaceColor()
getCappingFaceColor(): (None | Color)

Gets the color used for capping geometry faces.

Returns: (None | Color)

color used for capping geometry faces.
CuttingManager.getCappingGeometryVisibility()
getCappingGeometryVisibility(): boolean

Gets whether capping geometry will show

Returns: boolean

boolean value indicating whether capping geometry will show
CuttingManager.getCappingLineColor()
getCappingLineColor(): (None | Color)

Gets the color used for capping geometry lines.

Returns: (None | Color)

color used for capping geometry lines.
CuttingManager.getCuttingSection()
getCuttingSection(index: number): (None | ICuttingSection)

Gets a cutting section by index. Cutting sections are created automatically by the system and may be queried at any point during or after the sceneReady callback has been triggered.

Parameters

index: number

Returns: (None | ICuttingSection)

the cutting section for the given index.
CuttingManager.getCuttingSectionCapacity()
getCuttingSectionCapacity(): number

Gets the total number of planes supported by each cutting section. Cutting planes contained in the same cutting section will work together (an object is only cut if all cutting planes in a section would cut it). Cutting planes in separate cutting sections do not work together when cutting (an object is cut if any one of the cutting sections would cut it).

Returns: number

the number of planes each cutting section may contain.
CuttingManager.getCuttingSectionCount()
getCuttingSectionCount(): number

Gets the total number of cutting sections supported by the system.

Returns: number

the number of cutting sections supported by the system.
CuttingManager.getCuttingSectionFromNodeId()
getCuttingSectionFromNodeId(nodeId: (None | number)): (None | ICuttingSection)

Gets the cutting section containing the cutting plane with the given node ID. If the supplied node ID is not contained by any cutting section null will be returned.

Parameters

nodeId: (None | number)

a node ID for cutting plane stand-in geometry.

Returns: (None | ICuttingSection)

the ICuttingSection that contains the plane with the given node id or null if none contain it.
CuttingManager.getNodesWithCapping()
getNodesWithCapping(): Promise

Gets all nodes that have capping drawn for them.

Returns: Promise

an array of node IDs that have capping drawn for them
CuttingManager.getStandinGeometryPickable()
getStandinGeometryPickable(): boolean

Gets whether stand-in geometry for cutting sections is pickable.

Returns: boolean

boolean value indicating whether stand-in geometry for cutting sections is pickable.
CuttingManager.hasActiveCuttingSection()
hasActiveCuttingSection(): boolean

Returns: boolean

true if there is an active cutting section.
CuttingManager.refreshPlaneGeometry()
refreshPlaneGeometry(): Promise

Updates all cutting plane geometry.

Returns: Promise

CuttingManager.setCappingDelay()
setCappingDelay(delayInMilliseconds: number): void

Sets the delay used by delayCapping() in milliseconds.

Parameters

delayInMilliseconds: number

The delay amount.

Returns: void

CuttingManager.setCappingFaceColor()
setCappingFaceColor(color: (None | Color)): Promise

Sets the color to be used for capping geometry faces. If null is passed in as the color object, no capping face will be shown.

Parameters

color: (None | Color)

color to use for capping geometry faces.

Returns: Promise

CuttingManager.setCappingGeometryVisibility()
setCappingGeometryVisibility(cappingGeometryVisibility: boolean): Promise

Sets whether capping geometry will show. The default value is true.

Parameters

cappingGeometryVisibility: boolean

Returns: Promise

CuttingManager.setCappingLineColor()
setCappingLineColor(color: (None | Color)): Promise

Sets the color to be used for capping geometry lines. If null is passed in as the color object, no capping line will be shown.

Parameters

color: (None | Color)

color to use for capping geometry lines.

Returns: Promise

CuttingManager.setCuttingPlaneColor()
setCuttingPlaneColor(color: Color): Promise

Sets the color for all cutting plane reference geometry.

Parameters

color: Color

Returns: Promise

CuttingManager.setStandinGeometryPickable()
setStandinGeometryPickable(pickable: boolean): Promise

Sets whether stand-in geometry for cutting sections should be pickable. If this option is set to false, picking rays will pass though stand-in geometry for cutting planes. The default value is not pickable.

Parameters

pickable: boolean

boolean value indicating whether stand-in geometry should be pickable in the scene.

Returns: Promise

CuttingManager.toJson()
toJson(): object

Creates an object ready for JSON serialization.

Returns: object

The prepared object.
CuttingManager.waitForCappingIdle()
waitForCappingIdle(): Promise

Returns: Promise