QGIS API Documentation  3.12.1-BucureČ™ti (121cc00ff0)
qgsmeshlayerutils.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmeshlayerutils.h
3  --------------------------
4  begin : August 2018
5  copyright : (C) 2018 by Martin Dobias
6  email : wonder dot sk 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 QGSMESHLAYERUTILS_H
19 #define QGSMESHLAYERUTILS_H
20 
21 #define SIP_NO_FILE
22 
23 #include "qgis_core.h"
24 #include "qgsrectangle.h"
25 #include "qgsmaptopixel.h"
26 #include "qgsmeshdataprovider.h"
28 
29 #include <QVector>
30 #include <QSize>
31 
33 
35 class QgsTriangularMesh;
36 class QgsMeshDataBlock;
39 class QgsMeshLayer;
40 
48 class CORE_EXPORT QgsMeshLayerUtils
49 {
50  public:
51 
64  static QgsMeshDataBlock datasetValues(
65  const QgsMeshLayer *meshLayer,
66  QgsMeshDatasetIndex index,
67  int valueIndex,
68  int count );
69 
75  static QVector<double> calculateMagnitudes( const QgsMeshDataBlock &block );
76 
87  static void boundingBoxToScreenRectangle(
88  const QgsMapToPixel &mtp,
89  const QSize &outputSize,
90  const QgsRectangle &bbox,
91  int &leftLim, int &rightLim, int &topLim, int &bottomLim );
92 
104  static double interpolateFromVerticesData(
105  const QgsPointXY &p1, const QgsPointXY &p2, const QgsPointXY &p3,
106  double val1, double val2, double val3, const QgsPointXY &pt
107  );
108 
122  static QgsVector interpolateVectorFromVerticesData(
123  const QgsPointXY &p1, const QgsPointXY &p2, const QgsPointXY &p3,
124  QgsVector vect1, QgsVector vect2, QgsVector vect3, const QgsPointXY &pt
125  );
126 
136  static double interpolateFromFacesData(
137  const QgsPointXY &p1, const QgsPointXY &p2, const QgsPointXY &p3,
138  double val, const QgsPointXY &pt );
139 
151  static QgsVector interpolateVectorFromFacesData(
152  const QgsPointXY &p1, const QgsPointXY &p2, const QgsPointXY &p3,
153  QgsVector vect, const QgsPointXY &pt );
154 
160  static QVector<double> interpolateFromFacesData(
161  QVector<double> valuesOnFaces,
162  const QgsMesh *nativeMesh,
163  const QgsTriangularMesh *triangularMesh,
164  QgsMeshDataBlock *active,
166  );
167 
175  static QgsRectangle triangleBoundingBox( const QgsPointXY &p1, const QgsPointXY &p2, const QgsPointXY &p3 );
176 
180  static QString formatTime( double hours, const QgsMeshTimeSettings &settings );
181 
188  static QDateTime firstReferenceTime( QgsMeshLayer *meshLayer );
189 
190 };
191 
193 
194 #endif // QGSMESHLAYERUTILS_H
A rectangle specified with double values.
Definition: qgsrectangle.h:41
Triangular/Derived Mesh is mesh with vertices in map coordinates.
A class to represent a 2D point.
Definition: qgspointxy.h:43
QgsMeshDataBlock is a block of integers/doubles that can be used to retrieve: active flags (e...
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:37
DataInterpolationMethod
Interpolation of value defined on vertices from datasets with data defined on faces.
Represents a mesh time settings for mesh datasets.
A class to represent a vector.
Definition: qgsvector.h:29
Mesh - vertices and faces.
QgsMeshDatasetIndex is index that identifies the dataset group (e.g.
Abstract class to interpolate 3d stacked mesh data to 2d data.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
Definition: qgsmeshlayer.h:91
QgsMeshDatasetValue represents single dataset value.