Plot3DWidget: OpenGL scene widget

This module provides a Qt widget embedding an OpenGL scene.

Plot3DWidget

class Plot3DWidget(parent=None, f=<PySide2.QtCore.Qt.WindowFlags object>)[source]

Bases: silx.gui._glutils.OpenGLWidget.OpenGLWidget

OpenGL widget with a 3D viewport and an overview.

sigInteractiveModeChanged = <PySide2.QtCore.Signal object>

Signal emitted when the interactive mode has changed

sigStyleChanged = <PySide2.QtCore.Signal object>

Signal emitted when the style of the scene has changed

It provides the updated property.

setInteractiveMode(mode)[source]

Set the interactive mode.

Parameters:mode (str) – The interactive mode: ‘rotate’, ‘pan’ or None
getInteractiveMode()[source]

Returns the interactive mode in use.

Return type:str
setProjection(projection)[source]

Change the projection in use.

Parameters:projection (str) – In ‘perspective’, ‘orthographic’.
getProjection()[source]

Return the current camera projection mode as a str.

See setProjection()

setBackgroundColor(color)[source]

Set the background color of the OpenGL view.

Parameters:color (QColor, str or array-like of 3 or 4 float in [0., 1.] or uint8) – RGB color of the isosurface: name, #RRGGBB or RGB values
getBackgroundColor()[source]

Returns the RGBA background color (QColor).

isOrientationIndicatorVisible()[source]

Returns True if the orientation indicator is displayed.

Return type:bool
setOrientationIndicatorVisible(visible)[source]

Set the orientation indicator visibility.

Parameters:visible (bool) – True to show
centerScene()[source]

Position the center of the scene at the center of rotation.

resetZoom(face='front')[source]

Reset the camera position to a default.

Parameters:face (str) – The direction the camera is looking at: side, front, back, top, bottom, right, left. Default: front.
initializeGL()[source]

Override to implement OpenGL initialization.

paintGL()[source]

Override to implement OpenGL rendering.

resizeGL(width, height)[source]

Override to implement resize of OpenGL framebuffer.

Parameters:
  • width (int) – Width in device-independent pixels
  • height (int) – Height in device-independent pixels
grabGL()[source]

Renders the OpenGL scene into a numpy array

Returns:OpenGL scene RGB rasterization
Return type:QImage
keyReleaseEvent(event)[source]

Catch Ctrl key release