} else {
SUIT_ViewManager* aVM = app->getViewManager(SVTK_Viewer::Type(), true);
if(aVM)
- aList.append(aVM);
+ aList.append(aVM);
}
bool actorRemoved = false;
ViewManagerList::ConstIterator it = aList.begin();
aViewManager = *it;
QVector<SUIT_ViewWindow*> views = aViewManager->getViews();
for ( int iV = 0; iV < views.count(); ++iV ) {
- if ( SMESH_Actor* actor = FindActorByEntry( views[iV], theEntry)) {
- if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) {
- vtkWnd->RemoveActor(actor);
- actorRemoved = true;
- }
- actor->Delete();
- }
+ if ( SMESH_Actor* actor = FindActorByEntry( views[iV], theEntry)) {
+ if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) {
+ vtkWnd->RemoveActor(actor);
+ actorRemoved = true;
+ }
+ actor->Delete();
+ }
}
}
TVisualObjCont::key_type aKey(aStudyId,theEntry);
TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(aKey);
if(anIter != VISUAL_OBJ_CONT.end()) {
- // for unknown reason, object destructor is not called, so clear object manually
- anIter->second->GetUnstructuredGrid()->SetCells(0,0,0,0,0);
- anIter->second->GetUnstructuredGrid()->SetPoints(0);
+ // for unknown reason, object destructor is not called, so clear object manually
+ anIter->second->GetUnstructuredGrid()->SetCells(0,0,0,0,0);
+ anIter->second->GetUnstructuredGrid()->SetPoints(0);
}
VISUAL_OBJ_CONT.erase(aKey);
}
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();
-// }
+ MESSAGE("SMESHGUI_VTKUtils::GetVisualObj(), freeMB=" << freeMB << ", usedMB=" <<usedMB);
+ if ( freeMB > 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();
+ }
}
}
MESSAGE("--- display " << anActor);
anActor->SetVisibility(true);
- if(anActor->hasIO()){
- Handle(SALOME_InteractiveObject) anIO = anActor->getIO();
- if(anIO->hasEntry()){
- aStudy->setVisibilityState(anIO->getEntry(), Qtx::ShownState);
- }
- }
+ if(anActor->hasIO()){
+ Handle(SALOME_InteractiveObject) anIO = anActor->getIO();
+ if(anIO->hasEntry()){
+ aStudy->setVisibilityState(anIO->getEntry(), Qtx::ShownState);
+ }
+ }
}
}
break;
anActor->SetVisibility(false);
}
}
- aStudy->setVisibilityStateForAll(Qtx::HiddenState);
+ aStudy->setVisibilityStateForAll(Qtx::HiddenState);
}
default: {
if (SMESH_Actor *anActor = FindActorByEntry(theWnd,theEntry)) {
case eDisplay:
case eDisplayOnly:
//MESSAGE("--- display " << anActor);
- anActor->Update();
+ anActor->Update();
anActor->SetVisibility(true);
if (theAction == eDisplayOnly) aRenderer->ResetCameraClippingRange();
- aStudy->setVisibilityState(theEntry, Qtx::ShownState);
+ aStudy->setVisibilityState(theEntry, Qtx::ShownState);
break;
case eErase:
//MESSAGE("--- erase " << anActor);
anActor->SetVisibility(false);
- aStudy->setVisibilityState(theEntry, Qtx::HiddenState);
+ aStudy->setVisibilityState(theEntry, Qtx::HiddenState);
break;
}
} else {
if ((anActor = CreateActor(aDocument,theEntry,true))) {
bool needFitAll = noSmeshActors(theWnd); // fit for the first object only
DisplayActor(theWnd,anActor);
- aStudy->setVisibilityState(theEntry, Qtx::ShownState);
+ aStudy->setVisibilityState(theEntry, Qtx::ShownState);
// FitAll(); - PAL16770(Display of a group performs an automatic fit all)
if (needFitAll) FitAll();
} else {