From: abn Date: Wed, 17 Dec 2014 15:03:04 +0000 (+0100) Subject: Fixing timesteps/timerange when PARAVIS is activated after X-Git-Tag: V7_5_1b1~4^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=92d6898e4718c9daa7a00e655fc6778fce246f7e;p=modules%2Fparavis.git Fixing timesteps/timerange when PARAVIS is activated after a PVViewer has been launched. --- diff --git a/src/PVGUI/PVGUI_Module.cxx b/src/PVGUI/PVGUI_Module.cxx index e97566a1..a2445ae9 100644 --- a/src/PVGUI/PVGUI_Module.cxx +++ b/src/PVGUI/PVGUI_Module.cxx @@ -133,6 +133,10 @@ #include #include #include +#include +#include +#include +#include //#include @@ -467,6 +471,21 @@ void PVGUI_Module::initialize( CAM_Application* app ) } } } + fixAnimationScene(); + +} + +/** + * Little trick to force the proper update of the timesteps/time range when the module is initialized. + * This is otherwise not properly working when PARAVIS is activated after a PVViewer has already been + * instanciated. + */ +void PVGUI_Module::fixAnimationScene() +{ + pqServer* server = pqActiveObjects::instance().activeServer(); + pqApplicationCore * app = pqApplicationCore::instance(); + pqPipelineSource * src = app->getObjectBuilder()->createSource(QString("sources"), QString("TimeSource"),server); + app->getObjectBuilder()->destroy(src); } void PVGUI_Module::onStartProgress() diff --git a/src/PVGUI/PVGUI_Module.h b/src/PVGUI/PVGUI_Module.h index 1db745ab..0b90f3a8 100644 --- a/src/PVGUI/PVGUI_Module.h +++ b/src/PVGUI/PVGUI_Module.h @@ -169,6 +169,7 @@ public: inline static pqPVApplicationCore * GetPVApplication(); virtual CAM_DataModel* createDataModel(); + void fixAnimationScene(); public slots: //void onImportFromVisu(QString theEntry); diff --git a/src/PVGUI/PVGUI_Module_actions.cxx b/src/PVGUI/PVGUI_Module_actions.cxx index e41713e2..0eeb2ba4 100644 --- a/src/PVGUI/PVGUI_Module_actions.cxx +++ b/src/PVGUI/PVGUI_Module_actions.cxx @@ -559,7 +559,9 @@ void PVGUI_Module::pvCreateMenus() void PVGUI_Module::pvCreateToolBars() { SUIT_Desktop* desk = application()->desktop(); - pqParaViewMenuBuilders::buildToolbars(*desk); +// pqParaViewMenuBuilders::buildToolbars(*desk); + PVViewer_GUIElements * guiElements = PVViewer_GUIElements::GetInstance(desk); + guiElements->setToolBarVisible(true); } /*!