From cbb15dc453937ce905fcfce64f0539cd0bb4d931 Mon Sep 17 00:00:00 2001 From: Louis Gombert Date: Sun, 30 Nov 2025 18:36:20 +0100 Subject: [PATCH] Smesh: patch other VTK UG deprecations --- .../salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp b/src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp index ce9b01a4d2..f5b91ff800 100644 --- a/src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp +++ b/src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp @@ -193,8 +193,8 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, int n vtkCellArray *newConnectivity = vtkCellArray::New(); newConnectivity->Initialize(); - int oldCellDataSize = this->Connectivity->GetData()->GetSize(); - newConnectivity->Allocate(oldCellDataSize); + int oldCellDataSize = this->GetCells()->GetConnectivityArray()->GetSize(); + newConnectivity->AllocateExact(oldCellDataSize, oldCellDataSize); MESSAGE("oldCellSize="<< oldCellSize << " oldCellDataSize=" << oldCellDataSize); vtkUnsignedCharArray *newTypes = vtkUnsignedCharArray::New(); @@ -420,7 +420,8 @@ void SMDS_UnstructuredGrid::copyBloc(vtkUnsignedCharArray *newTypes, //MESSAGE(" " << oldval << " " << pointsCell[l]); } /*int newcnt = */newConnectivity->InsertNextCell(nbpts, pointsCell); - int newLoc = newConnectivity->GetInsertLocation(nbpts); + int newLoc = this->GetCells()->GetOffsetsArray()->GetNumberOfValues() - 1 + + this->GetCells()->GetConnectivityArray()->GetNumberOfValues() - nbpts - 1; //MESSAGE(newcnt << " " << newLoc); newLocations->SetValue(alreadyCopied, newLoc); alreadyCopied++;