Salome HOME
Wrapping pqViewManager in SALOME view manager - part 2: create a built-in server...
[modules/paravis.git] / src / PVGUI / PVGUI_Module.h
1 // PARAVIS : ParaView wrapper SALOME module
2 //
3 // Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 // File   : PVGUI_Module.h
23 // Author : Sergey ANIKIN
24 //
25
26 #ifndef PVGUI_Module_H
27 #define PVGUI_Module_H
28
29 #include <LightApp_Module.h>
30
31 class QMenu;
32 class LightApp_Selection;
33 class LightApp_SelectionMgr;
34 class PVGUI_ProcessModuleHelper;
35 class vtkPVMain;
36 class pqOptions;
37 class pqServer;
38 class pqActiveServer;
39 class pqViewManager;
40
41 class PVGUI_Module : public LightApp_Module
42 {
43   Q_OBJECT
44    
45   //! Menu actions
46   /*enum { 
47     lgLoadFile = 931,   //!< load text file
48     lgSaveFile,         //!< save text file
49     lgDisplayLine,      //!< display selected line
50     lgEraseLine,        //!< erase selected line
51     lgEditLine,         //!< edit selected line
52     lgAddLine,          //!< insert new line
53     lgDelLine,          //!< delete selected line
54     lgClear             //!< clear all contents
55     };*/
56
57 public:
58   PVGUI_Module();
59   ~PVGUI_Module();
60
61   virtual void           initialize( CAM_Application* );
62   virtual void           windows( QMap<int, int>& ) const;
63
64   //virtual LightApp_Selection* createSelection() const;
65
66   pqServer*              getActiveServer() const;
67   pqViewManager*         getMultiViewManager() const;
68
69 protected:
70   //virtual CAM_DataModel* createDataModel();
71
72 private:
73   //! Initialize ParaView if not yet done (once per session)
74   static bool            pvInit();  
75   //! Shutdown ParaView, should be called on application exit
76   static void            pvShutdown();   
77  
78   //! Create actions for ParaView GUI operations
79   //! duplicating menus and toolbars in pqMainWindow ParaView class
80   void                   pvCreateActions();  
81
82   //! Shows or hides ParaView view window
83   void                   showView( bool );         
84
85   void                   makeDefaultConnectionIfNoneExists();
86
87 public slots:
88   virtual bool           activateModule( SUIT_Study* );
89   virtual bool           deactivateModule( SUIT_Study* );
90
91 private:
92   static vtkPVMain*                 myPVMain;
93   static pqOptions*                 myPVOptions;
94   static PVGUI_ProcessModuleHelper* myPVHelper;
95
96   //! pqMainWindowCore stuff
97   pqActiveServer*                   myActiveServer;
98 };
99
100 #endif // PVGUI_Module_H