File: qgstopologicalmesh.sip.in

package info (click to toggle)
qgis 3.40.11%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,183,800 kB
  • sloc: cpp: 1,595,841; python: 372,637; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 154
file content (360 lines) | stat: -rw-r--r-- 10,295 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/mesh/qgstopologicalmesh.h                                   *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/





class QgsTopologicalMesh
{
%Docstring(signature="appended")
Class that wraps a :py:class:`QgsMesh` to ensure the consistency of the
mesh during editing and help to access to elements from other elements

A topological face must:

- be convex
- be oriented counter-clockwise
- not share a unique vertex with another face

.. versionadded:: 3.22
%End

%TypeHeaderCode
#include "qgstopologicalmesh.h"
%End
  public:

    typedef QVector<int> FaceNeighbors;

    class TopologicalFaces
{
%Docstring(signature="appended")
Class that contains independent faces an topological information about
this faces

This class supports unique shared vertices between faces.

.. versionadded:: 3.22
%End

%TypeHeaderCode
#include "qgstopologicalmesh.h"
%End
      public:


        void clear();
%Docstring
Clears all data contained in the instance.
%End


        int vertexToFace( int vertexIndex ) const;
%Docstring
Returns a face linked to the vertices with index ``vertexIndex``
%End

    };


    class Changes
{
%Docstring(signature="appended")
Class that contains topological differences between two states of a
topological mesh, only accessible from the QgsTopologicalMesh class

.. versionadded:: 3.22
%End

%TypeHeaderCode
#include "qgstopologicalmesh.h"
%End
      public:



        QList<int> removedFaceIndexes() const;
%Docstring
Returns the indexes of the faces that are removed with this changes
%End

        QVector<QgsPoint> addedVertices() const;
%Docstring
Returns the added vertices with this changes
%End

        QList<int> verticesToRemoveIndexes() const;
%Docstring
Returns the indexes of vertices to remove
%End

        QList<int> changedCoordinatesVerticesIndexes() const;
%Docstring
Returns the indexes of vertices that have changed coordinates
%End

        QList<double> newVerticesZValues() const;
%Docstring
Returns the new Z values of vertices that have changed their coordinates
%End

        QList<QgsPointXY> newVerticesXYValues() const;
%Docstring
Returns the new (X,Y) values of vertices that have changed their
coordinates
%End

        QList<QgsPointXY> oldVerticesXYValues() const;
%Docstring
Returns the old (X,Y) values of vertices that have changed their
coordinates
%End

        QList<int> nativeFacesIndexesGeometryChanged() const;
%Docstring
Returns a list of the native face indexes that have a geometry changed
%End

        bool isEmpty() const;
%Docstring
Returns whether changes are empty, that there is nothing to change
%End

      protected:



        void clearChanges();
%Docstring
Clears all changes
%End

    };

    static QgsTopologicalMesh createTopologicalMesh( QgsMesh *mesh, int maxVerticesPerFace, QgsMeshEditingError &error );
%Docstring
Creates a topologicaly consistent mesh with ``mesh``, this static method
modifies ``mesh`` to be topological consistent and return a
QgsTopologicalMesh instance that contains and handles this mesh (does
not take ownership).
%End



    QVector<int> neighborsOfFace( int faceIndex ) const;
%Docstring
Returns the indexes of neighbor faces of the face with index
``faceIndex``
%End

    QList<int> facesAroundVertex( int vertexIndex ) const;
%Docstring
Returns the indexes of faces that are around the vertex with index
``vertexIndex``
%End

    QgsMesh *mesh() const;
%Docstring
Returns a pointer to the wrapped mesh
%End

    int firstFaceLinked( int vertexIndex ) const;
%Docstring
Returns the index of the first face linked, returns -1 if it is a free
vertex or out of range index
%End

    bool isVertexOnBoundary( int vertexIndex ) const;
%Docstring
Returns whether the vertex is on a boundary
%End

    bool isVertexFree( int vertexIndex ) const;
%Docstring
Returns whether the vertex is a free vertex
%End

    QList<int> freeVerticesIndexes() const;
%Docstring
Returns a list of vertices are not linked to any faces
%End



    QgsMeshEditingError facesCanBeAdded( const TopologicalFaces &topologicalFaces ) const;
%Docstring
Returns whether the faces can be added to the mesh
%End

    Changes addFaces( const TopologicalFaces &topologicFaces );
%Docstring
Adds faces ``topologicFaces`` to the topologic mesh. The method returns
a instance of the class QgsTopologicalMesh.Change that can be used to
reverse or reapply the operation.
%End

    QgsMeshEditingError facesCanBeRemoved( const QList<int> &facesIndexes );
%Docstring
Returns whether faces with index in ``faceIndexes`` can be removed The
method an error object with type :py:class:`QgsMeshEditingError`.NoError
if the faces can be removed, otherwise returns the corresponding error
%End

