QGIS API Documentation 3.37.0-Master (4ace69f83af)
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
QgsMeshLayerRenderer Class Reference

Implementation of threaded rendering for mesh layers. More...

#include <qgsmeshlayerrenderer.h>

Inheritance diagram for QgsMeshLayerRenderer:
Inheritance graph
[legend]

Public Member Functions

 QgsMeshLayerRenderer (QgsMeshLayer *layer, QgsRenderContext &context)
 Ctor.
 
 ~QgsMeshLayerRenderer () override=default
 
QgsFeedbackfeedback () const override
 Access to feedback object of the layer renderer (may be nullptr)
 
bool forceRasterRender () const override
 Returns true if the renderer must be rendered to a raster paint device (e.g.
 
bool render () override
 Do the rendering (based on data stored in the class).
 
- Public Member Functions inherited from QgsMapLayerRenderer
 QgsMapLayerRenderer (const QString &layerID, QgsRenderContext *context=nullptr)
 Constructor for QgsMapLayerRenderer, with the associated layerID and render context.
 
virtual ~QgsMapLayerRenderer ()
 
QStringList errors () const
 Returns list of errors (problems) that happened during the rendering.
 
virtual Qgis::MapLayerRendererFlags flags () const
 Returns flags which control how the map layer rendering behaves.
 
bool isReadyToCompose () const
 Returns whether the renderer has already drawn (at least partially) some data.
 
QString layerId () const
 Gets access to the ID of the layer rendered by this class.
 
QgsRenderContextrenderContext ()
 Returns the render context associated with the renderer.
 
const QgsRenderContextrenderContext () const
 Returns the render context associated with the renderer.
 
virtual void setLayerRenderingTimeHint (int time)
 Sets approximate render time (in ms) for the layer to render.
 
QList< QgsRenderedItemDetails * > takeRenderedItemDetails ()
 Takes the list of rendered item details from the renderer.
 

Protected Attributes

QList< QgsMapClippingRegionmClippingRegions
 
double mElevationOffset = 0.0
 
double mElevationScale = 1.0
 
bool mEnableProfile = false
 
std::unique_ptr< QgsMeshLayerRendererFeedback > mFeedback
 feedback class for cancellation
 
QgsRectangle mLayerExtent
 
QString mLayerName
 
QgsMesh mNativeMesh
 
QSize mOutputSize
 
quint64 mPreparationTime = 0
 
bool mRenderElevationMap = false
 
QgsMeshRendererSettings mRendererSettings
 
QgsMeshDataBlock mScalarActiveFaceFlagValues
 
double mScalarDatasetMaximum = std::numeric_limits<double>::quiet_NaN()
 
double mScalarDatasetMinimum = std::numeric_limits<double>::quiet_NaN()
 
QVector< double > mScalarDatasetValues
 
QgsMeshDatasetGroupMetadata::DataType mScalarDataType = QgsMeshDatasetGroupMetadata::DataOnVertices
 
QgsTriangularMesh mTriangularMesh
 
QgsMeshDataBlock mVectorActiveFaceFlagValues
 
double mVectorDatasetGroupMagMaximum = std::numeric_limits<double>::quiet_NaN()
 
double mVectorDatasetGroupMagMinimum = std::numeric_limits<double>::quiet_NaN()
 
double mVectorDatasetMagMaximum = std::numeric_limits<double>::quiet_NaN()
 
double mVectorDatasetMagMinimum = std::numeric_limits<double>::quiet_NaN()
 
QgsMeshDataBlock mVectorDatasetValues
 
QVector< double > mVectorDatasetValuesMag
 
QgsMeshDatasetGroupMetadata::DataType mVectorDataType = QgsMeshDatasetGroupMetadata::DataOnVertices
 
- Protected Attributes inherited from QgsMapLayerRenderer
QStringList mErrors
 
QString mLayerID
 
bool mReadyToCompose = true
 The flag must be set to false in renderer's constructor if wants to use the smarter map redraws functionality https://github.com/qgis/QGIS-Enhancement-Proposals/issues/181.
 

Additional Inherited Members

- Protected Member Functions inherited from QgsMapLayerRenderer
void appendRenderedItemDetails (QgsRenderedItemDetails *details)
 Appends the details of a rendered item to the renderer.
 
- Static Protected Attributes inherited from QgsMapLayerRenderer
static constexpr int MAX_TIME_TO_USE_CACHED_PREVIEW_IMAGE = 3000
 Maximum time (in ms) to allow display of a previously cached preview image while rendering layers, before switching to a progressive rendering display.
 

Detailed Description

Implementation of threaded rendering for mesh layers.

Note
not available in Python bindings
Since
QGIS 3.2

Definition at line 93 of file qgsmeshlayerrenderer.h.

Constructor & Destructor Documentation

◆ QgsMeshLayerRenderer()

QgsMeshLayerRenderer::QgsMeshLayerRenderer ( QgsMeshLayer layer,
QgsRenderContext context 
)

Ctor.

Definition at line 46 of file qgsmeshlayerrenderer.cpp.

◆ ~QgsMeshLayerRenderer()

QgsMeshLayerRenderer::~QgsMeshLayerRenderer ( )
overridedefault

Member Function Documentation

◆ feedback()

QgsFeedback * QgsMeshLayerRenderer::feedback ( ) const
overridevirtual

Access to feedback object of the layer renderer (may be nullptr)

Reimplemented from QgsMapLayerRenderer.

Definition at line 116 of file qgsmeshlayerrenderer.cpp.

◆ forceRasterRender()

bool QgsMeshLayerRenderer::forceRasterRender ( ) const
overridevirtual

Returns true if the renderer must be rendered to a raster paint device (e.g.

QImage).

Some layer settings require layers to be effectively "flattened" while rendering maps, which is achieved by first rendering the layer onto a raster paint device and then compositing the resultant image onto the final map render.

E.g. if a layer contains features with transparency or alternative blending modes, and the effects of these opacity or blending modes should be restricted to only affect other features within the SAME layer, then a flattened raster based render is required.

Subclasses should return true whenever their corresponding layer settings require the layer to always be rendered using a raster paint device.

Since
QGIS 3.18

Reimplemented from QgsMapLayerRenderer.

Definition at line 347 of file qgsmeshlayerrenderer.cpp.

◆ render()

bool QgsMeshLayerRenderer::render ( )
overridevirtual

Do the rendering (based on data stored in the class).

Returns true if the layer was completely rendered successfully (i.e. the render was not canceled early).

Implements QgsMapLayerRenderer.

Definition at line 313 of file qgsmeshlayerrenderer.cpp.

Member Data Documentation

◆ mClippingRegions

QList< QgsMapClippingRegion > QgsMeshLayerRenderer::mClippingRegions
protected

Definition at line 164 of file qgsmeshlayerrenderer.h.

◆ mElevationOffset

double QgsMeshLayerRenderer::mElevationOffset = 0.0
protected

Definition at line 170 of file qgsmeshlayerrenderer.h.

◆ mElevationScale

double QgsMeshLayerRenderer::mElevationScale = 1.0
protected

Definition at line 169 of file qgsmeshlayerrenderer.h.

◆ mEnableProfile

bool QgsMeshLayerRenderer::mEnableProfile = false
protected

Definition at line 173 of file qgsmeshlayerrenderer.h.

◆ mFeedback

std::unique_ptr<QgsMeshLayerRendererFeedback> QgsMeshLayerRenderer::mFeedback
protected

feedback class for cancellation

Definition at line 133 of file qgsmeshlayerrenderer.h.

◆ mLayerExtent

QgsRectangle QgsMeshLayerRenderer::mLayerExtent
protected

Definition at line 142 of file qgsmeshlayerrenderer.h.

◆ mLayerName

QString QgsMeshLayerRenderer::mLayerName
protected

Definition at line 130 of file qgsmeshlayerrenderer.h.

◆ mNativeMesh

QgsMesh QgsMeshLayerRenderer::mNativeMesh
protected

Definition at line 136 of file qgsmeshlayerrenderer.h.

◆ mOutputSize

QSize QgsMeshLayerRenderer::mOutputSize
protected

Definition at line 167 of file qgsmeshlayerrenderer.h.

◆ mPreparationTime

quint64 QgsMeshLayerRenderer::mPreparationTime = 0
protected

Definition at line 174 of file qgsmeshlayerrenderer.h.

◆ mRenderElevationMap

bool QgsMeshLayerRenderer::mRenderElevationMap = false
protected

Definition at line 171 of file qgsmeshlayerrenderer.h.

◆ mRendererSettings

QgsMeshRendererSettings QgsMeshLayerRenderer::mRendererSettings
protected

Definition at line 162 of file qgsmeshlayerrenderer.h.

◆ mScalarActiveFaceFlagValues

QgsMeshDataBlock QgsMeshLayerRenderer::mScalarActiveFaceFlagValues
protected

Definition at line 146 of file qgsmeshlayerrenderer.h.

◆ mScalarDatasetMaximum

double QgsMeshLayerRenderer::mScalarDatasetMaximum = std::numeric_limits<double>::quiet_NaN()
protected

Definition at line 149 of file qgsmeshlayerrenderer.h.

◆ mScalarDatasetMinimum

double QgsMeshLayerRenderer::mScalarDatasetMinimum = std::numeric_limits<double>::quiet_NaN()
protected

Definition at line 148 of file qgsmeshlayerrenderer.h.

◆ mScalarDatasetValues

QVector<double> QgsMeshLayerRenderer::mScalarDatasetValues
protected

Definition at line 145 of file qgsmeshlayerrenderer.h.

◆ mScalarDataType

Definition at line 147 of file qgsmeshlayerrenderer.h.

◆ mTriangularMesh

QgsTriangularMesh QgsMeshLayerRenderer::mTriangularMesh
protected

Definition at line 139 of file qgsmeshlayerrenderer.h.

◆ mVectorActiveFaceFlagValues

QgsMeshDataBlock QgsMeshLayerRenderer::mVectorActiveFaceFlagValues
protected

Definition at line 153 of file qgsmeshlayerrenderer.h.

◆ mVectorDatasetGroupMagMaximum

double QgsMeshLayerRenderer::mVectorDatasetGroupMagMaximum = std::numeric_limits<double>::quiet_NaN()
protected

Definition at line 158 of file qgsmeshlayerrenderer.h.

◆ mVectorDatasetGroupMagMinimum

double QgsMeshLayerRenderer::mVectorDatasetGroupMagMinimum = std::numeric_limits<double>::quiet_NaN()
protected

Definition at line 157 of file qgsmeshlayerrenderer.h.

◆ mVectorDatasetMagMaximum

double QgsMeshLayerRenderer::mVectorDatasetMagMaximum = std::numeric_limits<double>::quiet_NaN()
protected

Definition at line 156 of file qgsmeshlayerrenderer.h.

◆ mVectorDatasetMagMinimum

double QgsMeshLayerRenderer::mVectorDatasetMagMinimum = std::numeric_limits<double>::quiet_NaN()
protected

Definition at line 155 of file qgsmeshlayerrenderer.h.

◆ mVectorDatasetValues

QgsMeshDataBlock QgsMeshLayerRenderer::mVectorDatasetValues
protected

Definition at line 152 of file qgsmeshlayerrenderer.h.

◆ mVectorDatasetValuesMag

QVector<double> QgsMeshLayerRenderer::mVectorDatasetValuesMag
protected

Definition at line 154 of file qgsmeshlayerrenderer.h.

◆ mVectorDataType

Definition at line 159 of file qgsmeshlayerrenderer.h.


The documentation for this class was generated from the following files: