From 7a70a5520989d5141a81024e05d34aa4031b2f5e Mon Sep 17 00:00:00 2001 From: Louis Gombert Date: Thu, 8 Aug 2024 21:27:52 +0000 Subject: [PATCH] Update with new UG faces API for VTK master --- src/SMDS/SMDS_UnstructuredGrid.cxx | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/SMDS/SMDS_UnstructuredGrid.cxx b/src/SMDS/SMDS_UnstructuredGrid.cxx index cf820b9c8..5f6665a3a 100644 --- a/src/SMDS/SMDS_UnstructuredGrid.cxx +++ b/src/SMDS/SMDS_UnstructuredGrid.cxx @@ -227,11 +227,6 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, this->Connectivity->Squeeze(); this->CellLocations->Squeeze(); this->Types->Squeeze(); - if ( this->FaceLocations ) - { - this->FaceLocations->Squeeze(); - this->Faces->Squeeze(); - } this->Connectivity->Modified(); return; } @@ -284,30 +279,30 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, } } - if (this->FaceLocations) + if (this->GetFaceLocations()) { vtkIdTypeArray *newFaceLocations = vtkIdTypeArray::New(); newFaceLocations->Initialize(); newFaceLocations->Allocate(newTypes->GetSize()); vtkIdTypeArray *newFaces = vtkIdTypeArray::New(); newFaces->Initialize(); - newFaces->Allocate(this->Faces->GetSize()); + newFaces->Allocate(this->GetFaces()->GetSize()); for ( vtkIdType newCellID = 0; newCellID < newCellSize; newCellID++ ) { if ( newTypes->GetValue( newCellID ) == VTK_POLYHEDRON ) { smIdType oldCellId = idCellsNewToOld[ newCellID ]; newFaceLocations->InsertNextValue( newFaces->GetMaxId()+1 ); - smIdType oldFaceLoc = this->FaceLocations->GetValue( FromSmIdType(oldCellId) ); - smIdType nCellFaces = this->Faces->GetValue( FromSmIdType(oldFaceLoc++) ); + smIdType oldFaceLoc = this->GetFaceLocations()->GetValue( FromSmIdType(oldCellId) ); + smIdType nCellFaces = this->GetFaces()->GetValue( FromSmIdType(oldFaceLoc++) ); newFaces->InsertNextValue( FromSmIdType(nCellFaces) ); for ( int n = 0; n < nCellFaces; n++ ) { - int nptsInFace = this->Faces->GetValue( FromSmIdType(oldFaceLoc++) ); + int nptsInFace = this->GetFaces()->GetValue( FromSmIdType(oldFaceLoc++) ); newFaces->InsertNextValue( nptsInFace ); for ( int k = 0; k < nptsInFace; k++ ) { - vtkIdType oldpt = this->Faces->GetValue( FromSmIdType(oldFaceLoc++) ); + vtkIdType oldpt = this->GetFaces()->GetValue( FromSmIdType(oldFaceLoc++) ); newFaces->InsertNextValue( idNodesOldToNew[ oldpt ]); } } @@ -319,14 +314,14 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, } newFaceLocations->Squeeze(); newFaces->Squeeze(); - this->SetCells( newTypes, newLocations, newConnectivity, newFaceLocations, newFaces ); + this->SetCells( newTypes, newConnectivity, newFaceLocations, newFaces ); this->CellLocations = newLocations; newFaceLocations->Delete(); newFaces->Delete(); } else { - this->SetCells( newTypes, newLocations, newConnectivity, FaceLocations, Faces ); + this->SetCells( newTypes, newConnectivity, this->GetFaceLocations(), this->GetFaces() ); this->CellLocations = newLocations; }