    Changes removeFaces( const QList<int> &facesIndexes );
%Docstring
Removes faces with index in ``faceIndexes``. The method returns a
instance of the class QgsTopologicalMesh.Change that can be used to
reverse or reapply the operation.
%End

    bool edgeCanBeFlipped( int vertexIndex1, int vertexIndex2 ) const;
%Docstring
Returns ``True`` if the edge can be flipped (only available for edge
shared by two faces with 3 vertices)
%End

    Changes flipEdge( int vertexIndex1, int vertexIndex2 );
%Docstring
Flips edge (``vertexIndex1``, ``vertexIndex2``) The method returns a
instance of the class QgsTopologicalMesh.Change that can be used to
reverse or reapply the operation.
%End

    bool canBeMerged( int vertexIndex1, int vertexIndex2 ) const;
%Docstring
Returns ``True`` if faces separated by vertices with indexes
``vertexIndex1`` and ``vertexIndex2`` can be merged
%End

    Changes merge( int vertexIndex1, int vertexIndex2 );
%Docstring
Merges faces separated by vertices with indexes ``vertexIndex1`` and
``vertexIndex2`` The method returns a instance of the class
QgsTopologicalMesh.Change that can be used to reverse or reapply the
operation.
%End

    bool canBeSplit( int faceIndex ) const;
%Docstring
Returns ``True`` if face with index ``faceIndex`` can be split
%End

    Changes splitFace( int faceIndex );
%Docstring
Splits face with index ``faceIndex`` The method returns a instance of
the class QgsTopologicalMesh.Change that can be used to reverse or
reapply the operation.
%End

    Changes addVertexInFace( int faceIndex, const QgsMeshVertex &vertex );
%Docstring
Adds a ``vertex`` in the face with index ``faceIndex``. The including
face is removed and new faces surrounding the added vertex are added.
The method returns a instance of the class QgsTopologicalMesh.Change
that can be used to reverse or reapply the operation.
%End

    Changes insertVertexInFacesEdge( int faceIndex, int position, const QgsMeshVertex &vertex );
%Docstring
Inserts a ``vertex`` in the edge of face with index ``faceIndex`` at
``position`` . The faces that are on each side of the edge are removed
and replaced by new faces constructed by a triangulation.
%End

    Changes addFreeVertex( const QgsMeshVertex &vertex );
%Docstring
Adds a free ``vertex`` in the face, that is a vertex that is not
included or linked with any faces. The method returns a instance of the
class QgsTopologicalMesh.Change that can be used to reverse or reapply
the operation.
%End

    Changes removeVertexFillHole( int vertexIndex );
%Docstring
Removes the vertex with index ``vertexIndex``. If the vertex in linked
with faces, the operation leads also to remove the faces. In this case,
the hole is filled by a triangulation. The method returns a instance of
the class QgsTopologicalMesh.Change that can be used to reverse or
reapply the operation.
%End

    Changes removeVertices( const QList<int> &vertices );
%Docstring
Removes all the vertices with index in the list ``vertices`` If vertices
in linked with faces, the operation leads also to remove the faces
without filling holes. The method returns a instance of the class
QgsTopologicalMesh.Change that can be used to reverse or reapply the
operation.
%End

    Changes changeZValue( const QList<int> &verticesIndexes, const QList<double> &newValues );
%Docstring
Changes the Z values of the vertices with indexes in ``vertices``
indexes with the values in ``newValues``
%End

    Changes changeXYValue( const QList<int> &verticesIndexes, const QList<QgsPointXY> &newValues );
%Docstring
Changes the (X,Y) values of the vertices with indexes in ``vertices``
indexes with the values in ``newValues``
%End


    void applyChanges( const Changes &changes );
%Docstring
Applies the changes
%End

    void reverseChanges( const Changes &changes );
%Docstring
Reverses the changes
%End

    static QgsMeshEditingError counterClockwiseFaces( QgsMeshFace &face, QgsMesh *mesh );
%Docstring
Checks the topology of the face and sets it counter clockwise if
necessary
%End


    void reindex();
%Docstring
Reindexes faces and vertices, after this operation, the topological mesh
can't be edited anymore and only the method mesh can be used to access
to the raw mesh.
%End

    bool renumber();
%Docstring
Renumbers the indexes of vertices and faces using the Reverse CutHill
McKee Algorithm
%End

    QgsMeshEditingError checkConsistency() const;
%Docstring
Checks the consistency of the topological mesh and return ``False`` if
there is a consistency issue
%End

    static QgsMeshEditingError checkTopology( const QgsMesh &mesh, int maxVerticesPerFace );
%Docstring
Checks the topology of the mesh ``mesh``, if error occurs, this mesh
can't be edited
%End

};


/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/mesh/qgstopologicalmesh.h                                   *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/