.. role:: ts-api-decorator

##############
CuttingManager
##############

.. container:: ts-api-section

   .. js:class:: CuttingManager

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



.. container:: api-index-section

   .. rubric:: Methods

   .. rst-class:: api-index-list-item api-kind-method api-parent-kind-class

   * :js:meth:`~CuttingManager.activateCuttingSections`
   * :js:meth:`~CuttingManager.clearAllCuttingSections`
   * :js:meth:`~CuttingManager.createReferenceGeometryFromAxis`
   * :js:meth:`~CuttingManager.createReferenceGeometryFromFaceNormal`
   * :js:meth:`~CuttingManager.deactivateAllCuttingSections`
   * :js:meth:`~CuttingManager.delayCapping`
   * :js:meth:`~CuttingManager.enableCappingIdleCallback`
   * :js:meth:`~CuttingManager.fromJson`
   * :js:meth:`~CuttingManager.getActiveCuttingSectionCount`
   * :js:meth:`~CuttingManager.getCappingFaceColor`
   * :js:meth:`~CuttingManager.getCappingGeometryVisibility`
   * :js:meth:`~CuttingManager.getCappingLineColor`
   * :js:meth:`~CuttingManager.getCuttingSection`
   * :js:meth:`~CuttingManager.getCuttingSectionCapacity`
   * :js:meth:`~CuttingManager.getCuttingSectionCount`
   * :js:meth:`~CuttingManager.getCuttingSectionFromNodeId`
   * :js:meth:`~CuttingManager.getNodesWithCapping`
   * :js:meth:`~CuttingManager.getStandinGeometryPickable`
   * :js:meth:`~CuttingManager.hasActiveCuttingSection`
   * :js:meth:`~CuttingManager.refreshPlaneGeometry`
   * :js:meth:`~CuttingManager.setCappingDelay`
   * :js:meth:`~CuttingManager.setCappingFaceColor`
   * :js:meth:`~CuttingManager.setCappingGeometryVisibility`
   * :js:meth:`~CuttingManager.setCappingLineColor`
   * :js:meth:`~CuttingManager.setCuttingPlaneColor`
   * :js:meth:`~CuttingManager.setStandinGeometryPickable`
   * :js:meth:`~CuttingManager.toJson`
   * :js:meth:`~CuttingManager.waitForCappingIdle`





------------

Methods
=======

.. rst-class:: ts-api-section

activateCuttingSections
-----------------------

.. js:method:: CuttingManager.activateCuttingSections()



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


   :rtype: Promise <void>

.. rst-class:: ts-api-section

clearAllCuttingSections
-----------------------

.. js:method:: CuttingManager.clearAllCuttingSections()



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


   :rtype: Promise <void>

.. rst-class:: ts-api-section

createReferenceGeometryFromAxis
-------------------------------

.. js:method:: CuttingManager.createReferenceGeometryFromAxis( axis, modelBounding)

   :param axis: axis for reference geometry.
   :type axis: Axis
   :param modelBounding: modelBounding for geometry size.
   :type modelBounding: Box


   generates reference geometry for a cutting plane.


   :rtype: [Point3]

.. rst-class:: ts-api-section

createReferenceGeometryFromFaceNormal
-------------------------------------

.. js:method:: CuttingManager.createReferenceGeometryFromFaceNormal( normal, position, modelBounding)

   :param normal: face normal.
   :type normal: Point3
   :param position: face position.
   :type position: Point3
   :param modelBounding: model bounding for geometry size.
   :type modelBounding: Box


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


   :rtype: [Point3]

.. rst-class:: ts-api-section

deactivateAllCuttingSections
----------------------------

.. js:method:: CuttingManager.deactivateAllCuttingSections()



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


   :rtype: Promise <void>

.. rst-class:: ts-api-section

delayCapping
------------

.. js:method:: CuttingManager.delayCapping()



   Delays capping processing by a fixed time interval.


   :rtype: void

.. rst-class:: ts-api-section

enableCappingIdleCallback
-------------------------

.. js:method:: CuttingManager.enableCappingIdleCallback( enable)

   :param enable: Enables or disables activation of "cappingIdle" callback event.
   :type enable: boolean


   Enables or disables activation of "cappingIdle" callback event.

   :returns: A promise returning whether or not capping generation was idle when this call resolves.


   :rtype: Promise <boolean>

.. rst-class:: ts-api-section

fromJson
--------

.. js:method:: CuttingManager.fromJson( json)

   :param json: None
   :type json: any


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


   :rtype: Promise <void>

.. rst-class:: ts-api-section

getActiveCuttingSectionCount
----------------------------

