legacy_qt_cube_simple ===================== .. py:module:: legacy_qt_cube_simple .. autoapi-nested-parse:: Simple Qt Cube Renderer - Minimal Dependencies A minimal Qt OpenGL cube example routed through PicoGL's legacy backend, mesh types, and state helpers instead of raw client-state draw calls. Features: - Basic Qt OpenGL widget (PySide6 / PyQt5 / PyQt6) - PicoGL GLBackend + LegacyGLMesh rendering - Mouse controls and auto-rotation - Minimal dependencies beyond Qt, PyOpenGL, NumPy, and PicoGL Usage: python examples/legacy_qt_cube_simple.py Attributes ---------- .. autoapisummary:: legacy_qt_cube_simple.QT_VERSION Classes ------- .. autoapisummary:: legacy_qt_cube_simple.SimpleQtCubeWidget legacy_qt_cube_simple.SimpleQtCubeWindow Functions --------- .. autoapisummary:: legacy_qt_cube_simple._to_np_array legacy_qt_cube_simple.main Module Contents --------------- .. py:data:: QT_VERSION :value: 'PySide6' .. py:function:: _to_np_array(data) -> numpy.ndarray[Any, numpy.dtype[Any]] | numpy.ndarray[Any, numpy.dtype[numpy.generic]] .. py:class:: SimpleQtCubeWidget(parent: Optional[PySide6.QtWidgets.QWidget] = None) Bases: :py:obj:`PySide6.QtOpenGLWidgets.QOpenGLWidget` Minimal Qt cube widget using PicoGL legacy mesh + backend drivers. .. py:attribute:: backend .. py:attribute:: gl_mesh :type: Optional[picogl.renderer.legacy_glmesh.LegacyGLMesh] :value: None .. py:attribute:: _gl_ready :value: False .. py:attribute:: vertices .. py:attribute:: colors .. py:attribute:: indices .. py:attribute:: rotation_x :value: 0.0 .. py:attribute:: rotation_y :value: 0.0 .. py:attribute:: zoom :value: 5.0 .. py:attribute:: auto_rotate :value: True .. py:attribute:: rotation_speed :value: 1.0 .. py:attribute:: last_mouse_pos :value: None .. py:attribute:: timer .. py:method:: initializeGL() Initialize OpenGL through PicoGL backend helpers. .. py:method:: resizeGL(w: int, h: int) Resize viewport and projection via PicoGL drivers. .. py:method:: _set_modelview() -> None Match legacy Qt cube camera: eye on +Z axis, then orbit rotations. .. py:method:: paintGL() Render the cube through PicoGL frame clear + legacy mesh draw. .. py:method:: animate() .. py:method:: mousePressEvent(event) .. py:method:: mouseMoveEvent(event) .. py:method:: wheelEvent(event) .. py:method:: keyPressEvent(event) .. py:class:: SimpleQtCubeWindow Bases: :py:obj:`PySide6.QtWidgets.QMainWindow` Main window hosting the simple PicoGL cube widget. .. py:attribute:: gl_widget .. py:method:: keyPressEvent(event) .. py:function:: main()