.. role:: ts-api-decorator

##############
TrianglePicker
##############

.. js:module:: cee.ug
   :noindex:

.. container:: ts-api-section

   .. js:class:: TrianglePicker

      Client-side visible triangle picker. This class can be used to get triangles that are currently visible
      in the view, either within a specified rectangular region or at specified points.

      Use ``RemoteModel.createTrianglePicker`` to create instances of this class.

      It is the programmer's responsibility to call ``destroy`` on pickers that are no longer needed, in order to
      release resources.

      Note that a TrianglePicker is only valid while the model is in the same state as when the
      picker was created. A new picker must be created whenever any display properties are changed on the model, such as
      current frame or draw style.



.. container:: api-index-section

   .. rubric:: Methods

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

   * :js:meth:`~cee.ug.TrianglePicker.destroy`
   * :js:meth:`~cee.ug.TrianglePicker.getVisibleTrianglesAtPoints`
   * :js:meth:`~cee.ug.TrianglePicker.getVisibleTrianglesInRectangle`





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

Methods
=======

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

destroy
-------

.. js:method:: TrianglePicker.destroy()



   Release WebGL resources. Once called this object can no longer be used.


   :rtype: void

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

getVisibleTrianglesAtPoints
---------------------------

.. js:method:: TrianglePicker.getVisibleTrianglesAtPoints( cssPixCoords)

   :param cssPixCoords: Points in canvas offset css coordinates. These are relative to the top left corner of the Canvas element (like MouseEvent.offsetX/Y).  Note that the coordinates are relative to the top left corner of the Canvas element, as in the MouseEvent.offsetX/offsetY if the target of the event is the Canvas Element.  If using multiple Views, they will not be local to the given View the TrianglePicker belongs to, but to the parent Viewer.
   :type cssPixCoords: [Vec2Like]


   Returns visible triangles currently located at the specified points in the view


   :rtype: [ClientSideHitItem]

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

getVisibleTrianglesInRectangle
------------------------------

.. js:method:: TrianglePicker.getVisibleTrianglesInRectangle( cssPixCoordX, cssPixCoordY, width, height)

   :param cssPixCoordX: The left side of the rectangle in css pixel coordinates. This is relative to the top left corner of the Viewer's Canvas element.
   :type cssPixCoordX: number
   :param cssPixCoordY: The top side of the rectangle in css pixel coordinates. This is relative to the top left corner of the Viewer's Canvas element.
   :type cssPixCoordY: number
   :param width: The width of the rectangle in css pixels
   :type width: number
   :param height: The height of the rectangle in css pixels  Note that the coordinates are relative to the top left corner of the Canvas element, as in the MouseEvent.offsetX/offsetY if the target of the event is the Canvas Element.  If using multiple Views, they will not be local to the given View the TrianglePicker belongs to, but to the parent Viewer.
   :type height: number


   Returns visible triangles currently located within the given rectangular region of the view


   :rtype: [ClientSideHitItem]

