CameraWindowZoomOperator

class Communicator.Operator.CameraWindowZoomOperator()

Methods

addMapping

Communicator.Operator.CameraWindowZoomOperator.addMapping(button, modifier)

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.

Arguments
  • button (Communicator.Button()) –

  • modifier (Communicator.KeyModifiers()) –

Return type

void

clearMapping

Communicator.Operator.CameraWindowZoomOperator.clearMapping()

Clears any button and key modifier mappings for the operator.

Return type

void

doZoom

Communicator.Operator.CameraWindowZoomOperator.doZoom(rectMin, rectMax)
Arguments
  • rectMin (Communicator.Point2()) –

  • rectMax (Communicator.Point2()) –

Return type

Promise[void]

getComputeTarget

Communicator.Operator.CameraWindowZoomOperator.getComputeTarget()

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

Return type

boolean

getPreserveViewAngle

Communicator.Operator.CameraWindowZoomOperator.getPreserveViewAngle()

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

Return type

boolean

setComputeTarget

Communicator.Operator.CameraWindowZoomOperator.setComputeTarget(compute)

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.

Arguments
  • compute (boolean()) –

Return type

void

This setting is disabled by default.

setMapping

Communicator.Operator.CameraWindowZoomOperator.setMapping(button, modifier)

Sets the button and key modifier mapping for the operator.

Arguments
  • button (Communicator.Button()) –

  • modifier (Communicator.KeyModifiers()) –

Return type

void

setPreserveViewAngle

Communicator.Operator.CameraWindowZoomOperator.setPreserveViewAngle(preserve)

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.

Arguments
  • preserve (boolean()) –

Return type

void

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.