urclib.ui_qt.visualizer.qt_support.qt_GaiaGLWidget

Widget for embedding the geometry scene logic within a Qt-based GUI.

Module Contents

Classes

GaiaQtGLWidget

Qt-compatible widget for visualization support.

class urclib.ui_qt.visualizer.qt_support.qt_GaiaGLWidget.GaiaQtGLWidget(parent=None, inScene=None)

Bases: urclib.ui_qt.visualizer.qt_support._compat.QOpenGLWidget

Qt-compatible widget for visualization support.

GLDrawErrHandler

Optional function that takes a title and message as arguments. This function is called when an OpenGL error is encountered.

Type:

function(str,str),optional

dragButton

Qt enumeration for which mouse button is used with drag operations. Default is Qt.LeftButton.

Type:

int

selectButton

Qt enumeration for which mouse button is used with selection operations. Default is Qt.RightButton.

Type:

int

rubberBandEnabled

Flag indicating whether or not to allow rubber-band drawing for operations. Defaults to True.

Type:

bool

initZoom

Either List of extents or id of layer to zoom to on load of scene data. Default is None.

Type:

list or number,optional

Parameters:
  • parent (QWidget,optional) – The parent widget. Defaults to None.

  • inScene (GeometryGLScene,optional) – The scene object to associate with the widget; defaults to None.

Qt Signals:
  • selectionpicked (int,int) – Emitted when a geometric object in the scene is selected by the user. Emits the layer id and geometry object’s index within that layer.

  • mouseMoved (float,float) – Emitted whenever the mouse is moved within the widget. Mouse tracking must be enabled for this to work properly. The (x,y) coordinate emitted is in scene/world space.

  • mouseInOut (bool) – Emitted when the mouse cursor enters or leaves the scene. Flag is emitted indicating whether the cursor is still in the scene.

  • pointclicked (float,float) – Point in world coordinates where a click took place.

class SimpleExtent(qSize)

Bases: object

Simple representation of rectangular extents. Generic representation of QRect object.

width

width of the extent.

Type:

float

height

height of the extent.

Type:

float

x

The x-component of the bottom-left origin.

Type:

float

y

The y-component of the bottom-left origin.

Type:

float

Parameters:

qSize (QRect) – Rect to convert into extents.

property list_extents

extents in [left,right,bottom,top] form.

Type:

list

property scene

Teh currently assigned scene object

Type:

GeometryGLScene

selectionpicked
mouseMoved
mouseInOut
pointclicked
cleanupGL()

Deallocate any referenced OpenGL resources.

getSimpleExtent()

Retrieve scene extent in pixel space.

Returns:

Generalized extent object for widget.

Return type:

GaiaGLWidget.GaiaQtGLWidget

paintGL()

This is an overload of a method of QOpenGLWidget. See official documentation for more information.

See also

[Official Qt Documentation](https://doc.qt.io/qt-5/qopenglwidget.html#paintGL)

initializeGL()

This is an overload of a method of QOpenGLWidget. See official documentation for more information.

See also

[Official Qt Documentation](https://doc.qt.io/qt-5/qopenglwidget.html#initializeGL)

resizeGL(w, h)

This is an overload of a method of QOpenGLWidget. See official documentation for more information.

Parameters:
  • w (int) – The new width of the viewport, in pixels.

  • h (int) – The new height of the viewport, in pixels.

See also

[Official Qt Documentation](https://doc.qt.io/qt-5/qopenglwidget.html#resizeGL)

makeCurrent()

This is an overload of a method of QOpenGLWidget. See official documentation for more information.

See also

[Official Qt Documentation](https://doc.qt.io/qt-5/qopenglwidget.html#makeCurrent)

doneCurrent()

This is an overload of a method of QOpenGLWidget. See official documentation for more information.

See also

[Official Qt Documentation](https://doc.qt.io/qt-5/qopenglwidget.html#doneCurrent)

_raiseUninitException(fnlbl)

Convenience method for raising an error when method is called which relies on scene property, when scene is None

Parameters:

fnlbl (str) – The name of the function/method being invoked.

pointToScene(curPos, toClipspace=False)

Converts a point (generally considered the cursor position) from pixel space to projected space.

Parameters:
  • curPos (glm.vec2) – The point in widget pixel space.

  • toClipspace (bool,optional) – If true, converts coordinate into clip space instead of world space. Defaults to False.

Returns:

The coordinates in scene projected space.

Return type:

glm.vec4

forceRefresh()

Explicitly mark the scene for redrawing and post an update notification.

mouseMoveEvent(event)

This is an overload of a method of QOpenGLWidget. See official documentation for more information.

Parameters:

event (PyQt5.QtGui.QMouseEvent) – The triggering event.

See also

[Official Qt Documentation](https://doc.qt.io/qt-5/qwidget.html#mouseMoveEvent)

mouseReleaseEvent(event)

This is an overload of a method of QOpenGLWidget. See official documentation for more information.

Parameters:

event (PyQt5.QtGui.QMouseEvent) – The triggering event.

See also

[Official Qt Documentation](https://doc.qt.io/qt-5/qwidget.html#mouseReleaseEvent)

enterEvent(event)

This is an overload of a method of QOpenGLWidget. See official documentation for more information.

Parameters:

event (PyQt5.QtGui.QEvent) – The triggering event.

See also

[Official Qt Documentation](https://doc.qt.io/qt-5/qwidget.html#enterEvent)

leaveEvent(event)

This is an overload of a method of QOpenGLWidget. See official documentation for more information.

Parameters:

event (PyQt5.QtGui.QEvent) – The triggering event.

See also

[Official Qt Documentation](https://doc.qt.io/qt-5/qwidget.html#leaveEvent)

wheelEvent(event)

This is an overload of a method of QOpenGLWidget. See official documentation for more information.

Parameters:

event (PyQt5.QtGui.QWheelEvent) – The triggering event.

See also

[Official Qt Documentation](https://doc.qt.io/qt-5/qwidget.html#wheelEvent)

showEvent(event)

This is an overload of a method of QOpenGLWidget. See official documentation for more information.

Parameters:

event (PyQt5.QtGui.QShowEvent) – The triggering event.

See also

[Official Qt Documentation](https://doc.qt.io/qt-5/qwidget.html#showEvent)

_doInitLayerZoom()

Perform scene zoom on load.