.. role:: ts-api-decorator

########################
CameraWindowZoomOperator
########################

.. js:module:: Operators.Camera
   :noindex:

.. container:: ts-api-section

   .. js:class:: CameraWindowZoomOperator



.. container:: api-index-section

   .. rubric:: Methods

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

   * :js:meth:`~Operators.Camera.CameraWindowZoomOperator.addMapping`
   * :js:meth:`~Operators.Camera.CameraWindowZoomOperator.clearMapping`
   * :js:meth:`~Operators.Camera.CameraWindowZoomOperator.doZoom`
   * :js:meth:`~Operators.Camera.CameraWindowZoomOperator.getComputeTarget`
   * :js:meth:`~Operators.Camera.CameraWindowZoomOperator.getPreserveViewAngle`
   * :js:meth:`~Operators.Camera.CameraWindowZoomOperator.setComputeTarget`
   * :js:meth:`~Operators.Camera.CameraWindowZoomOperator.setMapping`
   * :js:meth:`~Operators.Camera.CameraWindowZoomOperator.setPreserveViewAngle`





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

Methods
=======

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

addMapping
----------

.. js:method:: CameraWindowZoomOperator.addMapping( button, modifier)

   :param button: None
   :type button: Button
   :param modifier: None
   :type modifier: KeyModifiers


   Adds a button and key modifier mapping for the operator. If no mapping is provided, all combinations are considered valid.
   All mappings require a mouse button, but a key modifier is optional.


   :rtype: void

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

clearMapping
------------

.. js:method:: CameraWindowZoomOperator.clearMapping()



   Clears any button and key modifier mappings for the operator.


   :rtype: void

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

doZoom
------

.. js:method:: CameraWindowZoomOperator.doZoom( rectMin, rectMax)

   :param rectMin: None
   :type rectMin: Point2
   :param rectMax: None
   :type rectMax: Point2


   :rtype: Promise <void>

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

getComputeTarget
----------------

.. js:method:: CameraWindowZoomOperator.getComputeTarget()



   Returns whether a new camera target will be computed using selection.
   See [[setComputeTarget]]


   :rtype: boolean

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

getPreserveViewAngle
--------------------

.. js:method:: CameraWindowZoomOperator.getPreserveViewAngle()



   Gets whether to maintain a constant view angle while zooming. See
   [[setPreserveViewAngle]].


   :rtype: boolean

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

setComputeTarget
----------------

.. js:method:: CameraWindowZoomOperator.setComputeTarget( compute)

   :param compute: None
   :type compute: boolean


   When enabled, the camera target will be computed using selection while zooming.
   This can provide a better zoom behavior in perspective projection mode,
   but comes at the cost of performing a selection on the model during each zoom operation,
   which may not be ideal for performance on large models.

   This setting is disabled by default.


   :rtype: void

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

setMapping
----------

.. js:method:: CameraWindowZoomOperator.setMapping( button, modifier)

   :param button: None
   :type button: Button
   :param modifier: None
   :type modifier: KeyModifiers


   Sets the button and key modifier mapping for the operator.


   :rtype: void

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

setPreserveViewAngle
--------------------

.. js:method:: CameraWindowZoomOperator.setPreserveViewAngle( preserve)

   :param preserve: None
   :type preserve: boolean


   Sets whether to maintain a constant view angle while zooming. If
   enabled, when zooming causes the camera's field of view to shrink or
   grow, the camera's position will also be moved toward or away from
   the target, respectively.

   This may prevent confusing camera behavior when perspective
   projection is used or might be used. When using only orthographic
   projection, it is better to disable this.

   If window zoom is being using in conjunction with mouse wheel zoom
   this setting should be the same in both.

   This setting is enabled by default.


   :rtype: void

