18 #ifndef QGSTRIANGULARMESH_H
19 #define QGSTRIANGULARMESH_H
29 #include "qgis_core.h"
71 const QVector<QgsMeshVertex> &vertices()
const ;
74 const QVector<QgsMeshFace> &triangles()
const ;
77 const QVector<QgsMeshEdge> &edges()
const ;
84 Q_DECL_DEPRECATED
const QVector<QgsMeshVertex> ¢roids()
const ;
90 const QVector<QgsMeshVertex> &faceCentroids()
const ;
96 const QVector<QgsMeshVertex> &edgeCentroids()
const ;
99 const QVector<int> &trianglesToNativeFaces()
const ;
102 const QVector<int> &edgesToNativeEdges()
const ;
113 int faceIndexForPoint(
const QgsPointXY &point )
const ;
124 int faceIndexForPoint_v2(
const QgsPointXY &point )
const;
135 QList<int> faceIndexesForRectangle(
const QgsRectangle &rectangle )
const ;
144 QList<int> edgeIndexesForRectangle(
const QgsRectangle &rectangle )
const ;
154 QVector<QVector3D> vertexNormals(
float vertScale )
const;
171 QVector<QgsTriangularMesh *> simplifyMesh(
double reductionFactor,
int minimumTrianglesCount = 10 )
const;
179 double averageTriangleSize()
const;
191 int levelOfDetail()
const;
220 void triangulate(
const QgsMeshFace &face,
int nativeIndex );
223 void finalizeTriangles();
228 QVector<int> mTrianglesToNativeFaces;
229 QVector<int> mEdgesToNativeEdges;
232 QVector<QgsMeshVertex> mNativeMeshFaceCentroids;
235 QVector<QgsMeshVertex> mNativeMeshEdgeCentroids;
244 double mAverageTriangleSize = 0;
249 friend class TestQgsTriangularMesh;
258 CORE_EXPORT std::unique_ptr< QgsPolygon >
toPolygon(
const QgsMeshFace &face,
const QVector<QgsMeshVertex> &vertices );
264 CORE_EXPORT QSet<int>
nativeFacesFromTriangles(
const QList<int> &triangleIndexes,
const QVector<int> &trianglesToNativeFaces );
270 CORE_EXPORT QSet<int>
nativeEdgesFromEdges(
const QList<int> &edgesIndexes,
const QVector<int> &edgesToNativeEdges );
282 CORE_EXPORT QSet<int>
nativeVerticesFromEdges(
const QList<int> &edgesIndexes,
const QVector<QgsMeshEdge> &edges );
292 #endif // QGSTRIANGULARMESH_H