QGIS API Documentation  3.2.0-Bonn (bc43194)
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  bool dataIsOnVertices,
53  const QgsRenderContext &context,
54  const QSize &size );
55  ~QgsMeshLayerInterpolator() override;
56 
57  QgsRasterInterface *clone() const override;
58  Qgis::DataType dataType( int ) const override;
59  int bandCount() const override;
60  QgsRasterBlock *block( int, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override;
61 
62  private:
63  const QgsTriangularMesh &mTriangularMesh;
64  const QVector<double> &mDatasetValues;
65  const QgsRenderContext &mContext;
66  bool mDataOnVertices = true;
67  QSize mOutputSize;
68 };
69 
71 
72 #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.
DataType
Raster data types.
Definition: qgis.h:91
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:90
Feedback object tailored for raster block reading.