Salome HOME
Fix for the "0051899: curves are not shown in opened study" issue.
[modules/visu.git] / src / VISUGUI / VisuGUI.h
1 // Copyright (C) 2007-2013  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   virtual bool renameAllowed( const QString& ) const;
89   virtual bool renameObject( const QString&, const QString& );
90   
91
92 signals:
93   void moduleDeactivated();
94   void moduleActivated();
95   void presentationCreated(VISU::Prs3d_i* thePrs);
96   void beforeObjectDelete(QString theEntry);
97
98 public slots:
99   virtual bool deactivateModule( SUIT_Study* );
100   virtual bool activateModule( SUIT_Study* );
101   virtual void OnEraseAll();
102
103 protected slots:
104   void OnImportFromFile();
105   void OnImportFromSauvFile();
106   void OnImportTableFromFile();
107   void OnExportTableToFile();
108   void OnImportMedField();
109
110   void OnLoadComponentData();
111
112   void OnCreateMesh();
113   void OnCreateScalarMap();
114   void OnCreateDeformedShape();
115   void OnCreateVectors();
116   void OnCreateIsoSurfaces();
117   void OnCreateCutPlanes();
118   void OnCreateCutLines();
119   void OnCreateCutSegment();
120   void OnCreateStreamLines();
121   void OnCreatePlot3D();
122   void OnCreateManyMesh();
123   void OnCreatePlot2dView();
124   void OnCreateDeformedShapeAndScalarMap();
125
126   void OnEditScalarMap();
127   void OnEditDeformedShape();
128   void OnEditCutPlanes();
129   void OnEditCutLines();
130   void OnEditCutSegment();
131   void OnEditIsoSurfaces();
132   void OnEditVectors();
133   void OnEditStreamLines();
134   void OnEditPlot3D();
135   void OnEditDeformedShapeAndScalarMap();
136
137   virtual void OnDisplayPrs();
138   virtual void OnDisplayOnlyPrs();
139   virtual void OnErasePrs();
140   //  virtual void OnEraseAll();
141
142   void OnToggleSelectionPanel();
143   void OnSwitchSelectionMode();
144   void OnSwitchSelectionMode( int );
145
146   void OnMakeSurfaceframe();
147   void OnMakeInsideframe();
148   void OnMakeWireframe();
149   void OnMakeSurface();
150   void OnMakePoints();
151   void OnMakeShrink();
152
153   void OnMakeFeatureEdges();
154
155   void OnSetShadingOn();
156   void OnSetShadingOff();
157
158   void OnChangeColor();
159   void OnChangeWireframeColor();
160   void OnChangeOpacity();
161   void OnChangeLines();
162   void OnChangePointMarker();
163   void OnChangeShrinkFactor();
164
165   void OnShowTable();
166   void OnShowTablePlot();
167   void OnShowScalarBar();
168   void OnHideScalarBar();
169   void OnCreateTable();
170   void OnDeleteObjects();
171   void OnPlotData();
172   void OnCurveProperties();
173   void OnCurveScale();
174   void OnClearContainer();
175   void OnEditContainer();
176
177   void OnMergeScalarBars();
178   void OnFreeScalarBars();
179
180   virtual void OnSaveViewParams();
181   virtual void OnRestoreViewParams();
182
183   void OnClippingPlanes();
184   void OnSweep();
185   void OnParallelTimeAnimation();
186   void OnSucccessiveTimeAnimation();
187   void OnShowAnimation();
188
189   void OnPointEvolution();
190   void OnShowEvolution();
191
192   void OnCopyPresentation();
193
194   void OnTranslatePrs();
195   void OnArrangeActors();
196   void OnPlot3dFromCutPlane();
197
198   void OnManageCache();
199
200   void OnFilterScalars();
201   
202   void OnValuesLabeling();
203   void OnValuesLabelingParams();
204
205   void OnArcQuadMode();
206   void OnLineQuadMode();
207
208   void OnShowDeviation();
209
210   // MULTIPR
211   void OnMultiprViewFullRes();
212   void OnMultiprViewMediumRes();
213   void OnMultiprViewLowRes();
214   void OnMultiprViewHide();
215   void OnMultiprChangeRes(VISU::Result::Resolution theResolution);
216
217   void OnFileInfo();
218   void OnExportMED();
219
220 protected:
221   virtual LightApp_Selection* createSelection() const;
222
223   virtual void processPresentationCreated( VISU::Prs3d_i* thePrs );
224
225   void OnTimeAnimation(VISU::Animation::AnimationMode theMode);
226
227 private:
228   void createActions();
229   void createMenus();
230   void createToolBars();
231   void createPopupMenus();
232   void createPanels();
233   void SetScalarBarVisibility( bool );
234   void activateAppropriateViewer( Handle(SALOME_InteractiveObject) theIO );
235   int  addVtkFontPref( const QString& label, const int pId, const QString& param, const bool useSize );
236
237 private:
238   QMap<int,VisuGUI_Panel*> myPanels;
239   VisuGUI_Slider*          mySlider;
240   VisuGUI_Sweep*           mySweep; 
241
242   LightApp_Displayer*      myDisplayer;
243   VISU::TViewToPrs3d       myScalarBarsMap;
244 };
245
246 #endif