QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Class that can transform vertices of a mesh by expression. More...
#include <qgsmeshadvancedediting.h>
Public Member Functions | |
QgsMeshTransformVerticesByExpression ()=default | |
Constructor. More... | |
bool | calculate (QgsMeshLayer *layer) |
Calculates the transformed vertices of the mesh layer, returns false if this leads to topological or geometrical errors. More... | |
void | setExpressions (const QString &expressionX, const QString &expressionY, const QString &expressionZ) |
Sets the expressions for the coordinates transformation. More... | |
QString | text () const override |
Returns a short text string describing what this advanced edit does. Default implementation return a void string. More... | |
QgsMeshVertex | transformedVertex (QgsMeshLayer *layer, int vertexIndex) const |
Returns the transformed vertex from its index vertexIndex for the mesh layer. More... | |
Public Member Functions inherited from QgsMeshAdvancedEditing | |
QgsMeshAdvancedEditing () | |
Constructor. More... | |
virtual | ~QgsMeshAdvancedEditing () |
Destructor. More... | |
void | clear () |
Removes all data provided to the editing or created by the editing. More... | |
virtual bool | isFinished () const |
Returns whether the advanced edit is finished, if not, this edit has to be applied again with QgsMeshEditor::advancedEdit() until is finished returns true . More... | |
QString | message () const |
Returns a message that can be provided by the advanced editing when applying is done. More... | |
void | setInputFaces (const QList< int > faceIndexes) |
Sets the input faces indexes that will be used for the editing. More... | |
void | setInputVertices (const QList< int > verticesIndexes) |
Sets the input vertices indexes that will be used for the editing. More... | |
Public Member Functions inherited from QgsTopologicalMesh::Changes | |
QVector< QgsMeshFace > | addedFaces () const |
Returns the face that are added with this changes. More... | |
QVector< QgsMeshVertex > | addedVertices () const |
Returns the added vertices with this changes. More... | |
QList< int > | changedCoordinatesVerticesIndexes () const |
Returns the indexes of vertices that have changed coordinates. More... | |
bool | isEmpty () const |
Returns whether changes are empty, that there is nothing to change. More... | |
QList< int > | nativeFacesIndexesGeometryChanged () const |
Returns a list of the native face indexes that have a geometry changed. More... | |
QList< QgsPointXY > | newVerticesXYValues () const |
Returns the new (X,Y) values of vertices that have changed their coordinates. More... | |
QList< double > | newVerticesZValues () const |
Returns the new Z values of vertices that have changed their coordinates. More... | |
QList< QgsPointXY > | oldVerticesXYValues () const |
Returns the old (X,Y) values of vertices that have changed their coordinates. More... | |
QList< int > | removedFaceIndexes () const |
Returns the indexes of the faces that are removed with this changes. More... | |
QVector< QgsMeshFace > | removedFaces () const |
Returns the faces that are removed with this changes. More... | |
QList< int > | verticesToRemoveIndexes () const |
Returns the indexes of vertices to remove. More... | |
Friends | |
class | TestQgsMeshEditor |
Class that can transform vertices of a mesh by expression.
Each coordinates are associated with an expression that can be defined with function returning the current coordinates (see setExpressions()):
Example: Transposing a mesh and translate following axe X with a distance of 50 and increase the level of the mesh with an height of 80 when previous X coordinate is under 100 and de crease the level of 150 when X is under 100:
expressionX: "$vertex_y + 50" expressionY: "$vertex_x" expressionZ: "if( $vertex_x <= 100 , $vertex_z + 80 , $vertex_z - 150)"
Definition at line 162 of file qgsmeshadvancedediting.h.
|
default |
Constructor.
bool QgsMeshTransformVerticesByExpression::calculate | ( | QgsMeshLayer * | layer | ) |
Calculates the transformed vertices of the mesh layer, returns false
if this leads to topological or geometrical errors.
The mesh layer must be in edit mode.
Definition at line 617 of file qgsmeshadvancedediting.cpp.
void QgsMeshTransformVerticesByExpression::setExpressions | ( | const QString & | expressionX, |
const QString & | expressionY, | ||
const QString & | expressionZ | ||
) |
Sets the expressions for the coordinates transformation.
Definition at line 757 of file qgsmeshadvancedediting.cpp.
|
overridevirtual |
Returns a short text string describing what this advanced edit does. Default implementation return a void string.
Reimplemented from QgsMeshAdvancedEditing.
Definition at line 752 of file qgsmeshadvancedediting.cpp.
QgsMeshVertex QgsMeshTransformVerticesByExpression::transformedVertex | ( | QgsMeshLayer * | layer, |
int | vertexIndex | ||
) | const |
Returns the transformed vertex from its index vertexIndex for the mesh layer.
If layer is not the same than the one used to make the calculation, this will create an undefined behavior
Definition at line 773 of file qgsmeshadvancedediting.cpp.
|
friend |
Definition at line 202 of file qgsmeshadvancedediting.h.