pymor.discretizers.builtin.gui.qt.gl

Visualization of grid data using OpenGL.

This module provides a widget for displaying patch plots of scalar data assigned to 2D-grids using OpenGL. This widget is not intended to be used directly. Instead, use visualize_patch or PatchVisualizer.

Module Contents

class pymor.discretizers.builtin.gui.qt.gl.ColorBarWidget(parent, U=None, vmin=None, vmax=None)[source]

Bases: qtpy.QtWidgets.QOpenGLWidget

initializeGL()[source]
paintGL()[source]
resizeGL(w, h)[source]
set(U=None, vmin=None, vmax=None)[source]
class pymor.discretizers.builtin.gui.qt.gl.GLPatchWidget(parent, grid, bounding_box=([0, 0], [1, 1]), codim=2)[source]

Bases: qtpy.QtWidgets.QOpenGLWidget

initializeGL()[source]
paintGL()[source]
resizeGL(w, h)[source]
set(U, vmin, vmax)[source]
set_coordinates(coordinates)[source]
pymor.discretizers.builtin.gui.qt.gl.colormap_texture(name='viridis')[source]
pymor.discretizers.builtin.gui.qt.gl.compile_shader(source, vertex=True)[source]

Compile a vertex shader from source.

Create a shader program with from compiled shaders.

pymor.discretizers.builtin.gui.qt.gl.FS = Multiline-String[source]
Show Value
"""
#version 120

uniform sampler1D colormap;

varying float value;

void main()
{
    gl_FragColor = texture1D(colormap, value);
}
"""
pymor.discretizers.builtin.gui.qt.gl.VS = Multiline-String[source]
Show Value
"""
#version 120
// Attribute variable that contains coordinates of the vertices.
attribute vec3 position;
varying float value;

void main()
{
    gl_Position.xy = position.xy;
    gl_Position.z = 0.;
    gl_Position.w = 1.;
    value = position.z;
}
"""