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
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)
- Arguments
Uses a selection normal and position to create reference geometry for a cutting plane.
- Return type
[Point3]
deactivateAllCuttingSections
- CuttingManager.deactivateAllCuttingSections()
Deactivates all cutting sections. Cutting planes are not removed from section and can be restored using [[activateCuttingSections]]
- Return type
Promise <void>
delayCapping
- CuttingManager.delayCapping()
Delays capping processing by a fixed time interval.
- Return type
void
enableCappingIdleCallback
- CuttingManager.enableCappingIdleCallback(enable)
- Arguments
enable (
boolean()
) – Enables or disables activation of “cappingIdle” callback event.
Enables or disables activation of “cappingIdle” callback event.
- Returns
A promise returning whether or not capping generation was idle when this call resolves.
- Return type
Promise <boolean>
fromJson
- CuttingManager.fromJson(json)
- Arguments
json (
any()
) – None
Removes any cutting planes in the scene, and restores cutting planes from a json object.
- Return type
Promise <void>
getActiveCuttingSectionCount
- CuttingManager.getActiveCuttingSectionCount()
- Returns
the number of active cutting sections.
- Return type
number
getCappingFaceColor
- CuttingManager.getCappingFaceColor()
Gets the color used for capping geometry faces.
- Returns
color used for capping geometry faces.
- Return type
null | Color
getCappingGeometryVisibility
- CuttingManager.getCappingGeometryVisibility()
Gets whether capping geometry will show
- Returns
boolean value indicating whether capping geometry will show
- Return type
boolean
getCappingLineColor
- CuttingManager.getCappingLineColor()
Gets the color used for capping geometry lines.
- Returns
color used for capping geometry lines.
- Return type
null | Color
getCuttingSection
- CuttingManager.getCuttingSection(index)
- Arguments
index (
number()
) – None
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.
- Returns
the cutting section for the given index.
- Return type
null | AbstractCuttingSection
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).
- Returns
the number of planes each cutting section may contain.
- Return type
number
getCuttingSectionCount
- CuttingManager.getCuttingSectionCount()
Gets the total number of cutting sections supported by the system.
- Returns
the number of cutting sections supported by the system.
- Return type
number
getCuttingSectionFromNodeId
- CuttingManager.getCuttingSectionFromNodeId(nodeId)
- Arguments
nodeId (
null | number()
) – a node ID for cutting plane stand-in geometry.
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.
- Returns
the CuttingSection that contains the plane with the given node id or null if none contain it.
- Return type
null | CuttingSection
getNodesWithCapping
- CuttingManager.getNodesWithCapping()
Gets all nodes that have capping drawn for them.
- Returns
an array of node IDs that have capping drawn for them
- Return type
Promise <[number]>
getStandinGeometryPickable
- CuttingManager.getStandinGeometryPickable()
Gets whether stand-in geometry for cutting sections is pickable.
- Returns
boolean value indicating whether stand-in geometry for cutting sections is pickable.
- Return type
boolean
hasActiveCuttingSection
- CuttingManager.hasActiveCuttingSection()
- Returns
true if there is an active cutting section.
- Return type
boolean
refreshPlaneGeometry
- CuttingManager.refreshPlaneGeometry()
Updates all cutting plane geometry.
- Return type
Promise <void>
setCappingDelay
- CuttingManager.setCappingDelay(delayInMilliseconds)
- Arguments
delayInMilliseconds (
number()
) – The delay amount.
Sets the delay used by delayCapping() in milliseconds.
- Return type
void
setCappingFaceColor
- CuttingManager.setCappingFaceColor(color)
- Arguments
color (
null | Color()
) – color to use for capping geometry faces.
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.
- Return type
Promise <void>
setCappingGeometryVisibility
- CuttingManager.setCappingGeometryVisibility(cappingGeometryVisibility)
- Arguments
cappingGeometryVisibility (
boolean()
) – None
Sets whether capping geometry will show. The default value is true.
- Return type
Promise <void>
setCappingLineColor
- CuttingManager.setCappingLineColor(color)
- Arguments
color (
null | Color()
) – color to use for capping geometry lines.
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.
- Return type
Promise <void>
setCuttingPlaneColor
setStandinGeometryPickable
- CuttingManager.setStandinGeometryPickable(pickable)
- Arguments
pickable (
boolean()
) – boolean value indicating whether stand-in geometry should be pickable in the scene.
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.
- Return type
Promise <void>
toJson
- CuttingManager.toJson()
Creates an object ready for JSON serialization.
- Returns
The prepared object.
- Return type
object
waitForCappingIdle
- CuttingManager.waitForCappingIdle()
- Return type
Promise <void>