fsleyes.profiles.scene3dviewprofile
¶
This module provides the Scene3DViewProfile
class, an interaction
Profile
for Scene3DPanel
views.
- class fsleyes.profiles.scene3dviewprofile.Scene3DViewProfile(viewPanel, overlayList, displayCtx)[source]¶
Bases:
fsleyes.profiles.Profile
The
Scene3DViewProfile
class is aProfile
forScene3DPanel
views. It defines mouse / keyboard handlers for interacting with theScene3DCanvas
contained in the panel.The following modes are defined (see the
Profile
documentation):rotate
Clicking and dragging the mouse rotates the scene
zoom
Moving the mouse wheel zooms in and out.
pan
Clicking and dragging the mouse pans the scene.
pick
Clicking changes the
DisplayContext.location
- static supportedView()[source]¶
Specifies that this profile can only work with the
Scene3DPanel
view.
- static tempModes()[source]¶
Returns the temporary mode map for the
Scene3DViewProfile
, which controls the use of modifier keys to temporarily enter other interaction modes.
- static altHandlers()[source]¶
Returns the alternate handlers map, which allows event handlers defined in one mode to be re-used whilst in another mode.
- __init__(viewPanel, overlayList, displayCtx)[source]¶
Create a
Profile
instance.- Parameters
viewPanel – The
ViewPanel
instance for which thisProfile
instance defines mouse/keyboard interaction behaviour.overlayList – The
OverlayList
instance which contains the list of overlays being displayed.displayCtx – The
DisplayContext
instance which defines how the overlays are to be displayed.modes – A sequence of strings, containing the mode identifiers for this profile. These are added as options on the
mode
property.
- getEventTargets()[source]¶
Returns a list containing the
Scene3DCanvas
.
- resetDisplay()[source]¶
Resets the
Scene3DCanvas
camera settings to their defaults.
- _rotateModeLeftMouseDown(ev, canvas, mousePos, canvasPos)[source]¶
Called on left mouse down events in
rotate
mode. Saves the mouse position and current rotation matrix (theScene3DCanvas.rotation
property).
- _rotateModeLeftMouseDrag(ev, canvas, mousePos, canvasPos)[source]¶
Called on left mouse drag events in
rotate
mode. Modifies the canvas rotation matrix according to the X and Y mouse position (relative to the mouse down location).
- _rotateModeLeftMouseUp(ev, canvas, mousePos, canvasPos)[source]¶
Called on left mouse up events in
rotate
mode. Clears the internal state used by the mouse down and drag handlers.
- _zoomModeMouseWheel(ev, canvas, wheel, mousePos, canvasPos)[source]¶
Called on mouse wheel events in
zoom
mode. Adjusts theScene3DCanvas.zoom
property.
- _panModeLeftMouseDown(ev, canvas, mousePos, canvasPos)[source]¶
Called on mouse down events in
pan
mode. Saves the mouse position and currentScene3DCanvas.offset
value.
- _panModeLeftMouseDrag(ev, canvas, mousePos, canvasPos)[source]¶
Called on mouse drag events in
pan
mode. Adjusts theScene3DCanvas.offset
property.
- _panModeLeftMouseUp(ev, canvas, mousePos, canvasPos)[source]¶
Called on mouse up events in
pan
mode. Clears the internal state used by the down and drag handlers.
- _pickModeLeftMouseDown(ev, canvas, mousePos, canvasPos)[source]¶
Called on mouse down events in
pick
mode.Updates the
DisplayContext.location
property.
- _pickModeLeftMouseDrag(ev, canvas, mousePos, canvasPos)[source]¶
Called on mouse drag events in
pick
mode. Forwards the event to the_pickModeLeftMouseDown()
method.
- __annotations__ = {}¶
- __module__ = 'fsleyes.profiles.scene3dviewprofile'¶