fsleyes.profiles.scene3dviewprofile

This module provides the Scene3DViewProfile class, an interaction Profile for Scene3DPanel views.

class fsleyes.profiles.scene3dviewprofile.Scene3DViewProfile(viewPanel, overlayList, displayCtx)

Bases: fsleyes.profiles.Profile

The Scene3DViewProfile class is a Profile for Scene3DPanel views. It defines mouse / keyboard handlers for interacting with the Scene3DCanvas 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.vertexIndex or DisplayContext.location
__init__(viewPanel, overlayList, displayCtx)

Create a Profile instance.

Parameters:
  • viewPanel – The ViewPanel instance for which this Profile 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()

Returns a list containing the Scene3DCanvas.

resetDisplay()

Resets the Scene3DCanvas camera settings to their defaults.

_rotateModeLeftMouseDown(ev, canvas, mousePos, canvasPos)

Called on left mouse down events in rotate mode. Saves the mouse position and current rotation matrix (the Scene3DCanvas.rotation property).

_rotateModeLeftMouseDrag(ev, canvas, mousePos, canvasPos)

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)

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)

Called on mouse wheel events in zoom mode. Adjusts the Scene3DCanvas.zoom property.

_panModeLeftMouseDown(ev, canvas, mousePos, canvasPos)

Called on mouse down events in pan mode. Saves the mouse position and current Scene3DCanvas.offset value.

_panModeLeftMouseDrag(ev, canvas, mousePos, canvasPos)

Called on mouse drag events in pan mode. Adjusts the Scene3DCanvas.offset property.

_panModeLeftMouseUp(ev, canvas, mousePos, canvasPos)

Called on mouse up events in pan mode. Clears the internal state used by the down and drag handlers.

_pickModeLeftMouseDown(ev, canvas, mousePos, canvasPos)

Called on mouse down events in pick mode.

Updates the DisplayContext.vertexIndex property if the currently selected overlay is a Mesh, otherwise updates the DisplayContext.location property.

_pickModeLeftMouseDrag(ev, canvas, mousePos, canvasPos)

Called on mouse drag events in pick mode. Forwards the event to the _pickModeLeftMouseDown() method.

__module__ = 'fsleyes.profiles.scene3dviewprofile'