QGIS API Documentation  3.4.15-Madeira (e83d02e274)
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 
29 
30 #include <QVector>
31 #include <QSize>
32 
34 
42 class CORE_EXPORT QgsMeshLayerUtils
43 {
44  public:
45 
50  static void calculateMinimumMaximum( double &min, double &max, const QVector<double> &arr );
51 
56  static void calculateMinMaxForDatasetGroup( double &min, double &max, QgsMeshDataProvider *provider, int groupIndex );
57 
62  static void calculateMinMaxForDataset( double &min, double &max, QgsMeshDataProvider *provider, QgsMeshDatasetIndex index );
63 
74  static void boundingBoxToScreenRectangle(
75  const QgsMapToPixel &mtp,
76  const QSize &outputSize,
77  const QgsRectangle &bbox,
78  int &leftLim, int &rightLim, int &topLim, int &bottomLim );
79 
91  static double interpolateFromVerticesData(
92  const QgsPointXY &p1, const QgsPointXY &p2, const QgsPointXY &p3,
93  double val1, double val2, double val3, const QgsPointXY &pt
94  );
95 
105  static double interpolateFromFacesData(
106  const QgsPointXY &p1, const QgsPointXY &p2, const QgsPointXY &p3,
107  double val, const QgsPointXY &pt );
108 
116  static QgsRectangle triangleBoundingBox( const QgsPointXY &p1, const QgsPointXY &p2, const QgsPointXY &p3 );
117 };
118 
120 
121 #endif // QGSMESHLAYERUTILS_H
A rectangle specified with double values.
Definition: qgsrectangle.h:40
A class to represent a 2D point.
Definition: qgspointxy.h:43
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:36
Base class for providing data for QgsMeshLayer.
QgsMeshDatasetIndex is index that identifies the dataset group (e.g.