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