QGIS API Documentation  3.6.0-Noosa (5873452)
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"
27 
28 #include <QVector>
29 #include <QSize>
30 
32 
40 class CORE_EXPORT QgsMeshLayerUtils
41 {
42  public:
43 
49  static QVector<double> calculateMagnitudes( const QgsMeshDataBlock &block );
50 
61  static void boundingBoxToScreenRectangle(
62  const QgsMapToPixel &mtp,
63  const QSize &outputSize,
64  const QgsRectangle &bbox,
65  int &leftLim, int &rightLim, int &topLim, int &bottomLim );
66 
78  static double interpolateFromVerticesData(
79  const QgsPointXY &p1, const QgsPointXY &p2, const QgsPointXY &p3,
80  double val1, double val2, double val3, const QgsPointXY &pt
81  );
82 
92  static double interpolateFromFacesData(
93  const QgsPointXY &p1, const QgsPointXY &p2, const QgsPointXY &p3,
94  double val, const QgsPointXY &pt );
95 
103  static QgsRectangle triangleBoundingBox( const QgsPointXY &p1, const QgsPointXY &p2, const QgsPointXY &p3 );
104 };
105 
107 
108 #endif // QGSMESHLAYERUTILS_H
A rectangle specified with double values.
Definition: qgsrectangle.h:41
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