QGIS API Documentation  3.4.15-Madeira (e83d02e274)
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 
21 class QgsMeshLayer;
22 class QgsSymbol;
23 
24 #define SIP_NO_FILE
25 
26 #include <QSize>
27 
28 #include "qgis.h"
29 
30 #include "qgsmaplayerrenderer.h"
31 #include "qgsrendercontext.h"
32 #include "qgstriangularmesh.h"
33 #include "qgsrasterinterface.h"
35 #include "qgsrastershader.h"
36 
38 
46 class QgsMeshLayerInterpolator : public QgsRasterInterface
47 {
48  public:
50  QgsMeshLayerInterpolator( const QgsTriangularMesh &m,
51  const QVector<double> &datasetValues,
52  const QVector<bool> &activeFaceFlagValues,
53  bool dataIsOnVertices,
54  const QgsRenderContext &context,
55  const QSize &size );
56  ~QgsMeshLayerInterpolator() override;
57 
58  QgsRasterInterface *clone() const override;
59  Qgis::DataType dataType( int ) const override;
60  int bandCount() const override;
61  QgsRasterBlock *block( int, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override;
62 
63  private:
64  const QgsTriangularMesh &mTriangularMesh;
65  const QVector<double> &mDatasetValues;
66  const QVector<bool> &mActiveFaceFlagValues;
67  const QgsRenderContext &mContext;
68  bool mDataOnVertices = true;
69  QSize mOutputSize;
70 };
71 
73 
74 #endif // QGSMESHLAYERINTERPOLATOR_H
virtual int bandCount() const =0
Gets number of bands.
A rectangle specified with double values.
Definition: qgsrectangle.h:40
Triangular/Derived Mesh is mesh with vertices in map coordinates.
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:61
DataType
Raster data types.
Definition: qgis.h:92
virtual Qgis::DataType dataType(int bandNo) const =0
Returns data type for the band specified by number.
Raster data container.
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.
Base class for processing filters like renderers, reprojector, resampler etc.
Contains information about the context of a rendering operation.
virtual QgsRasterInterface * clone() const =0
Clone itself, create deep copy.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
Definition: qgsmeshlayer.h:89
Feedback object tailored for raster block reading.