Class: QgsMeshTriangulation¶
- class qgis.analysis.QgsMeshTriangulation¶
Bases:
PyQt5.QtCore.QObject
Class that handles mesh creation with Delaunay constrained triangulation
New in version 3.16.
QgsMeshTriangulation() Constructor
Methods
Adds break lines from a vector layer, return
True
if successful.Adds a new vertex in the triangulation and returns the index of the new vertex
Adds vertices to the triangulation from a feature iterator, return
True
if successful.Sets the coordinate reference system used for the triangulation
Returns the triangulated mesh
- addBreakLines(self, lineFeatureIterator: QgsFeatureIterator, valueAttribute: int, transformContext: QgsCoordinateTransform, feedback: QgsFeedback = None, featureCount: int = 1) bool ¶
Adds break lines from a vector layer, return
True
if successful.- Parameters
lineFeatureIterator (QgsFeatureIterator) – the feature iterator of break lines to insert
valueAttribute (int) – the index of the attribute that represents the value of vertices, if -1 uses Z coordinate of vertices
transformContext (QgsCoordinateTransform) – the coordinates transform context used to transform coordinates
feedback (
QgsFeedback
= None) – feedback argument may be specified to allow cancellation and progress reportsfeatureCount (int = 1) – the count of feature to allow progress report of the feedback
Warning
if the feature iterator contains only point geometries, the vertices will be added only without treating them as breaklines
- Return type
bool
- addVertex(self, vertex: QgsPoint) int ¶
Adds a new vertex in the triangulation and returns the index of the new vertex
New in version 3.22.
- Parameters
vertex (QgsPoint) –
- Return type
int
- addVertices(self, vertexFeatureIterator: QgsFeatureIterator, valueAttribute: int, transform: QgsCoordinateTransform, feedback: QgsFeedback = None, featureCount: int = 1) bool ¶
Adds vertices to the triangulation from a feature iterator, return
True
if successful.- Parameters
vertexFeatureIterator (QgsFeatureIterator) – the feature iterator of vertices to insert
valueAttribute (int) – the index of the attribute that represents the value of vertices, if -1 uses Z coordinate of vertices
transform (QgsCoordinateTransform) – the coordinates transform used to transform coordinates
feedback (
QgsFeedback
= None) – feedback argument may be specified to allow cancellation and progress reportsfeatureCount (int = 1) – the count of feature to allow progress report of the feedback
- Return type
bool
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- customEvent(self, QEvent)¶
- disconnectNotify(self, QMetaMethod)¶
- isSignalConnected(self, QMetaMethod) bool ¶
- receivers(self, PYQT_SIGNAL) int ¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setCrs(self, crs: QgsCoordinateReferenceSystem)¶
Sets the coordinate reference system used for the triangulation
- Parameters
crs (QgsCoordinateReferenceSystem) –
- timerEvent(self, QTimerEvent)¶
- triangulatedMesh(self, feedback: QgsFeedback = None) QgsMesh ¶
Returns the triangulated mesh
- Parameters
feedback (
QgsFeedback
= None) –- Return type