QGIS API Documentation 3.35.0-Master (274c3da7543)
Loading...
Searching...
No Matches
qgsmeshlayerinterpolator.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmeshlayerinterpolator.h
3 --------------------------
4 begin : April 2018
5 copyright : (C) 2018 by Peter Petrik
6 email : zilolv at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSMESHLAYERINTERPOLATOR_H
19#define QGSMESHLAYERINTERPOLATOR_H
20
21class QgsMeshLayer;
22class QgsSymbol;
26
27#include "qgis.h"
28#include "qgis_sip.h"
29
30#include <QSize>
31#include "qgsmaplayerrenderer.h"
32#include "qgstriangularmesh.h"
33#include "qgsrasterinterface.h"
35#include "qgsrastershader.h"
36
38
39#ifdef SIP_RUN
40% ModuleHeaderCode
42% End
43#endif
44
46
54class QgsMeshLayerInterpolator : public QgsRasterInterface SIP_SKIP
55{
56 public:
58 QgsMeshLayerInterpolator( const QgsTriangularMesh &m,
59 const QVector<double> &datasetValues,
60 const QgsMeshDataBlock &activeFaceFlagValues,
62 const QgsRenderContext &context,
63 const QSize &size );
64 ~QgsMeshLayerInterpolator() override;
65
66 QgsRasterInterface *clone() const override;
67 Qgis::DataType dataType( int ) const override;
68 int bandCount() const override;
69 QgsRasterBlock *block( int, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override;
70
71 void setSpatialIndexActive( bool active );
72
73 void setElevationMapSettings( bool renderElevationMap, double elevationScale, double elevationOffset );
74
75 private:
76 const QgsTriangularMesh &mTriangularMesh;
77 const QVector<double> &mDatasetValues;
78 const QgsMeshDataBlock &mActiveFaceFlagValues;
79 const QgsRenderContext &mContext;
81 QSize mOutputSize;
82 bool mSpatialIndexActive = false;
83
84 bool mRenderElevation = false;
85 double mElevationScale = 1.0;
86 double mElevationOffset = 0.0;
87};
88
90
91namespace QgsMeshUtils
92{
93
112 const QgsMeshLayer &layer,
113 const QgsMeshDatasetIndex &datasetIndex,
114 const QgsCoordinateReferenceSystem &destinationCrs,
115 const QgsCoordinateTransformContext &transformContext,
116 double mapUnitsPerPixel,
117 const QgsRectangle &extent,
118 QgsRasterBlockFeedback *feedback = nullptr
119 ) SIP_FACTORY;
120
121
138 const QgsTriangularMesh &triangularMesh,
139 const QgsMeshDataBlock &datasetValues,
140 const QgsMeshDataBlock &activeFlags,
142 const QgsCoordinateTransform &transform,
143 double mapUnitsPerPixel,
144 const QgsRectangle &extent,
145 QgsRasterBlockFeedback *feedback = nullptr
146 ) SIP_SKIP;
147};
148
149#endif // QGSMESHLAYERINTERPOLATOR_H
DataType
Raster data types.
Definition qgis.h:269
This class represents a coordinate reference system (CRS).
Contains information about the context in which a coordinate transform is executed.
Class for doing transforms between two map coordinate systems.
QgsMeshDataBlock is a block of integers/doubles that can be used to retrieve: active flags (e....
DataType
Location of where data is specified for datasets in the dataset group.
@ DataOnVertices
Data is defined on vertices.
QgsMeshDatasetIndex is index that identifies the dataset group (e.g.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
Feedback object tailored for raster block reading.
Raster data container.
Base class for processing filters like renderers, reprojector, resampler etc.
virtual QgsRasterInterface * clone() const =0
Clone itself, create deep copy.
virtual QgsRasterBlock * block(int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback=nullptr)=0
Read block of data using given extent and size.
virtual Qgis::DataType dataType(int bandNo) const =0
Returns data type for the band specified by number.
virtual int bandCount() const =0
Gets number of bands.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
Abstract base class for all rendered symbols.
Definition qgssymbol.h:94
Triangular/Derived Mesh is mesh with vertices in map coordinates.
CORE_EXPORT QgsRasterBlock * exportRasterBlock(const QgsMeshLayer &layer, const QgsMeshDatasetIndex &datasetIndex, const QgsCoordinateReferenceSystem &destinationCrs, const QgsCoordinateTransformContext &transformContext, double mapUnitsPerPixel, const QgsRectangle &extent, QgsRasterBlockFeedback *feedback=nullptr)
Exports mesh layer's dataset values as raster block.
#define SIP_SKIP
Definition qgis_sip.h:126
#define SIP_FACTORY
Definition qgis_sip.h:76