Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
rename method
  • Loading branch information
vcloarec committed Sep 20, 2021
1 parent 3440802 commit aa4258f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions python/core/auto_generated/mesh/qgsmesheditor.sip.in
Expand Up @@ -212,14 +212,14 @@ Returns ``True`` if an edge of face is closest than the tolerance from the ``poi
Returns also the face index and the edge position in ``faceIndex`` and ``edgePosition``
%End

int effectiveFacesCount() const;
int validFacesCount() const;
%Docstring
Returns the effective count of faces, that is non void faces in the mesh
Returns the count of valid faces, that is non void faces in the mesh
%End

int effectiveVerticesCount() const;
int validVerticesCount() const;
%Docstring
Returns the effective count of vertices, that is non void vertices in the mesh
Returns the count of valid vertices, that is non void vertices in the mesh
%End

signals:
Expand Down
24 changes: 12 additions & 12 deletions src/core/mesh/qgsmesheditor.cpp
Expand Up @@ -65,8 +65,8 @@ QgsMeshEditingError QgsMeshEditor::initialize()
{
QgsMeshEditingError error;
mTopologicalMesh = QgsTopologicalMesh::createTopologicalMesh( mMesh, mMaximumVerticesPerFace, error );
mEffectiveFacesCount = mMesh->faceCount();
mEffectiveVerticesCount = mMesh->vertexCount();
mValidFacesCount = mMesh->faceCount();
mValidVerticesCount = mMesh->vertexCount();
return error;
}

Expand Down Expand Up @@ -337,14 +337,14 @@ void QgsMeshEditor::updateElementsCount( const QgsTopologicalMesh::Changes &chan
{
if ( apply )
{
mEffectiveFacesCount += changes.addedFaces().count() - changes.removedFaces().count();
mEffectiveVerticesCount += changes.addedVertices().count() - changes.verticesToRemoveIndexes().count();
mValidFacesCount += changes.addedFaces().count() - changes.removedFaces().count();
mValidVerticesCount += changes.addedVertices().count() - changes.verticesToRemoveIndexes().count();
}
else
{
//reverse
mEffectiveFacesCount -= changes.addedFaces().count() - changes.removedFaces().count();
mEffectiveVerticesCount -= changes.addedVertices().count() - changes.verticesToRemoveIndexes().count();
mValidFacesCount -= changes.addedFaces().count() - changes.removedFaces().count();
mValidVerticesCount -= changes.addedVertices().count() - changes.verticesToRemoveIndexes().count();
}
}

Expand Down Expand Up @@ -419,14 +419,14 @@ bool QgsMeshEditor::edgeIsClose( QgsPointXY point, double tolerance, int &faceIn

}

int QgsMeshEditor::effectiveFacesCount() const
int QgsMeshEditor::validFacesCount() const
{
return mEffectiveFacesCount;
return mValidFacesCount;
}

int QgsMeshEditor::effectiveVerticesCount() const
int QgsMeshEditor::validVerticesCount() const
{
return mEffectiveVerticesCount;
return mValidVerticesCount;
}

QgsMeshEditingError QgsMeshEditor::removeFaces( const QList<int> &facesToRemove )
Expand Down Expand Up @@ -895,8 +895,8 @@ bool QgsMeshEditor::reindex( bool renumbering )
mTopologicalMesh.reindex();
mUndoStack->clear();
QgsMeshEditingError error = initialize();
mEffectiveFacesCount = mMesh->faceCount();
mEffectiveVerticesCount = mMesh->vertexCount();
mValidFacesCount = mMesh->faceCount();
mValidVerticesCount = mMesh->vertexCount();

if ( error.errorType != Qgis::MeshEditingErrorType::NoError )
return false;
Expand Down
12 changes: 6 additions & 6 deletions src/core/mesh/qgsmesheditor.h
Expand Up @@ -238,11 +238,11 @@ class CORE_EXPORT QgsMeshEditor : public QObject
*/
bool edgeIsClose( QgsPointXY point, double tolerance, int &faceIndex, int &edgePosition );

//! Returns the effective count of faces, that is non void faces in the mesh
int effectiveFacesCount() const;
//! Returns the count of valid faces, that is non void faces in the mesh
int validFacesCount() const;

//! Returns the effective count of vertices, that is non void vertices in the mesh
int effectiveVerticesCount() const;
//! Returns the count of valid vertices, that is non void vertices in the mesh
int validVerticesCount() const;

signals:
//! Emitted when the mesh is edited
Expand All @@ -254,8 +254,8 @@ class CORE_EXPORT QgsMeshEditor : public QObject
QgsTriangularMesh *mTriangularMesh = nullptr;
int mMaximumVerticesPerFace = 0;
QgsMeshDatasetGroup *mZValueDatasetGroup = nullptr;
int mEffectiveVerticesCount = 0;
int mEffectiveFacesCount = 0;
int mValidVerticesCount = 0;
int mValidFacesCount = 0;

QVector<QgsMeshFace> prepareFaces( const QVector<QgsMeshFace> &faces, QgsMeshEditingError &error );

Expand Down
4 changes: 2 additions & 2 deletions src/core/mesh/qgsmeshlayer.cpp
Expand Up @@ -1060,7 +1060,7 @@ bool QgsMeshLayer::contains( const QgsMesh::ElementType &type ) const
int QgsMeshLayer::meshVertexCount() const
{
if ( mMeshEditor )
return mMeshEditor->effectiveVerticesCount();
return mMeshEditor->validVerticesCount();
else if ( mDataProvider )
return mDataProvider->vertexCount();
else return 0;
Expand All @@ -1069,7 +1069,7 @@ int QgsMeshLayer::meshVertexCount() const
int QgsMeshLayer::meshFaceCount() const
{
if ( mMeshEditor )
return mMeshEditor->effectiveFacesCount();
return mMeshEditor->validFacesCount();
else if ( mDataProvider )
return mDataProvider->faceCount();
else return 0;
Expand Down

0 comments on commit aa4258f

Please sign in to comment.