16#ifndef QGSTOPOLOGICALMESH_H
17#define QGSTOPOLOGICALMESH_H
24template CORE_EXPORT QVector<int>
SIP_SKIP;
25template CORE_EXPORT QList<int>
SIP_SKIP;
26template CORE_EXPORT QVector<QVector<int>>
SIP_SKIP;
67 QVector<QgsMeshFace>
meshFaces()
const {
return mFaces;}
73 QVector<FaceNeighbors> facesNeighborhood()
const;
76 int vertexToFace(
int vertexIndex )
const;
79 QVector<QgsMeshFace> mFaces;
80 QVector<FaceNeighbors> mFacesNeighborhood;
81 QMultiHash<int, int> mVerticesToFace;
82 QList<int> mBoundaries;
101 QVector<QgsMeshFace> addedFaces()
const;
104 QVector<QgsMeshFace> removedFaces()
const;
107 QList<int> removedFaceIndexes()
const;
110 QVector<QgsMeshVertex> addedVertices()
const;
113 QList<int> verticesToRemoveIndexes()
const;
116 QList<int> changedCoordinatesVerticesIndexes()
const;
119 QList<double> newVerticesZValues()
const;
122 QList<QgsPointXY> newVerticesXYValues()
const;
125 QList<QgsPointXY> oldVerticesXYValues()
const;
128 QList<int> nativeFacesIndexesGeometryChanged()
const;
131 bool isEmpty()
const;
134 int mAddedFacesFirstIndex = 0;
160 int addedFaceIndexInMesh(
int internalIndex )
const;
161 int removedFaceIndexInMesh(
int internalIndex )
const;
178 QVector<int> neighborsOfFace(
int faceIndex )
const;
181 QList<int> facesAroundVertex(
int vertexIndex )
const;
187 int firstFaceLinked(
int vertexIndex )
const;
190 bool isVertexOnBoundary(
int vertexIndex )
const;
193 bool isVertexFree(
int vertexIndex )
const;
196 QList<int> freeVerticesIndexes()
const;
222 Changes removeFaces(
const QList<int> &facesIndexes );
227 bool edgeCanBeFlipped(
int vertexIndex1,
int vertexIndex2 )
const;
233 Changes flipEdge(
int vertexIndex1,
int vertexIndex2 );
238 bool canBeMerged(
int vertexIndex1,
int vertexIndex2 )
const;
244 Changes merge(
int vertexIndex1,
int vertexIndex2 );
249 bool canBeSplit(
int faceIndex )
const;
255 Changes splitFace(
int faceIndex );
280 Changes removeVertexFillHole(
int vertexIndex );
287 Changes removeVertices(
const QList<int> &vertices );
292 Changes changeZValue(
const QList<int> &verticesIndexes,
const QList<double> &newValues );
297 Changes changeXYValue(
const QList<int> &verticesIndexes,
const QList<QgsPointXY> &newValues );
301 void applyChanges(
const Changes &changes );
304 void reverseChanges(
const Changes &changes );
315 static QgsMeshEditingError checkTopologyOfVerticesAsFace(
const QVector<QgsMeshVertex> &vertices,
bool &clockwise );
337 return face.indexOf( vertexIndex );
341 static int vertexPositionInFace(
const QgsMesh &mesh,
int vertexIndex,
int faceIndex );
346 static TopologicalFaces createTopologicalFaces(
347 const QVector<QgsMeshFace> &faces,
348 QVector<int> *globalVertexToFace,
350 bool allowUniqueSharedVertex );
353 QSet<int> concernedFacesBy(
const QList<int> &faceIndexes )
const;
356 void referenceAsFreeVertex(
int vertexIndex );
358 void dereferenceAsFreeVertex(
int vertexIndex );
364 bool eitherSideFacesAndVertices(
int vertexIndex1,
368 int &neighborVertex1InFace1,
369 int &neighborVertex1InFace2,
370 int &neighborVertex2inFace1,
371 int &neighborVertex2inFace2 )
const;
373 bool renumberVertices( QVector<int> &oldToNewIndex )
const;
374 bool renumberFaces( QVector<int> &oldToNewIndex )
const;
378 QVector<int> mVertexToFace;
379 QVector<FaceNeighbors> mFacesNeighborhood;
381 QSet<int> mFreeVertices;
383 int mMaximumVerticesPerFace = 0;
418 int turnCounterClockwise()
const;
421 int turnClockwise()
const;
424 int currentFaceIndex()
const;
430 bool goBoundaryClockwise()
const;
433 bool goBoundaryCounterClockwise()
const;
436 int oppositeVertexClockwise()
const;
439 int oppositeVertexCounterClockwise()
const;
442 bool isValid()
const;
445 QList<int> facesAround()
const;
451 const QVector<QgsMeshFace> mFaces;
452 const QVector<QgsTopologicalMesh::FaceNeighbors> mFacesNeighborhood;
453 const int mVertexIndex = -1;
454 mutable int mCurrentFace = -1;
455 mutable int mLastValidFace = -1;
456 bool mIsValid =
false;
457 mutable int mDegree = -1;
459 int positionInCurrentFace()
const;
Class that represents an error during mesh editing.
Convenient class that turn around a vertex and provide information about faces and vertices.
Point geometry type, with support for z-dimension and m-values.
Class that contains topological differences between two states of a topological mesh,...
QList< int > mChangeCoordinateVerticesIndexes
QList< int > mVerticesToFaceRemoved
QVector< FaceNeighbors > mFacesNeighborhoodToRemove
QList< QgsPointXY > mNewXYValues
QList< QgsMeshVertex > mRemovedVertices
QList< std::array< int, 4 > > mNeighborhoodChanges
QList< int > mVerticesToRemoveIndexes
QList< int > mNativeFacesIndexesGeometryChanged
QVector< QgsMeshFace > mFacesToAdd
QVector< FaceNeighbors > mFacesNeighborhoodToAdd
QList< std::array< int, 3 > > mVerticesToFaceChanges
QList< QgsPointXY > mOldXYValues
QList< double > mNewZValues
QVector< QgsMeshVertex > mVerticesToAdd
QVector< int > mVertexToFaceToAdd
QList< int > mFaceIndexesToRemove
QVector< QgsMeshFace > mFacesToRemove
QList< double > mOldZValues
Class that contains independent faces an topological information about this faces.
QVector< QgsMeshFace > meshFaces() const
Returns faces.
Class that wraps a QgsMesh to ensure the consistency of the mesh during editing and help to access to...
static int vertexPositionInFace(int vertexIndex, const QgsMeshFace &face)
Returns vertex position in face.
QVector< int > FaceNeighbors
QVector< int > QgsMeshFace
List of vertex indexes.
Mesh - vertices, edges and faces.