18#ifndef QGSTRIANGULARMESH_H
19#define QGSTRIANGULARMESH_H
76 bool update(
QgsMesh *nativeMesh );
84 const QVector<QgsMeshVertex> &vertices()
const ;
87 const QVector<QgsMeshFace> &triangles()
const ;
90 const QVector<QgsMeshEdge> &edges()
const ;
97 Q_DECL_DEPRECATED
const QVector<QgsMeshVertex> ¢roids()
const ;
103 const QVector<QgsMeshVertex> &faceCentroids()
const ;
109 const QVector<QgsMeshVertex> &edgeCentroids()
const ;
112 const QVector<int> &trianglesToNativeFaces()
const ;
115 const QVector<int> &edgesToNativeEdges()
const ;
136 int faceIndexForPoint(
const QgsPointXY &point )
const ;
147 int faceIndexForPoint_v2(
const QgsPointXY &point )
const;
158 int nativeFaceIndexForPoint(
const QgsPointXY &point )
const ;
169 QList<int> nativeFaceIndexForRectangle(
const QgsRectangle &rectangle )
const ;
180 QList<int> faceIndexesForRectangle(
const QgsRectangle &rectangle )
const ;
189 QList<int> edgeIndexesForRectangle(
const QgsRectangle &rectangle )
const ;
199 QVector<QVector3D> vertexNormals(
float vertScale )
const;
216 QVector<QgsTriangularMesh *> simplifyMesh(
double reductionFactor,
int minimumTrianglesCount = 10 )
const;
224 double averageTriangleSize()
const;
236 int levelOfDetail()
const;
276 QVector<QgsMeshVertex> mAddedVertices;
277 QList<int> mVerticesIndexesToRemove;
278 QList<int> mChangedVerticesCoordinates;
279 mutable QList<double> mOldZValue;
280 QList<double> mNewZValue;
281 QList<QgsPointXY> mOldXYValue;
282 QList<QgsPointXY> mNewXYValue;
284 QVector<QgsMeshFace> mNativeFacesToAdd;
285 QList<int> mNativeFaceIndexesToRemove;
286 QVector<QgsMeshFace> mNativeFacesToRemove;
287 QList<int> mNativeFaceIndexesGeometryChanged;
288 QVector<QgsMeshFace> mNativeFacesGeometryChanged;
289 mutable QList<int> mTriangleIndexesGeometryChanged;
291 mutable int mTrianglesAddedStartIndex = 0;
292 mutable QList<int> mRemovedTriangleIndexes;
302 void applyChanges(
const Changes &changes );
309 void reverseChanges(
const Changes &changes,
const QgsMesh &nativeMesh );
347 void triangulate(
const QgsMeshFace &face,
int nativeIndex );
357 void finalizeTriangles();
362 QVector<int> mTrianglesToNativeFaces;
363 QVector<int> mEdgesToNativeEdges;
366 QVector<QgsMeshVertex> mNativeMeshFaceCentroids;
369 QVector<QgsMeshVertex> mNativeMeshEdgeCentroids;
376 mutable bool mIsExtentValid =
false;
379 double mAverageTriangleSize = 0;
384 friend class TestQgsTriangularMesh;
396 CORE_EXPORT std::unique_ptr< QgsPolygon > toPolygon(
const QgsMeshFace &face,
const QVector<QgsMeshVertex> &vertices );
402 CORE_EXPORT QSet<int> nativeFacesFromTriangles(
const QList<int> &triangleIndexes,
const QVector<int> &trianglesToNativeFaces );
408 CORE_EXPORT QSet<int> nativeEdgesFromEdges(
const QList<int> &edgesIndexes,
const QVector<int> &edgesToNativeEdges );
414 CORE_EXPORT QSet<int> nativeVerticesFromTriangles(
const QList<int> &triangleIndexes,
const QVector<QgsMeshFace> &triangles );
420 CORE_EXPORT QSet<int> nativeVerticesFromEdges(
const QList<int> &edgesIndexes,
const QVector<QgsMeshEdge> &edges );
426 bool isInTriangleFace(
const QgsPointXY point,
const QgsMeshFace &face,
const QVector<QgsMeshVertex> &vertices );
TransformDirection
Indicates the direction (forward or inverse) of a transform.
A geometry is the spatial representation of a feature.
A spatial index for QgsMeshFace or QgsMeshEdge objects.
A class to represent a 2D point.
Point geometry type, with support for z-dimension and m-values.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
Class that contains topological differences between two states of a topological mesh,...
The Changes class is used to make changes of the triangular and to keep traces of this changes If a C...
Changes()=default
Default constructor, no changes.
Triangular/Derived Mesh is mesh with vertices in map coordinates.
QVector< int > QgsMeshFace
List of vertex indexes.
Mesh - vertices, edges and faces.
ElementType
Defines type of mesh elements.