X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_VTKUtils.cxx;h=bd8ad715afeccceefaa9960d49aafbab0b04941f;hb=580a459516b7dd154cda8574e3996e7cb50647cc;hp=40a80cc238a3264c7fb89126e99a1f5352e99eee;hpb=b83db6830f6509d7b35161021cdc2ce741c97443;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx index 40a80cc23..bd8ad715a 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx @@ -373,34 +373,31 @@ namespace SMESH if ( objModified ) { // PAL16631. Mesurements showed that to show aVisualObj in SHADING(default) mode, - // ~10 times more memory is used than it occupies. + // ~5 times more memory is used than it occupies. // Warn the user if there is less free memory than 30 sizes of a grid // TODO: estimate memory usage in other modes and take current mode into account int freeMB = SMDS_Mesh::CheckMemory(true); int usedMB = aVisualObj->GetUnstructuredGrid()->GetActualMemorySize() / 1024; - if ( freeMB > 0 && usedMB * 30 > freeMB ) { -#ifdef _DEBUG_ - MESSAGE ( "SMESHGUI_VTKUtils::GetVisualObj(), freeMB=" << freeMB - << ", usedMB=" << usedMB ); -#endif -// bool continu = false; -// if ( usedMB * 10 > freeMB ) -// // even dont try to show -// SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"), -// QObject::tr("SMESH_NO_MESH_VISUALIZATION")); -// else -// // there is a chance to succeed -// continu = SUIT_MessageBox::warning -// (SMESHGUI::desktop(), -// QObject::tr("SMESH_WRN_WARNING"), -// QObject::tr("SMESH_CONTINUE_MESH_VISUALIZATION"), -// SUIT_MessageBox::Yes | SUIT_MessageBox::No, -// SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes; -// if ( !continu ) { -// // remove the corresponding actors from all views -// RemoveVisualObjectWithActors( theEntry ); -// aVisualObj.reset(); -// } + cout << "SMESHGUI_VTKUtils::GetVisualObj(), freeMB=" << freeMB << ", usedMB=" < 0 && usedMB * 5 > freeMB ) { + bool continu = false; + if ( usedMB * 3 > freeMB ) + // even dont try to show + SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"), + QObject::tr("SMESH_NO_MESH_VISUALIZATION")); + else + // there is a chance to succeed + continu = SUIT_MessageBox::warning + (SMESHGUI::desktop(), + QObject::tr("SMESH_WRN_WARNING"), + QObject::tr("SMESH_CONTINUE_MESH_VISUALIZATION"), + SUIT_MessageBox::Yes | SUIT_MessageBox::No, + SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes; + if ( !continu ) { + // remove the corresponding actors from all views + RemoveVisualObjectWithActors( theEntry ); + aVisualObj.reset(); + } } }