QGIS API Documentation  3.6.0-Noosa (5873452)
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;
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 
37 class QgsRenderContext;
38 
39 #ifdef SIP_RUN
40 % ModuleHeaderCode
42 % End
43 #endif
44 
46 
54 class QgsMeshLayerInterpolator : public QgsRasterInterface SIP_SKIP
55 {
56  public:
58  QgsMeshLayerInterpolator( const QgsTriangularMesh &m,
59  const QVector<double> &datasetValues,
60  const QgsMeshDataBlock &activeFaceFlagValues,
61  bool dataIsOnVertices,
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  private:
72  const QgsTriangularMesh &mTriangularMesh;
73  const QVector<double> &mDatasetValues;
74  const QgsMeshDataBlock &mActiveFaceFlagValues;
75  const QgsRenderContext &mContext;
76  bool mDataOnVertices = true;
77  QSize mOutputSize;
78 };
79 
81 
82 namespace QgsMeshUtils
83 {
84 
102  CORE_EXPORT QgsRasterBlock *exportRasterBlock(
103  const QgsMeshLayer &layer,
104  const QgsMeshDatasetIndex &datasetIndex,
105  const QgsCoordinateReferenceSystem &destinationCrs,
106  const QgsCoordinateTransformContext &transformContext,
107  double mapUnitsPerPixel,
108  const QgsRectangle &extent,
109  QgsRasterBlockFeedback *feedback = nullptr
110  ) SIP_FACTORY;
111 };
112 
113 #endif // QGSMESHLAYERINTERPOLATOR_H
virtual int bandCount() const =0
Gets number of bands.
A rectangle specified with double values.
Definition: qgsrectangle.h:41
Triangular/Derived Mesh is mesh with vertices in map coordinates.
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:61
QgsMeshDataBlock is a block of integers/doubles that can be used to retrieve: active flags (e...
DataType
Raster data types.
Definition: qgis.h:79
virtual Qgis::DataType dataType(int bandNo) const =0
Returns data type for the band specified by number.
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&#39;s dataset values as raster block.
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.
#define SIP_SKIP
Definition: qgis_sip.h:119
#define SIP_FACTORY
Definition: qgis_sip.h:69
Contains information about the context in which a coordinate transform is executed.
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.
This class represents a coordinate reference system (CRS).
QgsMeshDatasetIndex is index that identifies the dataset group (e.g.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
Definition: qgsmeshlayer.h:89
Feedback object tailored for raster block reading.