QGIS API Documentation 3.43.0-Master (c67cf405802)
qgsmeshutils.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmeshutils.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 QGSMESHUTILS_H
19#define QGSMESHUTILS_H
20
21#include "qgis.h"
22#include "qgis_sip.h"
23#include "qgsmeshdataset.h"
24#include "qgspoint.h"
25
26class QgsRasterBlock;
27class QgsMeshLayer;
32class QgsRectangle;
36class QgsPointXY;
37class QgsGeometry;
38class QgsPolygon;
39
42
44typedef QVector<int> QgsMeshFace;
45
51typedef QPair<int, int> QgsMeshEdge;
52
53
59class CORE_EXPORT QgsMeshUtils
60{
61 public:
62
80 static QgsRasterBlock *exportRasterBlock(
81 const QgsMeshLayer &layer,
82 const QgsMeshDatasetIndex &datasetIndex,
83 const QgsCoordinateReferenceSystem &destinationCrs,
84 const QgsCoordinateTransformContext &transformContext,
85 double mapUnitsPerPixel,
86 const QgsRectangle &extent,
87 QgsRasterBlockFeedback *feedback = nullptr
89
90
106 static QgsRasterBlock *exportRasterBlock(
107 const QgsTriangularMesh &triangularMesh,
108 const QgsMeshDataBlock &datasetValues,
109 const QgsMeshDataBlock &activeFlags,
111 const QgsCoordinateTransform &transform,
112 double mapUnitsPerPixel,
113 const QgsRectangle &extent,
114 QgsRasterBlockFeedback *feedback = nullptr
115 ) SIP_SKIP;
116
121 SIP_SKIP static QgsGeometry toGeometry( const QgsMeshFace &face, const QVector<QgsMeshVertex> &vertices );
122
127 SIP_SKIP static QgsMeshVertex centroid( const QgsMeshFace &face, const QVector<QgsMeshVertex> &vertices );
128
133 SIP_SKIP static std::unique_ptr< QgsPolygon > toPolygon( const QgsMeshFace &face, const QVector<QgsMeshVertex> &vertices );
134
140 SIP_SKIP static QSet<int> nativeFacesFromTriangles( const QList<int> &triangleIndexes, const QVector<int> &trianglesToNativeFaces );
141
147 SIP_SKIP static QSet<int> nativeEdgesFromEdges( const QList<int> &edgesIndexes, const QVector<int> &edgesToNativeEdges );
148
154 SIP_SKIP static QSet<int> nativeVerticesFromTriangles( const QList<int> &triangleIndexes, const QVector<QgsMeshFace> &triangles );
155
161 SIP_SKIP static QSet<int> nativeVerticesFromEdges( const QList<int> &edgesIndexes, const QVector<QgsMeshEdge> &edges );
162
168 SIP_SKIP static bool isInTriangleFace( const QgsPointXY point, const QgsMeshFace &face, const QVector<QgsMeshVertex> &vertices );
169
175 SIP_SKIP static void setCounterClockwise( QgsMeshFace &triangle, const QgsMeshVertex &v0, const QgsMeshVertex &v1, const QgsMeshVertex &v2 );
176
177};
178
179#endif // QGSMESHUTILS_H
Represents a coordinate reference system (CRS).
Contains information about the context in which a coordinate transform is executed.
Handles coordinate transforms between two coordinate systems.
A geometry is the spatial representation of a feature.
A block of integers/doubles from a mesh dataset.
DataType
Location of where data is specified for datasets in the dataset group.
An index that identifies the dataset group (e.g.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
Provides utility functions for working with mesh data.
Represents a 2D point.
Definition qgspointxy.h:60
Point geometry type, with support for z-dimension and m-values.
Definition qgspoint.h:49
Polygon geometry type.
Definition qgspolygon.h:33
Feedback object tailored for raster block reading.
Raster data container.
A rectangle specified with double values.
A triangular/derived mesh with vertices in map coordinates.
#define SIP_SKIP
Definition qgis_sip.h:126
#define SIP_FACTORY
Definition qgis_sip.h:76
QVector< int > QgsMeshFace
List of vertex indexes.
QPair< int, int > QgsMeshEdge
Edge is a straight line seqment between 2 points.
QgsPoint QgsMeshVertex
xyz coords of vertex