From: abn Date: Fri, 5 Aug 2016 14:01:57 +0000 (+0200) Subject: [MEDCalc] Bug fix on ParaVis dump. X-Git-Tag: V8_1_0b1~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=eb0bce49fd42383441232d830a8fb6ee3eb28a7c;p=modules%2Fmed.git [MEDCalc] Bug fix on ParaVis dump. --- diff --git a/src/MEDCalc/cmp/MEDPresentationManager_i.cxx b/src/MEDCalc/cmp/MEDPresentationManager_i.cxx index 9fd1a1e6a..63ffed2af 100644 --- a/src/MEDCalc/cmp/MEDPresentationManager_i.cxx +++ b/src/MEDCalc/cmp/MEDPresentationManager_i.cxx @@ -324,12 +324,12 @@ MEDPresentationManager_i::getActiveViewPythonId() // } //} -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!!"); diff --git a/src/MEDCalc/cmp/MEDPresentationManager_i.hxx b/src/MEDCalc/cmp/MEDPresentationManager_i.hxx index e984b56ed..cd2549494 100644 --- a/src/MEDCalc/cmp/MEDPresentationManager_i.hxx +++ b/src/MEDCalc/cmp/MEDPresentationManager_i.hxx @@ -73,7 +73,7 @@ class MEDPresentationManager_i: public POA_MEDCALC::MEDPresentationManager, MEDCALC_EXPORT CORBA::Boolean activateView(MEDPresentation::TypeID); MEDCALC_EXPORT CORBA::Long getActiveViewPythonId(); // MEDCALC_EXPORT MEDCALC::ViewModeType getPresentationViewMode(MEDPresentation::TypeID); - MEDCALC_EXPORT char* getParavisDump(MEDPresentation::TypeID presentationID); + MEDCALC_EXPORT char * getParavisDump(MEDPresentation::TypeID presentationID); MEDCALC_EXPORT MEDCALC::PresentationsList* getAllPresentations(); private: diff --git a/src/MEDCalc/gui/MED_images.ts b/src/MEDCalc/gui/MED_images.ts index 5bc3ee90b..bc019e499 100644 --- a/src/MEDCalc/gui/MED_images.ts +++ b/src/MEDCalc/gui/MED_images.ts @@ -63,6 +63,10 @@ ICO_WORKSPACE_SAVE workspace_save.png + + ICO_ICO_DELETE_PRESENTATION + delete.png + ICO_PRESENTATION_MESH_VIEW_DEFAULT diff --git a/src/MEDCalc/gui/MED_msg_en.ts b/src/MEDCalc/gui/MED_msg_en.ts index a9a9a1ebc..8e55b5ecb 100644 --- a/src/MEDCalc/gui/MED_msg_en.ts +++ b/src/MEDCalc/gui/MED_msg_en.ts @@ -70,6 +70,14 @@ TIP_DELETE_PRESENTATION Delete selected presentation + + + LAB_PARAVIS_DUMP + Dump pipeline + + + TIP_PARAVIS_DUMP + Dump the low level Python commands of the presentation MENU_PRESENTATIONS diff --git a/src/MEDCalc/gui/PresentationController.cxx b/src/MEDCalc/gui/PresentationController.cxx index 09426d90f..d3dcce702 100644 --- a/src/MEDCalc/gui/PresentationController.cxx +++ b/src/MEDCalc/gui/PresentationController.cxx @@ -242,21 +242,21 @@ PresentationController::createActions() label = tr("LAB_DELETE_PRESENTATION"); tooltip = tr("TIP_DELETE_PRESENTATION"); - icon = tr(_getIconName("ICO_DELETE_PRESENTATION").c_str()); + icon = tr("ICO_DELETE_PRESENTATION"); actionId = _salomeModule->createStandardAction(label,this, SLOT(onDeletePresentation()),icon,tooltip); // _salomeModule->createTool(actionId, presentationToolbarId); // _salomeModule->action(actionId)->setIconVisibleInMenu(true); _salomeModule->createMenu(actionId, presentationMenuId); - // - // Actions for popup menu only - // // Low level PARAVIS dump label = tr("LAB_PARAVIS_DUMP"); - //icon = tr("ICO_DATASOURCE_EXPAND_FIELD"); + tooltip = tr("TIP_PARAVIS_DUMP"); actionId = _salomeModule->createStandardAction(label,this,SLOT(onParavisDump()),""); - _salomeModule->addActionInPopupMenu(actionId); + _salomeModule->createMenu(actionId, presentationMenuId); + // + // Actions for popup menu only + // } @@ -648,9 +648,9 @@ PresentationController::onParavisDump() continue; std::string dump(_presManager->getParavisDump(presId)); - std::cerr << "#====== ParaVis dump =============== " << std::endl; + std::cerr << "#====== ParaVis dump (presentation " << presId << ") =====" << std::endl; std::cerr << dump; - std::cerr << "#====== End of ParaVis dump ======== " << std::endl; + std::cerr << "#====== End of ParaVis dump =============== " << std::endl; break; // stop at the first one } diff --git a/src/MEDCalc/res/delete.png b/src/MEDCalc/res/delete.png new file mode 100644 index 000000000..93d166354 Binary files /dev/null and b/src/MEDCalc/res/delete.png differ