54. gui.qtcanvas — Interactive OpenGL Canvas embedded in a Qt widget.

This module implements user interaction with the OpenGL canvas defined in module canvas. QtCanvas is a single interactive OpenGL canvas, while MultiCanvas implements a dynamic array of multiple canvases.

54.1. Classes defined in module gui.qtcanvas

class gui.qtcanvas.CursorShapeHandler(widget)[source]

A class for handling the mouse cursor shape on the Canvas.

class gui.qtcanvas.CanvasMouseHandler[source]

A class for handling the mouse events on the Canvas.

class gui.qtcanvas.QtCanvas(*args, **kargs)[source]

A canvas for OpenGL rendering.

This class provides interactive functionality for the OpenGL canvas provided by the canvas.Canvas class.

Interactivity is highly dependent on Qt. Putting the interactive functions in a separate class makes it esier to use the Canvas class in non-interactive situations or combining it with other GUI toolsets.

The QtCanvas constructor may have positional and keyword arguments. The positional arguments are passed to the QtOpenGL.QGLWidget constructor, while the keyword arguments are passed to the canvas.Canvas constructor.

54.2. Functions defined in module gui.qtcanvas

gui.qtcanvas.dotpr(v, w)[source]

Return the dot product of vectors v and w

gui.qtcanvas.length(v)[source]

Return the length of the vector v

gui.qtcanvas.projection(v, w)[source]

Return the (signed) length of the projection of vector v on vector w.