.. role:: clio-inherited
   :class: clio-flag clio-flag-inherited


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

.. js:class:: wv.Operators.Camera.CameraZoomOperator

   Base class for operators that handle mouse and touch input. It provides common functionality for tracking mouse and touch events, as well as button and key modifier mappings. It is a Base class with No-OP hook methods (non virtual interface), meaning that it provides a default implementation for all methods, but can be extended by child classes to override specific behavior.
   
   
   Index
   =====
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.addMapping`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.checkMapping`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.clearMapping`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.getDollyZoomEnabled`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.getMouseMoveZoomDelta`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.getMouseMoveZoomInverted`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.getMouseWheelAdjustCameraTarget`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.getMouseWheelZoomDelta`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.getMouseWheelZoomInverted`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.getPreserveViewAngle`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.getZoomToMousePosition`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.isActive`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.isDragging`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.onDoubleClick`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.onMouseDown`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.onMouseUp`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.setDollyZoomEnabled`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.setHandled`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.setMapping`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.setMouseMoveZoomDelta`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.setMouseMoveZoomInverted`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.setMouseWheelAdjustCameraTarget`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.setMouseWheelZoomDelta`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.setMouseWheelZoomInverted`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.setPreserveViewAngle`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.setZoomToMousePosition`
   * :js:meth:`~wv.Operators.Camera.CameraZoomOperator.stopInteraction`
   
   



.. rst-class:: kind-group kind-methods

.. rubric:: Methods
   :class: kind-group-title


