.. role:: ts-api-decorator

########
Clipping
########

.. js:module:: cee
   :noindex:

.. container:: ts-api-section

   .. js:class:: Clipping

      Manages general clipping planes in a View.

      Anything behind (on the opposite side of the plane normal) the given planes is hidden.

      Note: The ug.RemoteModel has clipping support connect to cutting planes. These are handled separately,
            and the clipping planes for cutting planes will not show up here.

      **Bounded clipping planes**

      EnvisionWeb supports bounded clipping planes. This allows for cutting out parts of the model in many 
      different ways. By default a clipping plane will clip an object/fragment if it is 
      behind the specified plane (on the opposite side of the plane normal).  
      Bounded clipping planes can be created by assigning all the wanted planes the same group ID when
      adding them, and then setting the clipping criteria for the group to ClippingCriteria.BehindAllPlanes.

      You can access the clipping object with the ``View.clipping`` property.



.. container:: api-index-section

   .. rubric:: Accessors

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

   * :js:attr:`~cee.Clipping.planeCount`



.. container:: api-index-section

   .. rubric:: Methods

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

   * :js:meth:`~cee.Clipping.addPlane`
   * :js:meth:`~cee.Clipping.getGroupId`
   * :js:meth:`~cee.Clipping.getPlane`
   * :js:meth:`~cee.Clipping.getPlaneArray`
   * :js:meth:`~cee.Clipping.removeAllPlanes`
   * :js:meth:`~cee.Clipping.removePlane`
   * :js:meth:`~cee.Clipping.setGroupClippingCriteria`
   * :js:meth:`~cee.Clipping.setPlane`





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

Accessors
=========

.. container:: ts-api-section

   .. js:function:: Clipping.planeCount()



      The number of clipping planes in the view


      :rtype: number



Methods
=======

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

addPlane
--------

.. js:method:: Clipping.addPlane( plane, groupId)

   :param plane: None
   :type plane: Plane
   :param groupId: None
   :type groupId: number


   Adds a clipping plane to the view.

   By default the plane clips anything behind the plane (on the opposite side of the plane normal).
   This can be changed by specifying the clipping criteria for the plane group to which this 
   plane belongs using ``Clipping.setGroupClippingCriteria``


   :rtype: void

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

getGroupId
----------

.. js:method:: Clipping.getGroupId( index)

   :param index: None
   :type index: number


   Return the group id of the plane at the specified  index


   :rtype: number

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

getPlane
--------

.. js:method:: Clipping.getPlane( index)

   :param index: None
   :type index: number


   Return the Plane at the given index


   :rtype: Plane

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

getPlaneArray
-------------

.. js:method:: Clipping.getPlaneArray()



   Returns a readonly array of all the planes in the view


   :rtype: unknown

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

removeAllPlanes
---------------

.. js:method:: Clipping.removeAllPlanes()



   Removes all clipping planes in the view

   Also clears any plane groups and clipping criteria that has been specified


   :rtype: void

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

removePlane
-----------

.. js:method:: Clipping.removePlane( index)

   :param index: None
   :type index: number


   Remove the clipping plane at the given index


   :rtype: void

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

setGroupClippingCriteria
------------------------

.. js:method:: Clipping.setGroupClippingCriteria( groupId, groupClippingCriteria)

   :param groupId: None
   :type groupId: number
   :param groupClippingCriteria: None
   :type groupClippingCriteria: ClippingCriteria


   Sets clipping criteria for the specified group of planes


   :rtype: void

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

setPlane
--------

.. js:method:: Clipping.setPlane( index, plane)

   :param index: None
   :type index: number
   :param plane: None
   :type plane: Plane


   Sets a clipping plane at the given index.

   By default the plane clips anything behind the plane (on the opposite side of the plane normal).


   :rtype: void

