]> SALOME platform Git repositories - modules/visu.git/blob - src/VISUGUI/VisuGUI.h
Salome HOME
Merge from V5_1_main 14/05/2010
[modules/visu.git] / src / VISUGUI / VisuGUI.h
1 //  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  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
23 //  VISU VISUGUI : GUI of VISU component
24 //  File   : VisuGUI.h
25 //  Author : Laurent CORNABE & Hubert ROLLAND
26 //  Module : VISU
27 //
28 #ifndef VisuGUI_HeaderFile
29 #define VisuGUI_HeaderFile
30
31 #include <SalomeApp_Module.h>
32
33 #include <SVTK_ViewWindow.h>
34 #include <VISU_Prs3d_i.hh>
35
36 #include "VisuGUI_Panel.h"
37
38 #include <map>
39 #include <set>
40
41 class SUIT_ViewManager;
42 class VisuGUI_Slider;
43 class VisuGUI_Sweep;
44
45 namespace VISU
46 {
47   class Prs3d_i;
48   typedef std::pair<Prs3d_i*,int> TPrs3dToInd; // prs pointer and default index of scalar bar placement
49   typedef std::set<TPrs3dToInd> TSetPrs3d;
50   typedef std::map<SVTK_ViewWindow*,TSetPrs3d> TViewToPrs3d;
51 }
52
53 class VisuGUI: public SalomeApp_Module
54 {
55   Q_OBJECT;
56
57 public:
58   enum PanelId { SelectionPanelId = 0,
59                  FeatureEdgesPanelId,
60                  ClippingPlanesPanelId };
61
62 public:
63   VisuGUI();
64   virtual ~VisuGUI();
65
66   virtual LightApp_Displayer*    displayer();
67   virtual void initialize( CAM_Application* );
68   virtual void windows( QMap<int, int>& ) const;
69   virtual void viewManagers( QStringList& ) const;
70
71   virtual QString engineIOR() const;
72
73   virtual void  studyActivated();
74
75   virtual void  contextMenuPopup( const QString& theClient, QMenu* theMenu, QString& theTitle );
76
77   virtual void createPreferences();
78   virtual void preferencesChanged( const QString&, const QString& );
79
80   virtual
81   SUIT_ViewManager*
82   getViewManager(const QString& theType, 
83                  const bool theIsCreate);
84
85   VISU::TViewToPrs3d&
86   getScalarBarsMap();
87
88 signals:
89   void moduleDeactivated();
90   void moduleActivated();
91   void presentationCreated(VISU::Prs3d_i* thePrs);
92   void beforeObjectDelete(QString theEntry);
93
94 public slots:
95   virtual bool deactivateModule( SUIT_Study* );
96   virtual bool activateModule( SUIT_Study* );
97   virtual void OnEraseAll();
98
99 protected slots:
100   void OnImportFromFile();
101   void OnImportTableFromFile();
102   void OnExportTableToFile();
103   void OnImportMedField();
104
105   void OnLoadComponentData();
106
107   void OnCreateMesh();
108   void OnCreateScalarMap();
109   void OnCreateDeformedShape();
110   void OnCreateVectors();
111   void OnCreateIsoSurfaces();
112   void OnCreateCutPlanes();
113   void OnCreateCutLines();
114   void OnCreateCutSegment();
115   void OnCreateStreamLines();
116   void OnCreatePlot3D();
117   void OnCreateManyMesh();
118   void OnCreatePlot2dView();
119   void OnCreateDeformedShapeAndScalarMap();
120
121   void OnEditScalarMap();
122   void OnEditDeformedShape();
123   void OnEditCutPlanes();
124   void OnEditCutLines();
125   void OnEditCutSegment();
126   void OnEditIsoSurfaces();
127   void OnEditVectors();
128   void OnEditStreamLines();
129   void OnEditPlot3D();
130   void OnEditDeformedShapeAndScalarMap();
131
132   virtual void OnDisplayPrs();
133   virtual void OnDisplayOnlyPrs();
134   virtual void OnErasePrs();
135   //  virtual void OnEraseAll();
136
137   void OnToggleSelectionPanel();
138   void OnSwitchSelectionMode();
139   void OnSwitchSelectionMode( int );
140
141   void OnMakeSurfaceframe();
142   void OnMakeInsideframe();
143   void OnMakeWireframe();
144   void OnMakeSurface();
145   void OnMakePoints();
146   void OnMakeShrink();
147
148   void OnMakeFeatureEdges();
149
150   void OnSetShadingOn();
151   void OnSetShadingOff();
152
153   void OnChangeColor();
154   void OnChangeWireframeColor();
155   void OnChangeOpacity();
156   void OnChangeLines();
157   void OnChangePointMarker();
158   void OnChangeShrinkFactor();
159
160   void OnShowTable();
161   void OnShowTablePlot();
162   void OnShowScalarBar();
163   void OnHideScalarBar();
164   void OnCreateTable();
165   void OnDeleteObjects();
166   void OnPlotData();
167   void OnCurveProperties();
168   void OnClearContainer();
169   void OnEditContainer();
170
171   void OnMergeScalarBars();
172   void OnFreeScalarBars();
173
174   virtual void OnSaveViewParams();
175   virtual void OnRestoreViewParams();
176
177   void OnRename();
178   void OnClippingPlanes();
179   void OnSweep();
180   void OnParallelTimeAnimation();
181   void OnSucccessiveTimeAnimation();
182   void OnShowAnimation();
183
184   void OnPointEvolution();
185   void OnShowEvolution();
186
187   void OnCopyPresentation();
188
189   void OnTranslatePrs();
190   void OnArrangeActors();
191   void OnPlot3dFromCutPlane();
192
193   void OnManageCache();
194
195   void OnFilterScalars();
196   
197   void OnValuesLabeling();
198   void OnValuesLabelingParams();
199
200   void OnArcQuadMode();
201   void OnLineQuadMode();
202
203   // MULTIPR
204   void OnMultiprViewFullRes();
205   void OnMultiprViewMediumRes();
206   void OnMultiprViewLowRes();
207   void OnMultiprViewHide();
208   void OnMultiprChangeRes(VISU::Result::Resolution theResolution);
209
210   void OnFileInfo();
211   void OnExportMED();
212
213 protected:
214   virtual LightApp_Selection* createSelection() const;
215
216   void OnTimeAnimation(VISU::Animation::AnimationMode theMode);
217
218 private:
219   void createActions();
220   void createMenus();
221   void createToolBars();
222   void createPopupMenus();
223   void createPanels();
224   void SetScalarBarVisibility( bool );
225   void activateAppropriateViewer( Handle(SALOME_InteractiveObject) theIO );
226   int  addVtkFontPref( const QString& label, const int pId, const QString& param, const bool useSize );
227
228 private:
229   QMap<int,VisuGUI_Panel*> myPanels;
230   VisuGUI_Slider*          mySlider;
231   VisuGUI_Sweep*           mySweep; 
232
233   LightApp_Displayer*      myDisplayer;
234   VISU::TViewToPrs3d       myScalarBarsMap;
235 };
236
237 #endif