.. js:method:: wv.Operators.Camera.CameraZoomOperator.addMapping

      .. rst-class:: clio-flags
      
         :clio-inherited:`inherited`
      
      .. rst-class:: sig-pretty-signature
      
         | addMapping(**button**\ : :js:data:`Button <wv.Button>`\ , **modifier**\ : :js:data:`KeyModifiers <wv.KeyModifiers>`\ ?): *void*
      
      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.
      
      **Parameters**
      
      
         **button**\ : :js:data:`Button <wv.Button>`
      
         **modifier**\ : :js:data:`KeyModifiers <wv.KeyModifiers>` = KeyModifiers.None
      
      
      **Returns**\ : *void*
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.checkMapping

      .. rst-class:: clio-flags
      
         :clio-inherited:`inherited`
      
      .. rst-class:: sig-pretty-signature
      
         | checkMapping(**event**\ : :js:class:`MouseInputEvent <wv.Event.MouseInputEvent>`\ ): *boolean*
      
      Checks if the given mouse event matches any of the button and key modifier mappings for the operator. If no mappings are defined, it returns true.
      
      **Parameters**
      
      
         **event**\ : :js:class:`MouseInputEvent <wv.Event.MouseInputEvent>`
      
      
            The mouse event to check against the operator's mappings.
      
      
      
      **Returns**\ : *boolean*
      
      
         True if the event matches any mapping or if no mappings are defined, false otherwise.
      
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.clearMapping

      .. rst-class:: clio-flags
      
         :clio-inherited:`inherited`
      
      .. rst-class:: sig-pretty-signature
      
         | clearMapping(): *void*
      
      Clears any button and key modifier mappings for the operator.
      
      **Returns**\ : *void*
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.getDollyZoomEnabled

      .. rst-class:: sig-pretty-signature
      
         | getDollyZoomEnabled(): *boolean*
      
      Returns true if dolly zoom is enabled.
      
      **Returns**\ : *boolean*
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.getMouseMoveZoomDelta

      .. rst-class:: sig-pretty-signature
      
         | getMouseMoveZoomDelta(): *number*
      
      Gets the mouse move zoom delta
      
      **Returns**\ : *number*
      
      
         number
      
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.getMouseMoveZoomInverted

      .. rst-class:: sig-pretty-signature
      
         | getMouseMoveZoomInverted(): *boolean*
      
      **Returns**\ : *boolean*
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.getMouseWheelAdjustCameraTarget

      .. rst-class:: sig-pretty-signature
      
         | getMouseWheelAdjustCameraTarget(): *boolean*
      
      Returns whether the camera target will be updated to the selection position while zooming. See [[setMouseWheelAdjustCameraTarget]].
      
      **Returns**\ : *boolean*
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.getMouseWheelZoomDelta

      .. rst-class:: sig-pretty-signature
      
         | getMouseWheelZoomDelta(): *number*
      
      Gets the scrollwheel zoom delta
      
      **Returns**\ : *number*
      
      
         number
      
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.getMouseWheelZoomInverted

      .. rst-class:: sig-pretty-signature
      
         | getMouseWheelZoomInverted(): *boolean*
      
      **Returns**\ : *boolean*
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.getPreserveViewAngle

      .. rst-class:: sig-pretty-signature
      
         | getPreserveViewAngle(): *boolean*
      
      Gets whether to maintain a constant view angle while zooming. See [[setPreserveViewAngle]].
      
      **Returns**\ : *boolean*
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.getZoomToMousePosition

      .. rst-class:: sig-pretty-signature
      
         | getZoomToMousePosition(): *boolean*
      
      **Returns**\ : *boolean*
      
      
         boolean When true, the zoom will be towards the mouse position. When false, the zoom will be towards the center of the screen.
      
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.isActive

      .. rst-class:: clio-flags
      
         :clio-inherited:`inherited`
      
      .. rst-class:: sig-pretty-signature
      
         | isActive(): *boolean*
      
      Checks if the operator is currently active, which is determined by whether the button and key modifier mapping is active or a touch event is active, and that a double click has not occurred and the context menu is not open.
      
      **Returns**\ : *boolean*
      
      
         True if the operator is active, false otherwise.
      
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.isDragging

      .. rst-class:: clio-flags
      
         :clio-inherited:`inherited`
      
      .. rst-class:: sig-pretty-signature
      
         | isDragging(): *boolean*
      
      Checks if the operator is currently dragging.
      
      **Returns**\ : *boolean*
      
      
         True if the operator is dragging, false otherwise.
      
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.onDoubleClick

      .. rst-class:: clio-flags
      
         :clio-inherited:`inherited`
      
      .. rst-class:: sig-pretty-signature
      
         | onDoubleClick(**_event**\ : :js:class:`MouseInputEvent <wv.Event.MouseInputEvent>`\ ): *void*
      
      NO-OP method for handling double click events. By default, it does nothing, but child classes can override this method to provide specific behavior for double click events.
      
      **Parameters**
      
      
         **_event**\ : :js:class:`MouseInputEvent <wv.Event.MouseInputEvent>`
      
      
            The double click event to handle.
      
      
      
      **Returns**\ : *void*
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.onMouseDown

      .. rst-class:: clio-flags
      
         :clio-inherited:`inherited`
      
      .. rst-class:: sig-pretty-signature
      
         | onMouseDown(**event**\ : :js:class:`MouseInputEvent <wv.Event.MouseInputEvent>`\ ): *void*
      
      Base method for handling mouse down events. It tracks the time between mouse down events to determine if a double click has occurred, and checks the button and key modifier mapping to determine if the operator should be activated. If the operator is activated, it stores the initial mouse position and sets the dragging state to true.
      
      **Parameters**
      
      
         **event**\ : :js:class:`MouseInputEvent <wv.Event.MouseInputEvent>`
      
      
            The mouse down event to handle.
      
      
      
      **Returns**\ : *void*
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.onMouseUp

      .. rst-class:: clio-flags
      
         :clio-inherited:`inherited`
      
      .. rst-class:: sig-pretty-signature
      
         | onMouseUp(**_event**\ : :js:class:`MouseInputEvent <wv.Event.MouseInputEvent>`\ ): *void*
      
      Base method for handling mouse up events. It stops the interaction if the operator is active, and resets the dragging state and drag count.
      
      **Parameters**
      
      
         **_event**\ : :js:class:`MouseInputEvent <wv.Event.MouseInputEvent>`
      
      
            The mouse up event to handle.
      
      
      
      **Returns**\ : *void*
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.setDollyZoomEnabled

      .. rst-class:: sig-pretty-signature
      
         | setDollyZoomEnabled(**dollyZoomEnabled**\ : *boolean*\ ): *void*
      
      When dolly zoom is enabled, the camera position will move towards the camera target when zooming.
      
      **Parameters**
      
      
         **dollyZoomEnabled**\ : *boolean*
      
      
            Sets the dolly zoom status to enabled.
      
      
      
      **Returns**\ : *void*
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.setHandled

      .. rst-class:: clio-flags
      
         :clio-inherited:`inherited`
      
      .. rst-class:: sig-pretty-signature
      
         | setHandled(): *boolean*
      
      Base method for setting the handled state of events. By default, it returns false, but child classes can override this method to provide specific behavior for determining whether events should be marked as handled.
      
      **Returns**\ : *boolean*
      
      
         True if the event should be marked as handled, false otherwise.
      
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.setMapping

      .. rst-class:: clio-flags
      
         :clio-inherited:`inherited`
      
      .. rst-class:: sig-pretty-signature
      
         | setMapping(**button**\ : :js:data:`Button <wv.Button>`\ , **modifier**\ : :js:data:`KeyModifiers <wv.KeyModifiers>`\ ?): *void*
      
      Sets the button and key modifier mapping for the operator.
      
      **Parameters**
      
      
         **button**\ : :js:data:`Button <wv.Button>`
      
         **modifier**\ : :js:data:`KeyModifiers <wv.KeyModifiers>` = KeyModifiers.None
      
      
      **Returns**\ : *void*
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.setMouseMoveZoomDelta

      .. rst-class:: sig-pretty-signature
      
         | setMouseMoveZoomDelta(**delta**\ : *number*\ ): *void*
      
      Sets the delta to zoom when moving the mouse
      
      **Parameters**
      
      
         **delta**\ : *number*
      
      
      **Returns**\ : *void*
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.setMouseMoveZoomInverted

      .. rst-class:: sig-pretty-signature
      
         | setMouseMoveZoomInverted(**inverted**\ : *boolean*\ ): *void*
      
      When true, moving the mouse up will zoom towards the model.
      
      **Parameters**
      
      
         **inverted**\ : *boolean*
      
      
      **Returns**\ : *void*
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.setMouseWheelAdjustCameraTarget

      .. rst-class:: sig-pretty-signature
      
         | setMouseWheelAdjustCameraTarget(**value**\ : *boolean*\ ): *void*
      
      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.
      
      **Parameters**
      
      
         **value**\ : *boolean*
      
      
      **Returns**\ : *void*
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.setMouseWheelZoomDelta

      .. rst-class:: sig-pretty-signature
      
         | setMouseWheelZoomDelta(**delta**\ : *number*\ ): *void*
      
      Sets the delta to zoom when scrolling
      
      **Parameters**
      
      
         **delta**\ : *number*
      
      
      **Returns**\ : *void*
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.setMouseWheelZoomInverted

      .. rst-class:: sig-pretty-signature
      
         | setMouseWheelZoomInverted(**inverted**\ : *boolean*\ ): *void*
      
      When true, scrolling up will zoom towards the model.
      
      **Parameters**
      
      
         **inverted**\ : *boolean*
      
      
      **Returns**\ : *void*
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.setPreserveViewAngle

      .. rst-class:: sig-pretty-signature
      
         | setPreserveViewAngle(**value**\ : *boolean*\ ): *void*
      
      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.
      
      **Parameters**
      
      
         **value**\ : *boolean*
      
      
      **Returns**\ : *void*
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.setZoomToMousePosition

      .. rst-class:: sig-pretty-signature
      
         | setZoomToMousePosition(**zoom**\ : *boolean*\ ): *void*
      
      When set, the zoom will be towards the mouse position. When not set, the zoom will be from the center of the screen.
      
      **Parameters**
      
      
         **zoom**\ : *boolean*
      
      
      **Returns**\ : *void*
      



.. js:method:: wv.Operators.Camera.CameraZoomOperator.stopInteraction

      .. rst-class:: clio-flags
      
         :clio-inherited:`inherited`
      
      Stops an operator from interacting with the scene.
      
      .. rst-class:: sig-pretty-signature
      
         | stopInteraction(): *void*
      
      Stops the current interaction by triggering the "endInteraction" event on the viewer, and resets the dragging state, drag count, and button modifier active state.
      
      **Returns**\ : *void*
      




