]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
Fixing timesteps/timerange when PARAVIS is activated after
authorabn <adrien.bruneton@cea.fr>
Wed, 17 Dec 2014 15:03:04 +0000 (16:03 +0100)
committerabn <adrien.bruneton@cea.fr>
Wed, 17 Dec 2014 15:03:04 +0000 (16:03 +0100)
a PVViewer has been launched.

src/PVGUI/PVGUI_Module.cxx
src/PVGUI/PVGUI_Module.h
src/PVGUI/PVGUI_Module_actions.cxx

index e97566a1de124236f4e9b7138cac22156ffb2726..a2445ae97784ce240393d46af67b14e466675eaf 100644 (file)
 #include <pqServerResource.h>
 #include <pqServerConnectReaction.h>
 #include <pqPluginManager.h>
+#include <pqVCRToolbar.h>
+#include <pqAnimationScene.h>
+#include <pqServerManagerModel.h>
+#include <pqAnimationTimeToolbar.h>
 
 //#include <PVViewer_EngineWrapper.h>
 
@@ -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()
index 1db745ab833cc4436694edde05b7271c398f768c..0b90f3a8b1be7e8479ab3d119f068a182ec755d5 100644 (file)
@@ -169,6 +169,7 @@ public:
   inline static pqPVApplicationCore * GetPVApplication();
 
   virtual CAM_DataModel* createDataModel();
+  void  fixAnimationScene();
 
 public slots:
   //void onImportFromVisu(QString theEntry);
index e41713e2ae6341a42c8f8eade5ab6e2490ade34b..0eeb2ba40a3bc416246f129b3994ee7e5df16fd9 100644 (file)
@@ -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);
 }
 
 /*!