1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // VISU VISUGUI : GUI of VISU component
24 // Author : Laurent CORNABE & Hubert ROLLAND
27 #ifndef VisuGUI_HeaderFile
28 #define VisuGUI_HeaderFile
30 #include <SalomeApp_Module.h>
32 #include <SVTK_ViewWindow.h>
33 #include <VISU_Prs3d_i.hh>
35 #include "VisuGUI_Panel.h"
40 class SUIT_ViewManager;
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;
52 class VisuGUI: public SalomeApp_Module
57 enum PanelId { SelectionPanelId = 0,
59 ClippingPlanesPanelId };
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;
70 virtual QString engineIOR() const;
72 virtual void studyActivated();
74 virtual void contextMenuPopup( const QString& theClient, QMenu* theMenu, QString& theTitle );
76 virtual void createPreferences();
77 virtual void preferencesChanged( const QString&, const QString& );
81 getViewManager(const QString& theType,
82 const bool theIsCreate);
88 void moduleDeactivated();
89 void moduleActivated();
90 void presentationCreated(VISU::Prs3d_i* thePrs);
91 void beforeObjectDelete(QString theEntry);
94 virtual bool deactivateModule( SUIT_Study* );
95 virtual bool activateModule( SUIT_Study* );
96 virtual void OnEraseAll();
99 void OnImportFromFile();
100 void OnImportTableFromFile();
101 void OnExportTableToFile();
102 void OnImportMedField();
104 void OnLoadComponentData();
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();
120 void OnEditScalarMap();
121 void OnEditDeformedShape();
122 void OnEditCutPlanes();
123 void OnEditCutLines();
124 void OnEditCutSegment();
125 void OnEditIsoSurfaces();
126 void OnEditVectors();
127 void OnEditStreamLines();
129 void OnEditDeformedShapeAndScalarMap();
131 virtual void OnDisplayPrs();
132 virtual void OnDisplayOnlyPrs();
133 virtual void OnErasePrs();
134 // virtual void OnEraseAll();
136 void OnToggleSelectionPanel();
137 void OnSwitchSelectionMode();
138 void OnSwitchSelectionMode( int );
140 void OnMakeSurfaceframe();
141 void OnMakeInsideframe();
142 void OnMakeWireframe();
143 void OnMakeSurface();
147 void OnMakeFeatureEdges();
149 void OnSetShadingOn();
150 void OnSetShadingOff();
152 void OnChangeColor();
153 void OnChangeWireframeColor();
154 void OnChangeOpacity();
155 void OnChangeLines();
156 void OnChangeShrinkFactor();
159 void OnShowTablePlot();
160 void OnShowScalarBar();
161 void OnHideScalarBar();
162 void OnCreateTable();
163 void OnDeleteObjects();
165 void OnCurveProperties();
166 void OnClearContainer();
167 void OnEditContainer();
169 void OnMergeScalarBars();
170 void OnFreeScalarBars();
172 virtual void OnSaveViewParams();
173 virtual void OnRestoreViewParams();
176 void OnClippingPlanes();
178 void OnParallelTimeAnimation();
179 void OnSucccessiveTimeAnimation();
180 void OnShowAnimation();
182 void OnPointEvolution();
183 void OnShowEvolution();
185 void OnCopyPresentation();
187 void OnTranslatePrs();
188 void OnArrangeActors();
189 void OnPlot3dFromCutPlane();
191 void OnManageCache();
193 void OnFilterScalars();
195 void OnValuesLabeling();
196 void OnValuesLabelingParams();
198 void OnArcQuadMode();
199 void OnLineQuadMode();
202 void OnMultiprViewFullRes();
203 void OnMultiprViewMediumRes();
204 void OnMultiprViewLowRes();
205 void OnMultiprViewHide();
206 void OnMultiprChangeRes(VISU::Result::Resolution theResolution);
212 virtual LightApp_Selection* createSelection() const;
214 void OnTimeAnimation(VISU::Animation::AnimationMode theMode);
217 void createActions();
219 void createToolBars();
220 void createPopupMenus();
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 );
227 QMap<int,VisuGUI_Panel*> myPanels;
228 VisuGUI_Slider* mySlider;
229 VisuGUI_Sweep* mySweep;
231 LightApp_Displayer* myDisplayer;
232 VISU::TViewToPrs3d myScalarBarsMap;