}
MEDPresentation* presentation = (*citr).second;
- presentation->activateView();
+ if (!presentation->activateView())
+ {
+ // The view has been recreated - transfer all presentations that were in the deleted view to this new one
+ int viewId = presentation->getPyViewID();
+ std::map<MEDPresentation::TypeID, MEDPresentation*>::iterator citr = _presentations.begin();
+ for (; citr != _presentations.end(); ++citr)
+ {
+ if(citr->second->getPyViewID() == viewId)
+ citr->second->recreateViewSetup();
+ }
+ }
_activeViewPythonId = presentation->getPyViewID();
STDLOG("Activated view " << _activeViewPythonId);
return true;
// }
//}
-char*
+char *
MEDPresentationManager_i::getParavisDump(MEDPresentation::TypeID presentationID)
{
MEDPresentation* pres = _getPresentation(presentationID);
if (pres) {
- return (char*) pres->paravisDump().c_str();
+ return CORBA::string_dup(pres->paravisDump().c_str());
}
else
throw KERNEL::createSalomeException("getParavisDump(): presentation not found!!");
(*presList)[i] = it->first;
return presList;
}
+
+void
+MEDPresentationManager_i::cleanUp()
+{
+ _activeViewPythonId = -1;
+ std::map<MEDPresentation::TypeID, MEDPresentation*>::iterator it;
+ for (it = _presentations.begin(); it != _presentations.end(); ++it)
+ delete(it->second);
+ _presentations.clear();
+}