Skip to content
Permalink
Browse files
remove too long checks after renumbering mesh (#45595)
  • Loading branch information
vcloarec committed Oct 21, 2021
1 parent b4741b6 commit d4f8e5400573e863cd6c674c931fb15856e71561
Showing with 1 addition and 23 deletions.
  1. +1 −23 src/core/mesh/qgstopologicalmesh.cpp
@@ -739,38 +739,16 @@ void QgsTopologicalMesh::reindex()
bool QgsTopologicalMesh::renumber()
{
QVector<int> oldToNewVerticesIndexes;

if ( !renumberVertices( oldToNewVerticesIndexes ) )
return false;

for ( int i = 0; i < oldToNewVerticesIndexes.count(); ++i )
{
if ( oldToNewVerticesIndexes[i] == -1 )
return false;
for ( int j = i + 1; j < oldToNewVerticesIndexes.count(); ++j )
{
if ( oldToNewVerticesIndexes[i] == oldToNewVerticesIndexes[j] )
return false;
}
}

QVector<int> oldToNewFacesIndexes;

if ( !renumberFaces( oldToNewFacesIndexes ) )
return false;

for ( int i = 0; i < oldToNewFacesIndexes.count(); ++i )
{
if ( oldToNewFacesIndexes[i] == -1 )
return false;
for ( int j = i + 1; j < oldToNewFacesIndexes.count(); ++j )
{
if ( oldToNewFacesIndexes[i] == oldToNewFacesIndexes[j] )
return false;
}
}

// after the checks, apply the renumbering
// If we are here, we can apply the renumbering

QVector<QgsMeshVertex> tempVertices( mMesh->vertices.count() );
for ( int i = 0; i < oldToNewVerticesIndexes.count(); ++i )

0 comments on commit d4f8e54

Please sign in to comment.