6.1.1.4.1.7. thyrsis.meshlayer.opengl_layer module¶
- class thyrsis.meshlayer.opengl_layer.OpenGlLayer(type_=None, name=None)¶
Bases :
qgis._core.QgsPluginLayer
Base class to encapsulate the tricks to create OpenGL layers Be careful, the layer is drawn in main thread due to current Qt limitations care must be taken not to stall the event loop while requesting a render job since since the rendering thread signal will not be passed to the main thread.
Child class must implement the image method
- LAYER_TYPE = 'opengl_layer'¶
- createMapRenderer(rendererContext)¶
create the renderer for the open_gl layer
- Paramètres
rendererContext (QOpenGLContext) – openGL context
- Renvoie
OpenGlRenderer
- Type renvoyé
- draw(rendererContext)¶
This function is called by the rendering thread. GlMesh must be created in the main thread.
- Paramètres
rendererContext (QOpenGLContext) – openGL context
- Renvoie
success state
- Type renvoyé
bool
- image(rendererContext, size)¶
This is the function that should be overwritten the rendererContext does not have a painter and an image must be returned instead
- Paramètres
rendererContext (QOpenGLContext) – openGL context
size (QSize) – size
- setTransformContext(context)¶
Contains information about the context in which a coordinate transform is executed. UNUSED
- class thyrsis.meshlayer.opengl_layer.OpenGlLayerType(type_=None)¶
Bases :
qgis._core.QgsPluginLayerType
Type for opengl layer
- createLayer()¶
Create a OpenGlLayer
- Renvoie
OpenGlLayer
- Type renvoyé
- showLayerProperties(layer)¶
Open the mesh layer property dialog
- Paramètres
layer (QgsMapLayer) – QgsMapLayer
- Renvoie
success state
- Type renvoyé
bool