picogl.ui.backend.qt.base

GLBase Qt Widget

Classes

MvpParameters

MVP Parameters

CameraParameters

camera parameters

GLBase

OpenGL Qt Widget

Module Contents

class picogl.ui.backend.qt.base.MvpParameters[source]

MVP Parameters

rotation_x = None[source]
rotation_y = None[source]
pan_x = None[source]
pan_y = None[source]
class picogl.ui.backend.qt.base.CameraParameters[source]

camera parameters

rotation_x_axis = None[source]
rotation_y_axis = None[source]
rotation_z_axis = None[source]
translation_x_axis = None[source]
translation_y_axis = None[source]
translation_zoom = None[source]
rotation: numpy.ndarray[source]
translation: numpy.ndarray[source]
class picogl.ui.backend.qt.base.GLBase(parent: PySide6.QtWidgets.QWidget = None, gl_use_legacy: bool = True)[source]

Bases: PySide6.QtOpenGLWidgets.QOpenGLWidget, PySide6.QtGui.QOpenGLFunctions

OpenGL Qt Widget

aspect_ratio = None[source]
gl_use_legacy = True[source]
last_mouse_pos = None[source]
zoom_value = None[source]
mvp_parameters[source]
camera_parameters[source]
initializeGL()[source]

initializeGL

Initializes the OpenGL rendering context for this widget.

This includes: - Enabling depth testing and multisampling - Configuring blending for transparency - Initializing lighting and material properties - Setting the viewport to match widget size - Clearing any legacy buffer state

Called automatically by Qt when the GL context is first created.

resizeGL(w: int, h: int) None[source]

resizeGL(w, h)

Handles resizing the OpenGL viewport and updates the projection matrix.

Parameters:
  • w – int - New width of the OpenGL widget

  • h – int - New height of the OpenGL widget

update_mvp() None[source]

Update model-view-projection matrix.

paintGL()[source]

paintGL

Returns:

None

OpenGL rendering entry point. Calls the appropriate rendering method based g. Modern OpenGL rendering entry point.

mousePressEvent(event: PySide6.QtGui.QMouseEvent) None[source]

mousePressEvent

Parameters:

event – QMouseEvent

Handle mouse press events, including atom picking and coordinate un-projection.

mouseMoveEvent(event: PySide6.QtGui.QMouseEvent) None[source]

mouseMoveEvent

Parameters:

event – QMouseEvent

Handle mouse movement for X/Y axis rotation.

wheelEvent(event: PySide6.QtGui.QWheelEvent) None[source]

wheelEvent

Parameters:

event – QWheelEvent

Returns:

None

Sets zoom level

mouseReleaseEvent(event: PySide6.QtGui.QMouseEvent) None[source]

mouseReleaseEvent

Parameters:

event – QMouseEvent

Returns:

None

abstract _compute_clicked_position(x: int, y: int, z: int, viewport: numpy.ndarray) numpy.ndarray | None[source]

_compute_clicked_position

Parameters:
  • x – int

  • y – int

  • z – int

  • viewport – np.ndarray

Returns:

np.ndarray or None

_get_viewport() numpy.ndarray[source]

_get_viewport

Returns:

np.ndarray: Array containing viewport dimensions.

Retrieve the current OpenGL viewport dimensions.

_apply_camera_rotation(dx: float, dy: float) None[source]

_apply_camera_rotation

Parameters:
  • dx – float

  • dy – float

Returns:

None

Apply delta rotation based on mouse movement

_emit_rotation_feedback()[source]