QGIS API Documentation 3.39.0-Master (3aed037ce22)
Loading...
Searching...
No Matches
qgsmeshadvancedediting.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmeshadvancedediting.h - QgsMeshAdvancedEditing
3
4 ---------------------
5 begin : 9.7.2021
6 copyright : (C) 2021 by Vincent Cloarec
7 email : vcloarec at gmail dot com
8 ***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16#ifndef QGSMESHADVANCEDEDITING_H
17#define QGSMESHADVANCEDEDITING_H
18
19
20#include "qgis_core.h"
21#include "qgstopologicalmesh.h"
22#include "qgstriangularmesh.h"
23
24class QgsMeshEditor;
27
39{
40 public:
41
44
46 void setInputVertices( const QList<int> verticesIndexes );
47
49 void setInputFaces( const QList<int> faceIndexes );
50
52 QString message() const;
53
55 void clear();
56
61 virtual bool isFinished() const;
62
64 virtual QString text() const;
65
66 protected:
67 QList<int> mInputVertices;
68 QList<int> mInputFaces;
69 QString mMessage;
70 bool mIsFinished = false;
71
78
79 friend class QgsMeshEditor;
80};
81
95{
96 public:
97
99
100 QString text() const override;
101
102 private:
103 QgsTopologicalMesh::Changes apply( QgsMeshEditor *meshEditor ) override;
104
105 struct FaceRefinement
106 {
107 QList<int> newVerticesLocalIndex; // new vertices in the same order of the vertex index (ccw)
108 QList<bool> refinedFaceNeighbor;
109 QList<bool> borderFaceNeighbor;
110 int newCenterVertexIndex;
111 QList<int> newFacesChangesIndex;
112 };
113
114 struct BorderFace
115 {
116 QList<bool> refinedFacesNeighbor;
117 QList<bool> borderFacesNeighbor;
118 QList<bool> unchangeFacesNeighbor;
119 QList<int> newVerticesLocalIndex;
120 QList<int> edgeFace; //global index of the dirst face exposed on edge
121 };
122
124 void createNewVerticesAndRefinedFaces( QgsMeshEditor *meshEditor,
125 QSet<int> &facesToRefine,
126 QHash<int, FaceRefinement> &facesRefinement );
127
128 bool createNewBorderFaces( QgsMeshEditor *meshEditor,
129 const QSet<int> &facesToRefine,
130 QHash<int, FaceRefinement> &facesRefinement,
131 QHash<int, BorderFace> &borderFaces );
132
133 friend class TestQgsMeshEditor;
134};
135
136
160{
161 public:
162
164
165 QString text() const override;
166
172 void setExpressions( const QString &expressionX, const QString &expressionY, const QString &expressionZ );
173
181 bool calculate( QgsMeshLayer *layer );
182
188 QgsMeshVertex transformedVertex( QgsMeshLayer *layer, int vertexIndex ) const;
189
190 private:
191 QString mExpressionX;
192 QString mExpressionY;
193 QString mExpressionZ;
194 QHash<int, int> mChangingVertexMap;
195
196 QgsTopologicalMesh::Changes apply( QgsMeshEditor *meshEditor ) override;
197
198 friend class TestQgsMeshEditor;
199};
200
201#endif // QGSMESHADVANCEDEDITING_H
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Abstract class that can be derived to implement advanced editing on mesh.
virtual QgsTopologicalMesh::Changes apply(QgsMeshEditor *meshEditor)=0
Apply a change to mesh Editor.
virtual ~QgsMeshAdvancedEditing()
Class that can do a refinement of faces of a mesh.
Class that makes edit operation on a mesh.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
Class that can transform vertices of a mesh by expression.
Point geometry type, with support for z-dimension and m-values.
Definition qgspoint.h:49
Base class for providing feedback from a processing algorithm.
Class that contains topological differences between two states of a topological mesh,...
#define SIP_SKIP
Definition qgis_sip.h:126
#define SIP_ABSTRACT
Definition qgis_sip.h:213