Salome HOME
[salome test] connect MEDCalc tests
[modules/med.git] / src / MEDCalc / cmp / MEDPresentationManager_i.txx
index 79eee1a5c4b796d24808f6566dfbf060dda0ea5a..4c66cfc719180ee00e429e0cb41b9bb7d9403de7 100644 (file)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-#ifndef _MED_PRESENTATION_MANAGER_I_TPP_
-#define _MED_PRESENTATION_MANAGER_I_TPP_
+#ifndef _MED_PRESENTATION_MANAGER_I_TXX_
+#define _MED_PRESENTATION_MANAGER_I_TXX_
 
 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 {
@@ -40,4 +47,17 @@ MEDPresentationManager_i::_makePresentation(PresentationParameters params)
   return newID;
 }
 
-#endif // _MED_PRESENTATION_MANAGER_I_TPP_
+template<typename PresentationType, typename PresentationParameters>
+void
+MEDPresentationManager_i::_updatePresentation(MEDPresentation::TypeID presentationID, PresentationParameters params)
+{
+  MEDPresentation* presentation = _getPresentation(presentationID);
+  if (!presentation) {
+    std::cerr << "_updatePresentation(): presentation not found!!" << std::endl;
+    return;
+  }
+
+  presentation->updatePipeline<PresentationType>(params);
+}
+
+#endif // _MED_PRESENTATION_MANAGER_I_TXX_