QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
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 
34 
42 class CORE_EXPORT QgsMeshLayerUtils
43 {
44  public:
45 
51  static QVector<double> calculateMagnitudes( const QgsMeshDataBlock &block );
52 
63  static void boundingBoxToScreenRectangle(
64  const QgsMapToPixel &mtp,
65  const QSize &outputSize,
66  const QgsRectangle &bbox,
67  int &leftLim, int &rightLim, int &topLim, int &bottomLim );
68 
80  static double interpolateFromVerticesData(
81  const QgsPointXY &p1, const QgsPointXY &p2, const QgsPointXY &p3,
82  double val1, double val2, double val3, const QgsPointXY &pt
83  );
84 
94  static double interpolateFromFacesData(
95  const QgsPointXY &p1, const QgsPointXY &p2, const QgsPointXY &p3,
96  double val, const QgsPointXY &pt );
97 
105  static QgsRectangle triangleBoundingBox( const QgsPointXY &p1, const QgsPointXY &p2, const QgsPointXY &p3 );
106 
110  static QString formatTime( double hours, const QgsMeshTimeSettings &settings );
111 };
112 
114 
115 #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
Represents a mesh time settings for mesh datasets.