Plot3DWidget: OpenGL scene widget

This module provides a Qt widget embedding an OpenGL scene.

Plot3DWidget

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

Bases: silx.gui._glutils.OpenGLWidget.OpenGLWidget

OpenGL widget with a 3D viewport and an overview.

class FogMode[source]

Bases: silx.utils.enum.Enum

Different mode to render the scene with fog

Plot3DWidget.centerScene()[source]

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

Plot3DWidget.getBackgroundColor()[source]

Returns the RGBA background color (QColor).

Plot3DWidget.getFogMode()[source]

Returns the kind of fog in use

Returns:The kind of fog in use
Return type:FogMode
Plot3DWidget.getInteractiveMode()[source]

Returns the interactive mode in use.

Return type:str
Plot3DWidget.getProjection()[source]

Return the current camera projection mode as a str.

See setProjection()

Plot3DWidget.grabGL()[source]

Renders the OpenGL scene into a numpy array

Returns:OpenGL scene RGB rasterization
Return type:QImage
Plot3DWidget.isOrientationIndicatorVisible()[source]

Returns True if the orientation indicator is displayed.

Return type:bool
Plot3DWidget.keyReleaseEvent(event)[source]

Catch Ctrl key release

Plot3DWidget.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.
Plot3DWidget.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
Plot3DWidget.setFogMode(mode)[source]

Set the kind of fog to use for the whole scene.

Parameters:mode (Union[str,FogMode]) – The mode to use
Raises:ValueError – If mode is not supported
Plot3DWidget.setInteractiveMode(mode)[source]

Set the interactive mode.

Parameters:mode (str) – The interactive mode: ‘rotate’, ‘pan’ or None
Plot3DWidget.setOrientationIndicatorVisible(visible)[source]

Set the orientation indicator visibility.

Parameters:visible (bool) – True to show
Plot3DWidget.setProjection(projection)[source]

Change the projection in use.

Parameters:projection (str) – In ‘perspective’, ‘orthographic’.