Salome HOME
[MEDCalc] Presentation removal
[modules/med.git] / src / MEDCalc / cmp / MEDPresentationManager_i.txx
index eb283bf152986e6e60abcb850c3e4dd16c52e227..4c66cfc719180ee00e429e0cb41b9bb7d9403de7 100644 (file)
@@ -24,6 +24,13 @@ template<typename PresentationType, typename PresentationParameters>
 MEDPresentation::TypeID
 MEDPresentationManager_i::_makePresentation(PresentationParameters params)
 {
+  // Replace = Remove then add
+  if (params.viewMode == MEDCALC::VIEW_MODE_REPLACE) {
+    MEDPresentation::TypeID currentPresentationId = _getActivePresentationId();
+    if (currentPresentationId > -1)
+      removePresentation(currentPresentationId);
+  }
+
   // Create a new presentation instance
   PresentationType* presentation = NULL;
   try {