1 // Copyright (C) 2007-2010 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
23 // VISU VISUGUI : GUI of VISU component
25 // Author : Laurent CORNABE & Hubert ROLLAND
28 #ifndef VisuGUI_HeaderFile
29 #define VisuGUI_HeaderFile
31 #include <SalomeApp_Module.h>
33 #include <SVTK_ViewWindow.h>
34 #include <VISU_Prs3d_i.hh>
36 #include "VisuGUI_Panel.h"
41 class SUIT_ViewManager;
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;
53 class VisuGUI: public SalomeApp_Module
58 enum PanelId { SelectionPanelId = 0,
60 ClippingPlanesPanelId };
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;
71 virtual QString engineIOR() const;
73 virtual void studyActivated();
75 virtual void contextMenuPopup( const QString& theClient, QMenu* theMenu, QString& theTitle );
77 virtual void createPreferences();
78 virtual void preferencesChanged( const QString&, const QString& );
82 getViewManager(const QString& theType,
83 const bool theIsCreate);
89 void moduleDeactivated();
90 void moduleActivated();
91 void presentationCreated(VISU::Prs3d_i* thePrs);
92 void beforeObjectDelete(QString theEntry);
95 virtual bool deactivateModule( SUIT_Study* );
96 virtual bool activateModule( SUIT_Study* );
97 virtual void OnEraseAll();
100 void OnImportFromFile();
101 void OnImportTableFromFile();
102 void OnExportTableToFile();
103 void OnImportMedField();
105 void OnLoadComponentData();
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();
121 void OnEditScalarMap();
122 void OnEditDeformedShape();
123 void OnEditCutPlanes();
124 void OnEditCutLines();
125 void OnEditCutSegment();
126 void OnEditIsoSurfaces();
127 void OnEditVectors();
128 void OnEditStreamLines();
130 void OnEditDeformedShapeAndScalarMap();
132 virtual void OnDisplayPrs();
133 virtual void OnDisplayOnlyPrs();
134 virtual void OnErasePrs();
135 // virtual void OnEraseAll();
137 void OnToggleSelectionPanel();
138 void OnSwitchSelectionMode();
139 void OnSwitchSelectionMode( int );
141 void OnMakeSurfaceframe();
142 void OnMakeInsideframe();
143 void OnMakeWireframe();
144 void OnMakeSurface();
148 void OnMakeFeatureEdges();
150 void OnSetShadingOn();
151 void OnSetShadingOff();
153 void OnChangeColor();
154 void OnChangeWireframeColor();
155 void OnChangeOpacity();
156 void OnChangeLines();
157 void OnChangePointMarker();
158 void OnChangeShrinkFactor();
161 void OnShowTablePlot();
162 void OnShowScalarBar();
163 void OnHideScalarBar();
164 void OnCreateTable();
165 void OnDeleteObjects();
167 void OnCurveProperties();
168 void OnClearContainer();
169 void OnEditContainer();
171 void OnMergeScalarBars();
172 void OnFreeScalarBars();
174 virtual void OnSaveViewParams();
175 virtual void OnRestoreViewParams();
178 void OnClippingPlanes();
180 void OnParallelTimeAnimation();
181 void OnSucccessiveTimeAnimation();
182 void OnShowAnimation();
184 void OnPointEvolution();
185 void OnShowEvolution();
187 void OnCopyPresentation();
189 void OnTranslatePrs();
190 void OnArrangeActors();
191 void OnPlot3dFromCutPlane();
193 void OnManageCache();
195 void OnFilterScalars();
197 void OnValuesLabeling();
198 void OnValuesLabelingParams();
200 void OnArcQuadMode();
201 void OnLineQuadMode();
204 void OnMultiprViewFullRes();
205 void OnMultiprViewMediumRes();
206 void OnMultiprViewLowRes();
207 void OnMultiprViewHide();
208 void OnMultiprChangeRes(VISU::Result::Resolution theResolution);
214 virtual LightApp_Selection* createSelection() const;
216 void OnTimeAnimation(VISU::Animation::AnimationMode theMode);
219 void createActions();
221 void createToolBars();
222 void createPopupMenus();
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 );
229 QMap<int,VisuGUI_Panel*> myPanels;
230 VisuGUI_Slider* mySlider;
231 VisuGUI_Sweep* mySweep;
233 LightApp_Displayer* myDisplayer;
234 VISU::TViewToPrs3d myScalarBarsMap;