-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
SMDS_Mesh::CheckMemory(); // PAL16631
aConnectivity->InitTraversal();
- for( vtkIdType idType = 0, *pts, npts; aConnectivity->GetNextCell( npts, pts ); idType++ )
+ vtkIdType const *pts(nullptr);
+ for( vtkIdType idType = 0, npts; aConnectivity->GetNextCell( npts, pts ); idType++ )
aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) );
myGrid->SetCells( aCellTypesArray, aCellLocationsArray,aConnectivity );
vtkUnstructuredGrid* SMESH_VisualObjDef::GetUnstructuredGrid()
{
- if ( !myLocalGrid && !GetMesh()->IsCompacted() )
+ if ( !myLocalGrid && ( !GetMesh()->IsCompacted() || // !IsCompacted() is needed ???
+ GetMesh()->GetGrid()->GetMTime() > myGrid->GetMTime() ))
{
NulData(); // detach from the SMDS grid to allow immediate memory de-allocation in CompactMesh()
GetMesh()->CompactMesh();