.. role:: ts-api-decorator

###################
VisibleObjectPicker
###################

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

.. container:: ts-api-section

   .. js:class:: VisibleObjectPicker

      Client-side visible object picker. This class can be used to get objects that are currently visible
      in the view, within a specified rectangular region.

      Use ``RemoteModel.createVisibleObjectPicker`` 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 VisibleObjectPicker 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, or when a new state is loaded.



.. container:: api-index-section

   .. rubric:: Methods

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

   * :js:meth:`~cee.ug.VisibleObjectPicker.destroy`
   * :js:meth:`~cee.ug.VisibleObjectPicker.getVisibleObjectsInRectangle`





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

Methods
=======

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

destroy
-------

.. js:method:: VisibleObjectPicker.destroy()



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


   :rtype: void

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

getVisibleObjectsInRectangle
----------------------------

.. js:method:: VisibleObjectPicker.getVisibleObjectsInRectangle( cssPixCoordX, cssPixCoordY, cssPixWidth, cssPixHeight, acceptPartiallyContainedObjects)

   :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 cssPixWidth: The width of the rectangle in css pixels
   :type cssPixWidth: number
   :param cssPixHeight: 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 VisibleObjectPicker belongs to, but to the parent Viewer.
   :type cssPixHeight: number
   :param acceptPartiallyContainedObjects: None
   :type acceptPartiallyContainedObjects: boolean


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


   :rtype: [VisibleObjectItem]

