#ifndef DISABLE_PVVIEWER
#include "PVViewer_ViewModel.h"
+#include "PVViewer_GUIElements.h"
#endif
++
+#include "MEDFactoryClient.hxx"
+#include "MEDPresentationManager_i.hxx"
+ #include <QTimer>
#include <sstream>
MEDModule::init()
{
// initialize MED module engine (load, if necessary)
- if ( CORBA::is_nil( myEngine ) ) {
+ if ( CORBA::is_nil( _MED_engine ) ) {
Engines::EngineComponent_var comp =
SalomeApp_Application::lcc()->FindOrLoad_Component( "FactoryServer", "MED" );
- myEngine = MED_ORB::MED_Gen::_narrow( comp );
+ _MED_engine = MED_ORB::MED_Gen::_narrow( comp );
}
+
+ // Retrieve MEDFactory to get MEDPresentationManager (sometimes
+ if ( ! _presManager ) {
+ _presManager = MEDFactoryClient::getFactory()->getPresentationManager();
+ }
}
+ //void MEDModule::onEventLoopStarted()
+ //{
+ // if(!getApp()->isMainEventLoopStarted())
+ // {
+ // QTimer::singleShot(100, this, SLOT(onEventLoopStarted()));
+ // return;
+ // }
+ //}
+
void
MEDModule::initialize( CAM_Application* app )
{
connect(_workspaceController, SIGNAL(workspaceSignal(const MEDCALC::MedEvent*)),
_presentationController, SLOT(processWorkspaceEvent(const MEDCALC::MedEvent*)));
++
+ // Now that the workspace controller is created, ParaView core application has normally been started,
+ // and hidden GUI elements have been created. We can fire the VCR toolbar activation:
+ initToolbars();
+}
+
+void
+MEDModule::initToolbars()
+{
+ // VCR and Time toolbars:
+ SUIT_Desktop* dsk = getApp()->desktop();
+ _pvGuiElements = PVViewer_GUIElements::GetInstance(dsk);
+
+ _pvGuiElements->getVCRToolbar(); // make sure VCR toolbar is built
+ _pvGuiElements->setToolBarVisible(false);
+ _pvGuiElements->setVCRTimeToolBarVisible(true);
+
+ // Emit signal in order to make sure that animation scene is set - same trick as in PARAVIS module activation
+ QMetaObject::invokeMethod( pqPVApplicationCore::instance()->animationManager(),
+ "activeSceneChanged",
+ Q_ARG( pqAnimationScene*, pqPVApplicationCore::instance()->animationManager()->getActiveScene() ) );
++
+ #ifdef MED_HAS_QTTESTING
+ connect(_workspaceController, SIGNAL(workspaceSignal(const MEDCALC::MedEvent*)),
+ _testController, SLOT(processWorkspaceEvent(const MEDCALC::MedEvent*)));
+ #endif
}
void
XmedDataModel* _xmedDataModel;
PresentationController* _presentationController;
ProcessingController* _processingController;
- static MED_ORB::MED_Gen_var myEngine;
++
+ PVViewer_GUIElements* _pvGuiElements;
+
+ static MED_ORB::MED_Gen_var _MED_engine;
+
+ // GUI needs to talk directly to the pres manager to activate a view, get some params, etc ...:
+ static MEDCALC::MEDPresentationManager_ptr _presManager;
++
+ #ifdef MED_HAS_QTTESTING
+ TestController * _testController;
+ #endif
};
#endif