Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[mesh] mesh frame editing part-1 (qgis_core) (#43828)
[feature] qgis_core changes to allow mesh layer editing (part-1 or QEP#228)
- Loading branch information
Showing
30 changed files
with
3,871 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,10 @@ | |
|
||
|
||
|
||
%ModuleHeaderCode | ||
#include "qgsinterpolator.h" | ||
%End | ||
|
||
struct QgsInterpolatorVertexData | ||
{ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/mesh/qgsmesheditor.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
class QgsMeshEditingError | ||
{ | ||
%Docstring(signature="appended") | ||
|
||
Class that represents an error during mesh editing | ||
|
||
.. versionadded:: 3.22 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsmesheditor.h" | ||
%End | ||
public: | ||
|
||
QgsMeshEditingError(); | ||
%Docstring | ||
Constructor of the default error, that is NoError | ||
%End | ||
|
||
QgsMeshEditingError( Qgis::MeshEditingErrorType type, int elementIndex ); | ||
%Docstring | ||
Constructor with eht error ``type`` and the index of the element ``elementIndex`` | ||
%End | ||
|
||
Qgis::MeshEditingErrorType errorType; | ||
|
||
int elementIndex; | ||
|
||
bool operator==( const QgsMeshEditingError &other ) const; | ||
bool operator!=( const QgsMeshEditingError &other ) const; | ||
}; | ||
|
||
class QgsMeshEditor : QObject | ||
{ | ||
%Docstring(signature="appended") | ||
|
||
Class that makes edit operation on a mesh | ||
|
||
.. versionadded:: 3.22 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsmesheditor.h" | ||
%End | ||
public: | ||
|
||
QgsMeshEditor( QgsMeshLayer *meshLayer ); | ||
%Docstring | ||
Constructor with a specified layer ``meshLayer`` | ||
%End | ||
|
||
|
||
QgsMeshEditingError initialize(); | ||
%Docstring | ||
Initialize the mesh editor and return errors if the internal native mesh have topologic errors | ||
%End | ||
|
||
QgsMeshEditingError addFace( const QVector<int> &vertexIndexes ); | ||
%Docstring | ||
Adds a face ``face`` to the mesh with vertex indexes ``vertexIndexes``, returns topological errors if this operation fails (operation is not realized) | ||
%End | ||
|
||
QgsMeshEditingError removeFaces( const QList<int> &facesToRemove ); | ||
%Docstring | ||
Removes faces ``faces`` to the mesh, returns topological errors if this operation fails (operation is not realized) | ||
%End | ||
|
||
int addPointsAsVertices( const QVector<QgsPoint> &point, double tolerance ); | ||
%Docstring | ||
Adds points as vertices in triangular mesh coordinate in the mesh. Vertex is effectivly added if the transform | ||
from triangular coordinate to layer coordinate succeeds or if any vertices are next the added vertex (under ``tolerance`` distance). | ||
The method returns the number of vertices effectivly added. | ||
|
||
.. note:: | ||
|
||
this operation remove including face if exists and replace it by new faces surrounding the vertex | ||
if the mesh hasn't topological error before this operation, the toological operation always succeed | ||
%End | ||
|
||
QgsMeshEditingError removeVertices( const QList<int> &verticesToRemoveIndexes, bool fillHoles = false ); | ||
%Docstring | ||
Removes vertices with indexes in the list ``verticesToRemoveIndexes`` in the mesh | ||
if ``fillHoles`` is set to ``True``, this operation will fill holes created in the mesh, if not remove the surrounding faces | ||
|
||
If removing these vertices leads to a topological errors, the method will return the corresponding error and the operatio is canceled | ||
%End | ||
|
||
void stopEditing(); | ||
%Docstring | ||
Stops editing | ||
%End | ||
|
||
signals: | ||
void meshEdited(); | ||
%Docstring | ||
Emitted when the mesh is edited | ||
%End | ||
|
||
}; | ||
|
||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/mesh/qgsmesheditor.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.