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