CuttingManager
- class Communicator.CuttingManager()
Main interface into the cutting functionality of the viewer. The object manages a number of individual CuttingSections which can be activated individually.
Methods
Methods
activateCuttingSections
- CuttingManager.activateCuttingSections()
Activates all cutting sections, and restores any planes contained to the scene.
- Return type
Promise <void>
clearAllCuttingSections
- CuttingManager.clearAllCuttingSections()
Clears all cutting sections. This causes all cutting sections to be deactivated and all their cutting planes removed.
- Return type
Promise <void>
createReferenceGeometryFromAxis
createReferenceGeometryFromFaceNormal
- CuttingManager.createReferenceGeometryFromFaceNormal(normal, position, modelBounding)
Uses a selection normal and position to create reference geometry for a cutting plane.
deactivateAllCuttingSections
- CuttingManager.deactivateAllCuttingSections()
Deactivates all cutting sections. Cutting planes are not removed from section and can be restored using
activateCuttingSections
- Return type
Promise <void>
deactivateCuttingSections
- CuttingManager.deactivateCuttingSections([clearSections])
Removes all cutting planes and cutting plane geometry from the scene.
- Deprecated
Use
deactivateAllCuttingSections
orclearAllCuttingSections
instead.- Arguments
clearSections (
boolean()
) – optional if true, removes all cutting planes contained in cutting sections.
- Return type
Promise <void>
delayCapping
- CuttingManager.delayCapping()
Delays capping processing by a fixed time interval.
- Return type
void
enableCappingIdleCallback
- CuttingManager.enableCappingIdleCallback(enable)
Enables or disables activation of “cappingIdle” callback event.
- Arguments
enable (
boolean()
) – Enables or disables activation of “cappingIdle” callback event.
- Return type
Promise <boolean>
- Returns
A promise returning whether or not capping generation was idle when this call resolves.
fromJson
- CuttingManager.fromJson(json)
Removes any cutting planes in the scene, and restores cutting planes from a json object.
- Arguments
json (
any()
) –
- Return type
Promise <void>
getActiveCuttingSectionCount
- CuttingManager.getActiveCuttingSectionCount()
- Return type
number
- Returns
the number of active cutting sections.
getCappingFaceColor
getCappingGeometryVisibility
- CuttingManager.getCappingGeometryVisibility()
Gets whether capping geometry will show
- Return type
boolean
- Returns
boolean value indicating whether capping geometry will show
getCappingLineColor
getCuttingSection
- CuttingManager.getCuttingSection(index)
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.
- Arguments
index (
number()
) –
- Return type
CuttingSection()
| null- Returns
the cutting section for the given index.
getCuttingSectionCapacity
- CuttingManager.getCuttingSectionCapacity()
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).
- Return type
number
- Returns
the number of planes each cutting section may contain.
getCuttingSectionCount
- CuttingManager.getCuttingSectionCount()
Gets the total number of cutting sections supported by the system.
- Return type
number
- Returns
the number of cutting sections supported by the system.
getCuttingSectionFromNodeId
- CuttingManager.getCuttingSectionFromNodeId(nodeId)
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.
- Arguments
nodeId (NodeId | null) – a node ID for cutting plane stand-in geometry.
- Return type
CuttingSection()
| null- Returns
the CuttingSection that contains the plane with the given node id or null if none contain it.
getStandinGeometryPickable
- CuttingManager.getStandinGeometryPickable()
Gets whether stand-in geometry for cutting sections is pickable.
- Return type
boolean
- Returns
boolean value indicating whether stand-in geometry for cutting sections is pickable.
hasActiveCuttingSection
- CuttingManager.hasActiveCuttingSection()
- Return type
boolean
- Returns
true if there is an active cutting section.
refreshPlaneGeometry
- CuttingManager.refreshPlaneGeometry()
Updates all cutting plane geometry.
- Return type
Promise <void>
setCappingDelay
- CuttingManager.setCappingDelay(delayInMilliseconds)
Sets the delay used by delayCapping() in milliseconds.
- Arguments
delayInMilliseconds (
number()
) – The delay amount.
- Return type
void
setCappingFaceColor
setCappingGeometryVisibility
- CuttingManager.setCappingGeometryVisibility(cappingGeometryVisibility)
Sets whether capping geometry will show. The default value is true.
- Arguments
cappingGeometryVisibility (
boolean()
) –
- Return type
setCappingLineColor
setCuttingPlaneColor
setStandinGeometryPickable
- CuttingManager.setStandinGeometryPickable(pickable)
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.
- Arguments
pickable (
boolean()
) – boolean value indicating whether stand-in geometry should be pickable in the scene.
- Return type