{
// PAL16631: without swap, bad_alloc is not thrown but hung up and crash instead,
// so check remaining memory size for safety
- // SMDS_Mesh::CheckMemory(); // PAL16631
+ SMDS_Mesh::CheckMemory(); // PAL16631
vtkPoints* aPoints = vtkPoints::New();
createPoints( aPoints );
- // SMDS_Mesh::CheckMemory();
+ SMDS_Mesh::CheckMemory();
myGrid->SetPoints( aPoints );
aPoints->Delete();
// PAL16631: without swap, bad_alloc is not thrown but hung up and crash instead,
// so check remaining memory size for safety
- // SMDS_Mesh::CheckMemory(); // PAL16631
+ SMDS_Mesh::CheckMemory(); // PAL16631
vtkIdType aCellsSize = 2 * nbEnts[ SMDSAbs_0DElement ] + 3 * nbEnts[ SMDSAbs_Edge ];
vtkCellArray* aConnectivity = vtkCellArray::New();
aConnectivity->Allocate( aCellsSize, 0 );
- // SMDS_Mesh::CheckMemory(); // PAL16631
+ SMDS_Mesh::CheckMemory(); // PAL16631
vtkUnsignedCharArray* aCellTypesArray = vtkUnsignedCharArray::New();
aCellTypesArray->SetNumberOfComponents( 1 );
aCellTypesArray->Allocate( aNbCells * aCellTypesArray->GetNumberOfComponents() );
- // SMDS_Mesh::CheckMemory(); // PAL16631
+ SMDS_Mesh::CheckMemory(); // PAL16631
vtkIdList *anIdList = vtkIdList::New();
vtkIdType iElem = 0;
TConnect aConnect;
aConnect.reserve(VTK_CELL_SIZE);
- // SMDS_Mesh::CheckMemory(); // PAL16631
+ SMDS_Mesh::CheckMemory(); // PAL16631
for ( int i = 0; i <= 3; i++ ) // iterate through 0d elements, edges, faces and volumes
{
iElem++;
}
}
- // SMDS_Mesh::CheckMemory(); // PAL16631
+ SMDS_Mesh::CheckMemory(); // PAL16631
}
// Insert cells in grid
aCellLocationsArray->SetNumberOfComponents( 1 );
aCellLocationsArray->SetNumberOfTuples( aNbCells );
- // SMDS_Mesh::CheckMemory(); // PAL16631
+ SMDS_Mesh::CheckMemory(); // PAL16631
aConnectivity->InitTraversal();
for( vtkIdType idType = 0, *pts, npts; aConnectivity->GetNextCell( npts, pts ); idType++ )
aConnectivity->Delete();
anIdList->Delete();
- // SMDS_Mesh::CheckMemory(); // PAL16631
+ SMDS_Mesh::CheckMemory(); // PAL16631
}
//=================================================================================
memoryLack = true;
}
+ if ( !memoryLack && !SMDS_Mesh::CheckMemory(true) ) { // has memory to show dialog boxes?
+ memoryLack = true;
+ }
+
// NPAL16631: if ( !memoryLack )
{
SMESH::ModifiedMesh(aMeshSObj, !computeFailed, myMesh->NbNodes() == 0);
// NPAL16631: if ( getSMESHGUI()->automaticUpdate() )
SUIT_ResourceMgr* resMgr = SMESH::GetResourceMgr( SMESHGUI::GetSMESHGUI() );
long newSize = myMesh->NbElements();
- long limitSize = resMgr->integerValue( "SMESH", "update_limit", 500000 );
bool limitExceeded;
if ( !memoryLack )
{
}
else if ( limitExceeded )
{
+ long limitSize = resMgr->integerValue( "SMESH", "update_limit", 500000 );
SUIT_MessageBox::warning( desktop(),
tr( "SMESH_WRN_WARNING" ),
tr( "SMESH_WRN_SIZE_LIMIT_EXCEEDED" ).arg( newSize ).arg( limitSize ) );