CameraWindowZoomOperator
-
class
wv.Operators.Camera.CameraWindowZoomOperator() 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.
Methods
-
wv.Operators.Camera.CameraWindowZoomOperator.addMapping() inherited
addMapping(button:Button, modifier:KeyModifiers?): voidAdds 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:
Buttonmodifier:
KeyModifiers= KeyModifiers.NoneReturns: void
-
wv.Operators.Camera.CameraWindowZoomOperator.checkMapping() inherited
checkMapping(event:MouseInputEvent): booleanChecks 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:
MouseInputEventThe 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.
-
wv.Operators.Camera.CameraWindowZoomOperator.clearMapping() inherited
clearMapping(): voidClears any button and key modifier mappings for the operator.
Returns: void
-
wv.Operators.Camera.CameraWindowZoomOperator.doZoom() -
Parameters
Returns: Promise
-
wv.Operators.Camera.CameraWindowZoomOperator.getComputeTarget() - getComputeTarget(): boolean
Returns whether a new camera target will be computed using selection. See [[setComputeTarget]]
Returns: boolean
-
wv.Operators.Camera.CameraWindowZoomOperator.getPreserveViewAngle() - getPreserveViewAngle(): boolean
Gets whether to maintain a constant view angle while zooming. See [[setPreserveViewAngle]].
Returns: boolean
-
wv.Operators.Camera.CameraWindowZoomOperator.isActive() inherited
isActive(): booleanChecks 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.
-
wv.Operators.Camera.CameraWindowZoomOperator.isDragging() inherited
isDragging(): booleanChecks if the operator is currently dragging.
Returns: boolean
True if the operator is dragging, false otherwise.
-
wv.Operators.Camera.CameraWindowZoomOperator.onDeactivate() inherited
onDeactivate(): (void | Promise)Called when the operator is deactivated. This method stops any ongoing interactions and resets the primary touch ID. It can be overridden by child classes to provide additional cleanup behavior when the operator is deactivated.
Returns: (void | Promise)
A promise that resolves when the deactivation process is complete, or void if no asynchronous operations are performed.
-
wv.Operators.Camera.CameraWindowZoomOperator.onDoubleClick() inherited
onDoubleClick(_event:MouseInputEvent): voidNO-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:
MouseInputEventThe double click event to handle.Returns: void
-
wv.Operators.Camera.CameraWindowZoomOperator.onTouchEnd() inherited
onTouchEnd(event:TouchInputEvent): voidBase method for handling touch end events. If the touch event corresponds to the primary touch point, it emulates a mouse up event using the touch position and resets the primary touch ID. It also sets the event as handled based on the operator’s setHandled method.
Parameters
event:
TouchInputEventThe touch end event to handle.Returns: void
-
wv.Operators.Camera.CameraWindowZoomOperator.onTouchMove() inherited
onTouchMove(event:TouchInputEvent): PromiseBase method for handling touch move events. If the touch event corresponds to the primary touch point, it emulates a mouse move event using the touch position. It awaits the onMouseMove method to allow for asynchronous behavior in child classes.
Parameters
event:
TouchInputEventThe touch move event to handle.Returns: Promise
-
wv.Operators.Camera.CameraWindowZoomOperator.onTouchStart() inherited
onTouchStart(event:TouchInputEvent): voidBase method for handling touch start events. It tracks the primary touch point and emulates a mouse down event using the touch position. If there is already an active touch, it ignores additional touch start events.
Parameters
event:
TouchInputEventThe touch start event to handle.Returns: void
-
wv.Operators.Camera.CameraWindowZoomOperator.setComputeTarget() - setComputeTarget(compute: boolean): void
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.
Parameters
compute: booleanReturns: void
-
wv.Operators.Camera.CameraWindowZoomOperator.setHandled() inherited
setHandled(): booleanBase 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.
-
wv.Operators.Camera.CameraWindowZoomOperator.setMapping() inherited
setMapping(button:Button, modifier:KeyModifiers?): voidSets the button and key modifier mapping for the operator.
Parameters
button:
Buttonmodifier:
KeyModifiers= KeyModifiers.NoneReturns: void
-
wv.Operators.Camera.CameraWindowZoomOperator.setPreserveViewAngle() - setPreserveViewAngle(preserve: 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 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.
Parameters
preserve: booleanReturns: void
-
wv.Operators.Camera.CameraWindowZoomOperator.stopInteraction() inherited
Stops an operator from interacting with the scene.
stopInteraction(): voidStops 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