1 // PARAVIS : ParaView wrapper SALOME module
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : PVGUI_Module.cxx
23 // Author : Julia DOROVSKIKH
26 #include "PVGUI_Module.h"
27 #include "PVGUI_Module_impl.h"
28 #include "PVGUI_ProcessModuleHelper.h"
29 #include "PVGUI_ViewModel.h"
30 #include "PVGUI_ViewManager.h"
31 #include "PVGUI_ViewWindow.h"
33 #include <SUIT_Desktop.h>
34 #include <SUIT_MessageBox.h>
35 #include <SUIT_ResourceMgr.h>
36 #include <SUIT_Session.h>
37 #include <LightApp_Application.h>
38 #include <LightApp_SelectionMgr.h>
39 #include <QtxActionToolMgr.h>
42 #include <QApplication>
48 #include <QInputDialog>
51 #include <QStringList>
55 #include <pqApplicationCore.h>
56 #include <pqActiveServer.h>
57 #include <pqActiveView.h>
58 #include <pqClientAboutDialog.h>
59 #include <pqObjectBuilder.h>
60 #include <pqOptions.h>
61 #include <pqRenderView.h>
62 #include <pqRubberBandHelper.h>
64 #include <pqServerManagerModel.h>
65 #include <pqServerResource.h>
66 #include <pqUndoStack.h>
67 #include <pqVCRController.h>
68 #include <pqViewManager.h>
69 #include <vtkPVMain.h>
70 #include <vtkProcessModule.h>
73 * Make sure all the kits register their classes with vtkInstantiator.
74 * Since ParaView uses Tcl wrapping, all of VTK is already compiled in
75 * anyway. The instantiators will add no more code for the linker to
79 #include <vtkCommonInstantiator.h>
80 #include <vtkFilteringInstantiator.h>
81 #include <vtkGenericFilteringInstantiator.h>
82 #include <vtkIOInstantiator.h>
83 #include <vtkImagingInstantiator.h>
84 #include <vtkInfovisInstantiator.h>
85 #include <vtkGraphicsInstantiator.h>
87 #include <vtkRenderingInstantiator.h>
88 #include <vtkVolumeRenderingInstantiator.h>
89 #include <vtkHybridInstantiator.h>
90 #include <vtkParallelInstantiator.h>
92 #include <vtkPVServerCommonInstantiator.h>
93 #include <vtkPVFiltersInstantiator.h>
94 #include <vtkPVServerManagerInstantiator.h>
95 #include <vtkClientServerInterpreter.h>
98 //----------------------------------------------------------------------------
99 // ClientServer wrapper initialization functions.
100 // Taken from ParaView sources (file pqMain.cxx)
101 extern "C" void vtkCommonCS_Initialize(vtkClientServerInterpreter*);
102 extern "C" void vtkFilteringCS_Initialize(vtkClientServerInterpreter*);
103 extern "C" void vtkGenericFilteringCS_Initialize(vtkClientServerInterpreter*);
104 extern "C" void vtkImagingCS_Initialize(vtkClientServerInterpreter*);
105 extern "C" void vtkInfovisCS_Initialize(vtkClientServerInterpreter*);
106 extern "C" void vtkGraphicsCS_Initialize(vtkClientServerInterpreter*);
107 extern "C" void vtkIOCS_Initialize(vtkClientServerInterpreter*);
108 extern "C" void vtkRenderingCS_Initialize(vtkClientServerInterpreter*);
109 extern "C" void vtkVolumeRenderingCS_Initialize(vtkClientServerInterpreter*);
110 extern "C" void vtkHybridCS_Initialize(vtkClientServerInterpreter*);
111 extern "C" void vtkWidgetsCS_Initialize(vtkClientServerInterpreter*);
112 extern "C" void vtkParallelCS_Initialize(vtkClientServerInterpreter*);
113 extern "C" void vtkPVServerCommonCS_Initialize(vtkClientServerInterpreter*);
114 extern "C" void vtkPVFiltersCS_Initialize(vtkClientServerInterpreter*);
115 extern "C" void vtkXdmfCS_Initialize(vtkClientServerInterpreter *);
117 //----------------------------------------------------------------------------
118 void ParaViewInitializeInterpreter(vtkProcessModule* pm)
120 // Initialize built-in wrapper modules.
121 vtkCommonCS_Initialize(pm->GetInterpreter());
122 vtkFilteringCS_Initialize(pm->GetInterpreter());
123 vtkGenericFilteringCS_Initialize(pm->GetInterpreter());
124 vtkImagingCS_Initialize(pm->GetInterpreter());
125 vtkInfovisCS_Initialize(pm->GetInterpreter());
126 vtkGraphicsCS_Initialize(pm->GetInterpreter());
127 vtkIOCS_Initialize(pm->GetInterpreter());
128 vtkRenderingCS_Initialize(pm->GetInterpreter());
129 vtkVolumeRenderingCS_Initialize(pm->GetInterpreter());
130 vtkHybridCS_Initialize(pm->GetInterpreter());
131 vtkWidgetsCS_Initialize(pm->GetInterpreter());
132 vtkParallelCS_Initialize(pm->GetInterpreter());
133 vtkPVServerCommonCS_Initialize(pm->GetInterpreter());
134 vtkPVFiltersCS_Initialize(pm->GetInterpreter());
135 vtkXdmfCS_Initialize(pm->GetInterpreter());
138 vtkPVMain* PVGUI_Module::pqImplementation::myPVMain = 0;
139 pqOptions* PVGUI_Module::pqImplementation::myPVOptions = 0;
140 PVGUI_ProcessModuleHelper* PVGUI_Module::pqImplementation::myPVHelper = 0;
144 \brief Implementation of light (no-CORBA-engine)
145 SALOME module wrapping ParaView GUI.
149 \brief Constructor. Sets the default name for the module.
151 PVGUI_Module::PVGUI_Module()
152 : LightApp_Module( "PARAVIS" ),
160 PVGUI_Module::~PVGUI_Module()
165 \brief Initialize module. Creates menus, prepares context menu, etc.
166 \param app application instance
168 void PVGUI_Module::initialize( CAM_Application* app )
170 LightApp_Module::initialize( app );
182 createAction( lgLoadFile, tr( "TOP_LOAD_FILE" ), QIcon(), tr( "MEN_LOAD_FILE" ),
183 tr( "STB_LOAD_FILE" ), 0, desk, false, this, SLOT( onLoadFile() ) );
184 createAction( lgDisplayLine, tr( "TOP_DISPLAY_LINE" ), QIcon(), tr( "MEN_DISPLAY_LINE" ),
185 tr( "STB_DISPLAY_LINE" ), 0, desk, false, this, SLOT( onDisplayLine() ) );
186 createAction( lgEraseLine, tr( "TOP_ERASE_LINE" ), QIcon(), tr( "MEN_ERASE_LINE" ),
187 tr( "STB_ERASE_LINE" ), 0, desk, false, this, SLOT( onEraseLine() ) );
188 createAction( lgSaveFile, tr( "TOP_SAVE_FILE" ), QIcon(), tr( "MEN_SAVE_FILE" ),
189 tr( "STB_SAVE_FILE" ), 0, desk, false, this, SLOT( onSaveFile() ) );
190 createAction( lgEditLine, tr( "TOP_EDIT_LINE" ), QIcon(), tr( "MEN_EDIT_LINE" ),
191 tr( "STB_EDIT_LINE" ), 0, desk, false, this, SLOT( onEditLine() ) );
192 createAction( lgAddLine, tr( "TOP_ADD_LINE" ), QIcon(), tr( "MEN_ADD_LINE" ),
193 tr( "STB_ADD_LINE" ), 0, desk, false, this, SLOT( onAddLine() ) );
194 createAction( lgDelLine, tr( "TOP_DEL_LINE" ), QIcon(), tr( "MEN_DEL_LINE" ),
195 tr( "STB_DEL_LINE" ), 0, desk, false, this, SLOT( onDelLine() ) );
196 createAction( lgClear, tr( "TOP_CLEAR_ALL" ), QIcon(), tr( "MEN_CLEAR_ALL" ),
197 tr( "STB_CLEAR_ALL" ), 0, desk, false, this, SLOT( onClear() ) );
199 int aFileMnu = createMenu( tr( "MEN_FILE" ), -1, -1 );
200 createMenu( separator(), aFileMnu, -1, 10 );
201 createMenu( lgLoadFile, aFileMnu, 10 );
202 createMenu( lgSaveFile, aFileMnu, 10 );
204 int aLightMnu = createMenu( tr( "MEN_LIGHT" ), -1, -1, 50 );
205 createMenu( lgAddLine, aLightMnu, 10 );
206 createMenu( lgEditLine, aLightMnu, 10 );
207 createMenu( lgDelLine, aLightMnu, 10 );
208 createMenu( separator(), aLightMnu, -1, 10 );
209 createMenu( lgClear, aLightMnu, 10 );
211 QString rule = "(client='ObjectBrowser' or client='OCCViewer') and selcount=1 and type='TextLine' and !empty";
213 popupMgr()->insert ( action( lgDisplayLine ), -1, 0 );
214 popupMgr()->setRule( action( lgDisplayLine ), rule + " and !visible" );
216 popupMgr()->insert ( action( lgEraseLine ), -1, 0 );
217 popupMgr()->setRule( action( lgEraseLine ), rule + " and activeView='OCCViewer' and visible" );
219 rule = "client='ObjectBrowser' and selcount=1 and type='TextLine'";
221 popupMgr()->insert ( action( lgEditLine ), -1, 0 );
222 popupMgr()->setRule( action( lgEditLine ), rule );
224 popupMgr()->insert ( action( lgAddLine ), -1, 0 );
225 popupMgr()->setRule( action( lgAddLine ), rule );
227 popupMgr()->insert ( separator(), -1, 0 );
229 popupMgr()->insert ( action( lgDelLine ), -1, 0 );
230 popupMgr()->setRule( action( lgDelLine ), rule );
232 rule = "client='ObjectBrowser'";
234 popupMgr()->insert ( action( lgClear ), -1, 0 );
235 popupMgr()->setRule( action( lgClear ), rule );*/
239 \brief Get list of compliant dockable GUI elements
240 \param m map to be filled in ("type":"default_position")
242 void PVGUI_Module::windows( QMap<int, int>& m ) const
244 m.insert( LightApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea );
245 // TODO: creation of Python console leads to SIGSEGV on Python initialization...
246 //m.insert( LightApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea );
247 // ParaView diagnostic output redirected here
248 m.insert( LightApp_Application::WT_LogWindow, Qt::BottomDockWidgetArea );
252 \brief Create custom popup menu selection object.
253 \return new selected object
255 /*LightApp_Selection* PVGUI_Module::createSelection() const
257 return new PVGUI_Selection();
261 \brief Create data model.
262 \return module specific data model
264 /*CAM_DataModel* PVGUI_Module::createDataModel()
266 return new PVGUI_DataModel( this );
270 \brief Static method, performs initialization of ParaView session.
271 \return \c true if ParaView has been initialized successfully, otherwise false
273 bool PVGUI_Module::pvInit()
275 if ( !pqImplementation::myPVMain ){
276 // Obtain command-line arguments
278 QStringList args = QApplication::arguments();
279 char** argv = new char*[args.size()];
280 for ( QStringList::const_iterator it = args.begin(); argc < 1 && it != args.end(); it++, argc++ )
281 argv[argc] = strdup( (*it).toLatin1().constData() );
283 vtkPVMain::SetInitializeMPI(0); // pvClient never runs with MPI.
284 vtkPVMain::Initialize(&argc, &argv); // Perform any initializations.
286 // TODO: Set plugin dir from preferences
287 //QApplication::setLibraryPaths(QStringList(dir.absolutePath()));
289 pqImplementation::myPVMain = vtkPVMain::New();
290 if ( !pqImplementation::myPVOptions )
291 pqImplementation::myPVOptions = pqOptions::New();
292 if ( !pqImplementation::myPVHelper )
293 pqImplementation::myPVHelper = PVGUI_ProcessModuleHelper::New();
295 pqImplementation::myPVOptions->SetProcessType(vtkPVOptions::PVCLIENT);
297 // This creates the Process Module and initializes it.
298 int ret = pqImplementation::myPVMain->Initialize(pqImplementation::myPVOptions,
299 pqImplementation::myPVHelper,
300 ParaViewInitializeInterpreter,
303 // Tell process module that we support Multiple connections.
304 // This must be set before starting the event loop.
305 vtkProcessModule::GetProcessModule()->SupportMultipleConnectionsOn();
306 ret = pqImplementation::myPVHelper->Run(pqImplementation::myPVOptions);
317 \brief Static method, cleans up ParaView session at application exit.
319 void PVGUI_Module::pvShutdown()
325 \brief Shows (toShow = true) or hides ParaView view window
327 void PVGUI_Module::showView( bool toShow )
329 // TODO: check if ParaView view already exists
330 if ( !Implementation ){
331 LightApp_Application* anApp = getApp();
332 SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
333 PVGUI_ViewManager* viewMgr = new PVGUI_ViewManager( anApp->activeStudy(), anApp->desktop() );
334 anApp->addViewManager( viewMgr );
335 connect( viewMgr, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
336 anApp, SLOT( onCloseView( SUIT_ViewManager* ) ) );
337 //connect( viewMgr, SIGNAL( viewCreated( SUIT_ViewWindow* ) ), vm, SLOT( onViewCreated( SUIT_ViewWindow* ) ) );
338 //connect( viewMgr, SIGNAL( deleteView( SUIT_ViewWindow* ) ), this, SLOT( onViewDeleted( SUIT_ViewWindow* ) ) );
339 SUIT_ViewWindow* wnd = viewMgr->createViewWindow();
341 // Simulate ParaView client main window
342 Implementation = new pqImplementation( anApp->desktop() );
343 PVGUI_ViewWindow* pvWnd = dynamic_cast<PVGUI_ViewWindow*>( wnd );
344 pvWnd->setMultiViewManager( &Implementation->Core.multiViewManager() );
352 setupDockWidgetsContextMenu();
354 // Now that we're ready, initialize everything ...
355 Implementation->Core.initializeStates();
360 \brief Manage the label of Undo operation.
362 void PVGUI_Module::onUndoLabel( const QString& label )
364 action(UndoId)->setText(
365 label.isEmpty() ? tr("Can't Undo") : QString(tr("&Undo %1")).arg(label));
366 action(UndoId)->setStatusTip(
367 label.isEmpty() ? tr("Can't Undo") : QString(tr("Undo %1")).arg(label));
371 \brief Manage the label of Redo operation.
373 void PVGUI_Module::onRedoLabel( const QString& label )
375 action(RedoId)->setText(
376 label.isEmpty() ? tr("Can't Redo") : QString(tr("&Redo %1")).arg(label));
377 action(RedoId)->setStatusTip(
378 label.isEmpty() ? tr("Can't Redo") : QString(tr("Redo %1")).arg(label));
382 \brief Manage the label of Undo Camera operation.
384 void PVGUI_Module::onCameraUndoLabel( const QString& label )
386 action(CameraUndoId)->setText(
387 label.isEmpty() ? tr("Can't Undo Camera") : QString(tr("U&ndo %1")).arg(label));
388 action(CameraUndoId)->setStatusTip(
389 label.isEmpty() ? tr("Can't Undo Camera") : QString(tr("Undo %1")).arg(label));
393 \brief Manage the label of Redo Camera operation.
395 void PVGUI_Module::onCameraRedoLabel( const QString& label )
397 action(CameraRedoId)->setText(
398 label.isEmpty() ? tr("Can't Redo Camera") : QString(tr("R&edo %1")).arg(label));
399 action(CameraRedoId)->setStatusTip(
400 label.isEmpty() ? tr("Can't Redo Camera") : QString(tr("Redo %1")).arg(label));
404 \brief Slot to delete all objects.
406 void PVGUI_Module::onDeleteAll()
408 pqObjectBuilder* builder = pqApplicationCore::instance()->getObjectBuilder();
409 Implementation->Core.getApplicationUndoStack()->beginUndoSet("Delete All");
410 builder->destroyPipelineProxies();
411 Implementation->Core.getApplicationUndoStack()->endUndoSet();
415 \brief Slot to check/uncheck the action for corresponding selection mode.
417 void PVGUI_Module::onSelectionModeChanged( int mode )
419 if( toolMgr()->toolBar( mySelectionControlsTb )->isEnabled() ) {
420 if(mode == pqRubberBandHelper::SELECT) //surface selection
421 action(SelectCellsOnId)->setChecked(true);
422 else if(mode == pqRubberBandHelper::SELECT_POINTS) //surface selection
423 action(SelectPointsOnId)->setChecked(true);
424 else if(mode == pqRubberBandHelper::FRUSTUM)
425 action(SelectCellsThroughId)->setChecked(true);
426 else if(mode == pqRubberBandHelper::FRUSTUM_POINTS)
427 action(SelectPointsThroughId)->setChecked(true);
428 else if (mode == pqRubberBandHelper::BLOCKS)
429 action(SelectBlockId)->setChecked(true);
431 action(InteractId)->setChecked(true);
436 \brief Slot to manage the change of axis center.
438 void PVGUI_Module::onShowCenterAxisChanged( bool enabled )
440 action(ShowCenterId)->setEnabled(enabled);
441 action(ShowCenterId)->blockSignals(true);
442 pqRenderView* renView = qobject_cast<pqRenderView*>(
443 pqActiveView::instance().current());
444 action(ShowCenterId)->setChecked( renView ? renView->getCenterAxesVisibility() : false);
445 action(ShowCenterId)->blockSignals(false);
449 \brief Slot to set tooltips for the first anf the last frames, i.e. a time range of animation.
451 void PVGUI_Module::setTimeRanges( double start, double end )
453 action(FirstFrameId)->setToolTip(QString("First Frame (%1)").arg(start, 0, 'g'));
454 action(LastFrameId)->setToolTip(QString("Last Frame (%1)").arg(end, 0, 'g'));
458 \brief Slot to manage the plaing process of animation.
460 void PVGUI_Module::onPlaying( bool playing )
462 SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
464 disconnect( action(PlayId), SIGNAL( triggered() ),
465 &Implementation->Core.VCRController(), SLOT( onPlay() ) );
466 connect( action(PlayId), SIGNAL( triggered() ),
467 &Implementation->Core.VCRController(), SLOT( onPause() ) );
468 action(PlayId)->setIcon(QIcon(resMgr->loadPixmap("ParaView",tr("ICON_PAUSE"),false)));
469 action(PlayId)->setText("Pa&use");
472 connect( action(PlayId), SIGNAL( triggered() ),
473 &Implementation->Core.VCRController(), SLOT( onPlay() ) );
474 disconnect( action(PlayId), SIGNAL( triggered() ),
475 &Implementation->Core.VCRController(), SLOT( onPause() ) );
476 action(PlayId)->setIcon(QIcon(resMgr->loadPixmap("ParaView",tr("ICON_PLAY"),false)));
477 action(PlayId)->setText("&Play");
480 Implementation->Core.setSelectiveEnabledState(!playing);
484 \brief Slot to add camera link.
486 void PVGUI_Module::onAddCameraLink()
488 pqView* vm = pqActiveView::instance().current();
489 pqRenderView* rm = qobject_cast<pqRenderView*>(vm);
490 if(rm) rm->linkToOtherView();
491 else SUIT_MessageBox::warning(getApp()->desktop(),
492 tr("WARNING"), tr("WRN_ADD_CAMERA_LINK"));
496 \brief Slot to show information about ParaView.
498 void PVGUI_Module::onHelpAbout()
500 pqClientAboutDialog* const dialog = new pqClientAboutDialog(getApp()->desktop());
501 dialog->setAttribute(Qt::WA_DeleteOnClose);
506 \brief Slot to show help for proxy.
508 void PVGUI_Module::showHelpForProxy( const QString& proxy )
510 // make sure assistant is ready
511 this->makeAssistant();
513 if(this->Implementation->AssistantClient) {
514 this->Implementation->AssistantClient->openAssistant();
515 QString page("%1/Documentation/%2.html");
516 page = page.arg(this->Implementation->DocumentationDir);
517 page = page.arg(proxy);
518 this->Implementation->AssistantClient->showPage(page);
522 QString Locate( const QString& appName )
524 QString app_dir = QCoreApplication::applicationDirPath();
525 const char* inst_dirs[] = {
531 for (const char** dir = inst_dirs; *dir; ++dir) {
532 QString path = app_dir;
535 //cout << "Checking : " << path.toAscii().data() << " ... ";
537 QFileInfo finfo (path);
538 if (finfo.exists()) {
539 //cout << " Success!" << endl;
542 //cout << " Failed" << endl;
544 return app_dir + QDir::separator() + appName;
548 \brief Initialized an assistant client.
550 void PVGUI_Module::makeAssistant()
552 if(this->Implementation->AssistantClient)
555 QString assistantExe;
558 const char* assistantName = "assistant";
560 const char* extString = ".exe";
561 const char* binDir = "\\";
562 const char* binDir1 = "\\..\\";
564 const char* extString = "";
565 const char* binDir = "/";
566 const char* binDir1 = "/";
569 QString assistantProgName;
570 assistantProgName = assistantProgName + assistantName + extString;
572 QString helper = QCoreApplication::applicationDirPath() + binDir + QString("pqClientDocFinder.txt");
573 if(!QFile::exists(helper))
574 helper = QCoreApplication::applicationDirPath() + binDir1 + QString("pqClientDocFinder.txt");
575 if(QFile::exists(helper)) {
577 if(file.open(QIODevice::ReadOnly)) {
578 assistantExe = file.readLine().trimmed() + assistantProgName;
579 profileFile = file.readLine().trimmed();
583 if(assistantExe.isEmpty()) {
584 assistantExe = ::Locate(assistantProgName);
586 QString assistant = QCoreApplication::applicationDirPath();
587 assistant += QDir::separator();
588 assistant += assistantName;
589 assistantExe = assistant;
593 this->Implementation->AssistantClient = new QAssistantClient(assistantExe, this);
594 QObject::connect(this->Implementation->AssistantClient, SIGNAL(error(const QString&)),
595 this, SLOT(assistantError(const QString&)));
598 args.append(QString("-profile"));
600 if(profileFile.isEmpty()) {
601 // see if help is bundled up with the application
602 QString profile = ::Locate("pqClient.adp");
603 /*QCoreApplication::applicationDirPath() + QDir::separator()
604 + QString("pqClient.adp");*/
606 if(QFile::exists(profile))
607 profileFile = profile;
610 if(profileFile.isEmpty() && getenv("PARAVIEW_HELP")) {
611 // not bundled, ask for help
612 args.append(getenv("PARAVIEW_HELP"));
614 else if(profileFile.isEmpty()) {
615 // no help, error out
616 SUIT_MessageBox::critical(getApp()->desktop(),"Help error", "Couldn't find"
617 " pqClient.adp.\nTry setting the PARAVIEW_HELP environment variable which"
618 " points to that file");
619 delete this->Implementation->AssistantClient;
623 QFileInfo fi(profileFile);
624 this->Implementation->DocumentationDir = fi.absolutePath();
626 args.append(profileFile);
628 this->Implementation->AssistantClient->setArguments(args);
632 \brief Slot to call the message handler with the critical message.
634 void PVGUI_Module::assistantError( const QString& error )
636 qCritical(error.toAscii().data());
640 \brief Slot to show the waiting state.
642 void PVGUI_Module::onPreAccept()
644 getApp()->desktop()->statusBar()->showMessage(tr("Updating..."));
645 QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
649 \brief Slot to show the ready state.
651 void PVGUI_Module::onPostAccept()
653 getApp()->desktop()->statusBar()->showMessage(tr("Ready"), 2000);
654 QTimer::singleShot(0, this, SLOT(endWaitCursor()));
658 \brief Slot to switch off wait cursor.
660 void PVGUI_Module::endWaitCursor()
662 QApplication::restoreOverrideCursor();
666 \brief Returns the ParaView multi-view manager.
668 pqViewManager* PVGUI_Module::getMultiViewManager() const
670 pqViewManager* aMVM = 0;
671 if ( Implementation )
672 aMVM = &Implementation->Core.multiViewManager();
677 \brief Activate module.
678 \param study current study
679 \return \c true if activaion is done successfully or 0 to prevent
682 bool PVGUI_Module::activateModule( SUIT_Study* study )
684 bool isDone = LightApp_Module::activateModule( study );
685 if ( !isDone ) return false;
687 setMenuShown( true );
691 // Make default server connection
692 if ( Implementation )
693 Implementation->Core.makeDefaultConnectionIfNoneExists();
700 \brief Deactivate module.
701 \param study current study
702 \return \c true if deactivaion is done successfully or 0 to prevent
703 deactivation on error
705 bool PVGUI_Module::deactivateModule( SUIT_Study* study )
708 setMenuShown( false );
710 return LightApp_Module::deactivateModule( study );
714 \fn CAM_Module* createModule();
715 \brief Export module instance (factory function).
716 \return new created instance of the module
720 #define PVGUI_EXPORT __declspec(dllexport)
726 PVGUI_EXPORT CAM_Module* createModule() {
727 return new PVGUI_Module();