From 92d6898e4718c9daa7a00e655fc6778fce246f7e Mon Sep 17 00:00:00 2001 From: abn Date: Wed, 17 Dec 2014 16:03:04 +0100 Subject: [PATCH] Fixing timesteps/timerange when PARAVIS is activated after a PVViewer has been launched. --- src/PVGUI/PVGUI_Module.cxx | 19 +++++++++++++++++++ src/PVGUI/PVGUI_Module.h | 1 + src/PVGUI/PVGUI_Module_actions.cxx | 4 +++- 3 files changed, 23 insertions(+), 1 deletion(-) 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); } /*! -- 2.39.2