madgui.survey.gl_widget module¶
Contains a OpenGL widget to display a static scene.
Classes
|
OpenGL widget that shows a static 3D scene, allowing the observer to freely move and look around. |
-
class
madgui.survey.gl_widget.
GLWidget
(create_items, *args, **kwargs)[source]¶ Bases:
PyQt5.QtWidgets.QOpenGLWidget
OpenGL widget that shows a static 3D scene, allowing the observer to freely move and look around.
Attributes
int(x=0) -> integer
float(x) -> floating point number
int(x=0) -> integer
float(x) -> floating point number
Methods
closeEvent
(event)Free items.
Fetch new items from the given callable.
Create simple program with generic fragment/vertex shaders used to render objects with a simple ambient+diffuse lighting model.
free
()Free all items.
hideEvent
(event)Stop scene updates (camera movement).
Called after first creating a valid OpenGL context.
keyPressEvent
(event)Maintain a list of pressed keys for camera movement.
keyReleaseEvent
(event)Maintain a list of pressed keys for camera movement.
minimumSizeHint
(self)mouseMoveEvent
(event)Handle camera look around.
mousePressEvent
(event)Handle camera look around.
paintGL
()Handle paint event by drawing the items returned by the creator function.
showEvent
(event)Start scene updates (camera movement).
show_gl_info
(spec, text)Show GL version info.
sizeHint
(self)Implement camera movement.
wheelEvent
(event)Handle mouse wheel as zoom.
-
ambient_color
= array([0.1, 0.1, 0.1], dtype=float32)¶
-
background_color
= array([0.6, 0.6, 0.6], dtype=float32)¶
-
camera_speed
= 1¶
-
create_shader_program
()[source]¶ Create simple program with generic fragment/vertex shaders used to render objects with a simple ambient+diffuse lighting model.
-
diffuse_color
= array([1., 1., 1.], dtype=float32)¶
-
initializeGL
()[source]¶ Called after first creating a valid OpenGL context. Creates shader program, sets up camera and creates an initial scene.
-
mouse_sensitivity
= 0.01¶
-
shader_program
= None¶
-
update_interval
= 25¶
-
update_timer
= None¶
-
zoom_speed
= 0.1¶
-