1 // Copyright (C) 2007-2011 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);
88 virtual bool renameAllowed( const QString& ) const;
89 virtual bool renameObject( const QString&, const QString& );
93 void moduleDeactivated();
94 void moduleActivated();
95 void presentationCreated(VISU::Prs3d_i* thePrs);
96 void beforeObjectDelete(QString theEntry);
99 virtual bool deactivateModule( SUIT_Study* );
100 virtual bool activateModule( SUIT_Study* );
101 virtual void OnEraseAll();
104 void OnImportFromFile();
105 void OnImportFromSauvFile();
106 void OnImportTableFromFile();
107 void OnExportTableToFile();
108 void OnImportMedField();
110 void OnLoadComponentData();
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();
126 void OnEditScalarMap();
127 void OnEditDeformedShape();
128 void OnEditCutPlanes();
129 void OnEditCutLines();
130 void OnEditCutSegment();
131 void OnEditIsoSurfaces();
132 void OnEditVectors();
133 void OnEditStreamLines();
135 void OnEditDeformedShapeAndScalarMap();
137 virtual void OnDisplayPrs();
138 virtual void OnDisplayOnlyPrs();
139 virtual void OnErasePrs();
140 // virtual void OnEraseAll();
142 void OnToggleSelectionPanel();
143 void OnSwitchSelectionMode();
144 void OnSwitchSelectionMode( int );
146 void OnMakeSurfaceframe();
147 void OnMakeInsideframe();
148 void OnMakeWireframe();
149 void OnMakeSurface();
153 void OnMakeFeatureEdges();
155 void OnSetShadingOn();
156 void OnSetShadingOff();
158 void OnChangeColor();
159 void OnChangeWireframeColor();
160 void OnChangeOpacity();
161 void OnChangeLines();
162 void OnChangePointMarker();
163 void OnChangeShrinkFactor();
166 void OnShowTablePlot();
167 void OnShowScalarBar();
168 void OnHideScalarBar();
169 void OnCreateTable();
170 void OnDeleteObjects();
172 void OnCurveProperties();
174 void OnClearContainer();
175 void OnEditContainer();
177 void OnMergeScalarBars();
178 void OnFreeScalarBars();
180 virtual void OnSaveViewParams();
181 virtual void OnRestoreViewParams();
183 void OnClippingPlanes();
185 void OnParallelTimeAnimation();
186 void OnSucccessiveTimeAnimation();
187 void OnShowAnimation();
189 void OnPointEvolution();
190 void OnShowEvolution();
192 void OnCopyPresentation();
194 void OnTranslatePrs();
195 void OnArrangeActors();
196 void OnPlot3dFromCutPlane();
198 void OnManageCache();
200 void OnFilterScalars();
202 void OnValuesLabeling();
203 void OnValuesLabelingParams();
205 void OnArcQuadMode();
206 void OnLineQuadMode();
208 void OnShowDeviation();
211 void OnMultiprViewFullRes();
212 void OnMultiprViewMediumRes();
213 void OnMultiprViewLowRes();
214 void OnMultiprViewHide();
215 void OnMultiprChangeRes(VISU::Result::Resolution theResolution);
221 virtual LightApp_Selection* createSelection() const;
223 virtual void processPresentationCreated( VISU::Prs3d_i* thePrs );
225 void OnTimeAnimation(VISU::Animation::AnimationMode theMode);
228 void createActions();
230 void createToolBars();
231 void createPopupMenus();
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 );
238 QMap<int,VisuGUI_Panel*> myPanels;
239 VisuGUI_Slider* mySlider;
240 VisuGUI_Sweep* mySweep;
242 LightApp_Displayer* myDisplayer;
243 VISU::TViewToPrs3d myScalarBarsMap;