Salome HOME
Update version to 3.2.0a1
[modules/visu.git] / src / VISUGUI / VisuGUI_Module.h
1 //  VISU VISUGUI : GUI of VISU component
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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
21 //
22 //
23 //
24 //  File   : VisuGUI_Module.h
25 //  Author : 
26 //  Module : VISU
27 //  $Header$
28
29 #ifndef VisuGUI_Module_HeaderFile
30 #define VisuGUI_Module_HeaderFile
31
32 #include "VisuGUI.h"
33 #include "STD_Application.h"
34 #include "SALOMEDSClient_SObject.hxx"
35
36 class SUIT_ViewManager;
37 class SVTK_ViewManager;
38 class SVTK_ViewWindow;
39
40 #include "MED_SharedPtr.hxx"
41
42 namespace VISU
43 {
44   class Viewer;
45   typedef MED::SharedPtr<Viewer> PViewer;
46   
47   typedef std::map<SUIT_ViewManager*,PViewer> TViewerMap;
48 }
49
50 //! This class inherits base VisuGUI.
51 /*! Used to display, erase end edit presentations in the VVTK viewer. */
52 class VisuGUI_Module: public VisuGUI
53 {
54   Q_OBJECT;
55
56   friend class VISU::Viewer;
57
58 public:
59   VisuGUI_Module();
60
61   virtual
62   ~VisuGUI_Module();
63
64   virtual
65   bool
66   eventFilter( QObject * theWatched, QEvent * theEvent );
67
68   //! Redifined method of the module initializing.
69   virtual
70   void
71   initialize( CAM_Application* );
72
73   //! Redefined method of creating prefernces.
74   virtual 
75   void 
76   createPreferences();
77
78   virtual
79   void
80   preferencesChanged( const QString&, const QString& );
81
82   virtual
83   SUIT_ViewManager*
84   getViewManager(const QString& theType, 
85                  const bool theIsCreate);
86
87 public slots:
88   //! Reimplemented method of the module deactivation.
89   virtual 
90   bool
91   deactivateModule( SUIT_Study* );
92
93   //! Reimplemented method of the module activation.
94   virtual 
95   bool
96   activateModule( SUIT_Study* );
97
98 protected:
99   //! Create preferences for Gauss Points presentation.
100   virtual 
101   void 
102   createGaussPointsPreferences();
103
104   //! Create preferences for Outside Cursor Gauss Points presentations.
105   virtual 
106   void 
107   createInsideCursorPreferences();
108
109   virtual 
110   void 
111   createOutsideCursorPreferences();
112
113   //! Create preferences for Picking.
114   virtual 
115   void 
116   createPickingPreferences();
117
118   //! Create preferences for Space Mouse.
119   virtual 
120   void 
121   createSpaceMousePreferences();
122
123   //! Create preferences for Recorder.
124   virtual 
125   void 
126   createRecorderPreferences();
127
128 protected slots:
129   SUIT_ViewManager*
130   onCreateViewManager();
131
132   void
133   onLastViewClosed(SUIT_ViewManager*);
134
135   void
136   OnCreateGaussPoints();
137
138   void
139   OnViewCreated(SUIT_ViewWindow*);
140
141   void 
142   OnViewManagerAdded(SUIT_ViewManager*);
143
144   //! Reimplemented method of the Gauss Points edition.
145   virtual
146   void
147   OnEditGaussPoints();
148
149   //! Reimplemented method of the Gauss Points displaying.
150   virtual 
151   void
152   OnDisplayPrs();
153
154   //! Reimplemented method of the Gauss Points displaying only.
155   virtual 
156   void
157   OnDisplayOnlyPrs();
158
159   //! Reimplemented method of the Gauss Points full erasing.
160   virtual
161   void
162   OnEraseAll();
163
164   //! Reimplemented method of the Gauss Points erasing.
165   virtual
166   void
167   OnErasePrs();
168
169   //! Virtual method of saving configuration.
170   virtual
171   void
172   OnSaveConfiguration();
173
174   //! Virtual method of overwriting configuration.
175   virtual
176   void
177   OnOverwriteConfiguration();
178
179   //! Virtual method of restoring configuration.
180   virtual
181   void
182   OnRestoreConfiguration();
183
184 protected:
185   VISU::TViewerMap myViewerMap;
186   _PTR(SObject) myConfigSObject;
187
188   void setProperty( SVTK_ViewWindow*, const QString& );  // set a property (speed_increment, etc ) for SVTK ViewWindow
189   void setProperty( SVTK_ViewManager*, const QString& ); // set a property for SVTK ViewWindow // set only 1 property for all ViewWindows of given view manager
190 };
191
192 #endif