.. role:: ts-api-decorator

##################
CameraZoomOperator
##################

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

.. container:: ts-api-section

   .. js:class:: CameraZoomOperator



.. container:: api-index-section

   .. rubric:: Methods

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

   * :js:meth:`~Operators.Camera.CameraZoomOperator.addMapping`
   * :js:meth:`~Operators.Camera.CameraZoomOperator.clearMapping`
   * :js:meth:`~Operators.Camera.CameraZoomOperator.getDollyZoomEnabled`
   * :js:meth:`~Operators.Camera.CameraZoomOperator.getMouseMoveZoomDelta`
   * :js:meth:`~Operators.Camera.CameraZoomOperator.getMouseMoveZoomInverted`
   * :js:meth:`~Operators.Camera.CameraZoomOperator.getMouseWheelAdjustCameraTarget`
   * :js:meth:`~Operators.Camera.CameraZoomOperator.getMouseWheelZoomDelta`
   * :js:meth:`~Operators.Camera.CameraZoomOperator.getMouseWheelZoomInverted`
   * :js:meth:`~Operators.Camera.CameraZoomOperator.getPreserveViewAngle`
   * :js:meth:`~Operators.Camera.CameraZoomOperator.getZoomToMousePosition`
   * :js:meth:`~Operators.Camera.CameraZoomOperator.setDollyZoomEnabled`
   * :js:meth:`~Operators.Camera.CameraZoomOperator.setMapping`
   * :js:meth:`~Operators.Camera.CameraZoomOperator.setMouseMoveZoomDelta`
   * :js:meth:`~Operators.Camera.CameraZoomOperator.setMouseMoveZoomInverted`
   * :js:meth:`~Operators.Camera.CameraZoomOperator.setMouseWheelAdjustCameraTarget`
   * :js:meth:`~Operators.Camera.CameraZoomOperator.setMouseWheelZoomDelta`
   * :js:meth:`~Operators.Camera.CameraZoomOperator.setMouseWheelZoomInverted`
   * :js:meth:`~Operators.Camera.CameraZoomOperator.setPreserveViewAngle`
   * :js:meth:`~Operators.Camera.CameraZoomOperator.setZoomToMousePosition`





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

Methods
=======

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

addMapping
----------

.. js:method:: CameraZoomOperator.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:: CameraZoomOperator.clearMapping()



   Clears any button and key modifier mappings for the operator.


   :rtype: void

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

getDollyZoomEnabled
-------------------

.. js:method:: CameraZoomOperator.getDollyZoomEnabled()



   Returns true if dolly zoom is enabled.


   :rtype: boolean

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

getMouseMoveZoomDelta
---------------------

.. js:method:: CameraZoomOperator.getMouseMoveZoomDelta()



   Gets the mouse move zoom delta

   :returns: number


   :rtype: number

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

getMouseMoveZoomInverted
------------------------

.. js:method:: CameraZoomOperator.getMouseMoveZoomInverted()



   :rtype: boolean

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

getMouseWheelAdjustCameraTarget
-------------------------------

.. js:method:: CameraZoomOperator.getMouseWheelAdjustCameraTarget()



   Returns whether the camera target will be updated to the selection
   position while zooming. See [[setMouseWheelAdjustCameraTarget]].


   :rtype: boolean

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

getMouseWheelZoomDelta
----------------------

.. js:method:: CameraZoomOperator.getMouseWheelZoomDelta()



   Gets the scrollwheel zoom delta

   :returns: number


   :rtype: number

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

getMouseWheelZoomInverted
-------------------------

.. js:method:: CameraZoomOperator.getMouseWheelZoomInverted()



   :rtype: boolean

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

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

.. js:method:: CameraZoomOperator.getPreserveViewAngle()



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


   :rtype: boolean

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

getZoomToMousePosition
----------------------

.. js:method:: CameraZoomOperator.getZoomToMousePosition()





   :returns: boolean When true, the zoom will be towards the mouse position. When false, the zoom will be towards the center of the screen.


   :rtype: boolean

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

setDollyZoomEnabled
-------------------

.. js:method:: CameraZoomOperator.setDollyZoomEnabled( dollyZoomEnabled)

   :param dollyZoomEnabled: None
   :type dollyZoomEnabled: boolean


   When dolly zoom is enabled, the camera position will move towards the camera target when zooming.

   :moveCameraPositon:


   :rtype: void

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

setMapping
----------

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

setMouseMoveZoomDelta
---------------------

.. js:method:: CameraZoomOperator.setMouseMoveZoomDelta( delta)

   :param delta: None
   :type delta: number


   Sets the delta to zoom when moving the mouse


   :rtype: void

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

setMouseMoveZoomInverted
------------------------

.. js:method:: CameraZoomOperator.setMouseMoveZoomInverted( inverted)

   :param inverted: None
   :type inverted: boolean


   When true, moving the mouse up will zoom towards the model.


   :rtype: void

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

setMouseWheelAdjustCameraTarget
-------------------------------

.. js:method:: CameraZoomOperator.setMouseWheelAdjustCameraTarget( value)

   :param value: None
   :type value: boolean


   When enabled, the camera target will be updated to the selection position 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 mouse scroll,
   which may not be ideal for performance on large models.

   This setting is disabled by default.


   :rtype: void

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

setMouseWheelZoomDelta
----------------------

.. js:method:: CameraZoomOperator.setMouseWheelZoomDelta( delta)

   :param delta: None
   :type delta: number


   Sets the delta to zoom when scrolling


   :rtype: void

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

setMouseWheelZoomInverted
-------------------------

.. js:method:: CameraZoomOperator.setMouseWheelZoomInverted( inverted)

   :param inverted: None
   :type inverted: boolean


   When true, scrolling up will zoom towards the model.


   :rtype: void

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

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

.. js:method:: CameraZoomOperator.setPreserveViewAngle( value)

   :param value: None
   :type value: 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 mouse wheel zoom is being using in conjunction with window zoom
   this setting should be the same in both.

   This setting is enabled by default.


   :rtype: void

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

setZoomToMousePosition
----------------------

.. js:method:: CameraZoomOperator.setZoomToMousePosition( zoom)

   :param zoom: None
   :type zoom: boolean


   When set, the zoom will be towards the mouse position. When not set, the zoom will be from the center of the screen.


   :rtype: void