.. js:method:: CuttingManager.getActiveCuttingSectionCount()





   :returns: the number of active cutting sections.


   :rtype: number

.. rst-class:: ts-api-section

getCappingFaceColor
-------------------

.. js:method:: CuttingManager.getCappingFaceColor()



   Gets the color used for capping geometry faces.

   :returns: color used for capping geometry faces.


   :rtype: null | Color

.. rst-class:: ts-api-section

getCappingGeometryVisibility
----------------------------

.. js:method:: CuttingManager.getCappingGeometryVisibility()



   Gets whether capping geometry will show

   :returns: boolean value indicating whether capping geometry will show


   :rtype: boolean

.. rst-class:: ts-api-section

getCappingLineColor
-------------------

.. js:method:: CuttingManager.getCappingLineColor()



   Gets the color used for capping geometry lines.

   :returns: color used for capping geometry lines.


   :rtype: null | Color

.. rst-class:: ts-api-section

getCuttingSection
-----------------

.. js:method:: CuttingManager.getCuttingSection( index)

   :param index: None
   :type index: number


   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.


   :rtype: null | AbstractCuttingSection

.. rst-class:: ts-api-section

getCuttingSectionCapacity
-------------------------

.. js:method:: 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.


   :rtype: number

.. rst-class:: ts-api-section

getCuttingSectionCount
----------------------

.. js:method:: CuttingManager.getCuttingSectionCount()



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

   :returns: the number of cutting sections supported by the system.


   :rtype: number

.. rst-class:: ts-api-section

getCuttingSectionFromNodeId
---------------------------

.. js:method:: CuttingManager.getCuttingSectionFromNodeId( nodeId)

   :param nodeId: a node ID for cutting plane stand-in geometry.
   :type nodeId: null | number


   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.


   :rtype: null | CuttingSection

.. rst-class:: ts-api-section

getNodesWithCapping
-------------------

.. js:method:: CuttingManager.getNodesWithCapping()



   Gets all nodes that have capping drawn for them.

   :returns: an array of node IDs that have capping drawn for them


   :rtype: Promise <[number]>

.. rst-class:: ts-api-section

getStandinGeometryPickable
--------------------------

.. js:method:: 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.


   :rtype: boolean

.. rst-class:: ts-api-section

hasActiveCuttingSection
-----------------------

.. js:method:: CuttingManager.hasActiveCuttingSection()





   :returns: true if there is an active cutting section.


   :rtype: boolean

.. rst-class:: ts-api-section

refreshPlaneGeometry
--------------------

.. js:method:: CuttingManager.refreshPlaneGeometry()



   Updates all cutting plane geometry.


   :rtype: Promise <void>

.. rst-class:: ts-api-section

setCappingDelay
---------------

.. js:method:: CuttingManager.setCappingDelay( delayInMilliseconds)

   :param delayInMilliseconds: The delay amount.
   :type delayInMilliseconds: number


   Sets the delay used by delayCapping() in milliseconds.


   :rtype: void

.. rst-class:: ts-api-section

setCappingFaceColor
-------------------

.. js:method:: CuttingManager.setCappingFaceColor( color)

   :param color: color to use for capping geometry faces.
   :type color: null | Color


   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.


   :rtype: Promise <void>

.. rst-class:: ts-api-section

setCappingGeometryVisibility
----------------------------

.. js:method:: CuttingManager.setCappingGeometryVisibility( cappingGeometryVisibility)

   :param cappingGeometryVisibility: None
   :type cappingGeometryVisibility: boolean


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


   :rtype: Promise <void>

.. rst-class:: ts-api-section

setCappingLineColor
-------------------

.. js:method:: CuttingManager.setCappingLineColor( color)

   :param color: color to use for capping geometry lines.
   :type color: null | Color


   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.


   :rtype: Promise <void>

.. rst-class:: ts-api-section

setCuttingPlaneColor
--------------------

.. js:method:: CuttingManager.setCuttingPlaneColor( color)

   :param color: None
   :type color: Color


   Sets the color for all cutting plane reference geometry.


   :rtype: Promise <void>

.. rst-class:: ts-api-section

setStandinGeometryPickable
--------------------------

.. js:method:: CuttingManager.setStandinGeometryPickable( pickable)

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


   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.


   :rtype: Promise <void>

.. rst-class:: ts-api-section

toJson
------

.. js:method:: CuttingManager.toJson()



   Creates an object ready for JSON serialization.

   :returns: The prepared object.


   :rtype: object

.. rst-class:: ts-api-section

waitForCappingIdle
------------------

.. js:method:: CuttingManager.waitForCappingIdle()



   :rtype: Promise <void>

