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 OnImportTableFromFile();
106 void OnExportTableToFile();
107 void OnImportMedField();
109 void OnLoadComponentData();
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();
125 void OnEditScalarMap();
126 void OnEditDeformedShape();
127 void OnEditCutPlanes();
128 void OnEditCutLines();
129 void OnEditCutSegment();
130 void OnEditIsoSurfaces();
131 void OnEditVectors();
132 void OnEditStreamLines();
134 void OnEditDeformedShapeAndScalarMap();
136 virtual void OnDisplayPrs();
137 virtual void OnDisplayOnlyPrs();
138 virtual void OnErasePrs();
139 // virtual void OnEraseAll();
141 void OnToggleSelectionPanel();
142 void OnSwitchSelectionMode();
143 void OnSwitchSelectionMode( int );
145 void OnMakeSurfaceframe();
146 void OnMakeInsideframe();
147 void OnMakeWireframe();
148 void OnMakeSurface();
152 void OnMakeFeatureEdges();
154 void OnSetShadingOn();
155 void OnSetShadingOff();
157 void OnChangeColor();
158 void OnChangeWireframeColor();
159 void OnChangeOpacity();
160 void OnChangeLines();
161 void OnChangePointMarker();
162 void OnChangeShrinkFactor();
165 void OnShowTablePlot();
166 void OnShowScalarBar();
167 void OnHideScalarBar();
168 void OnCreateTable();
169 void OnDeleteObjects();
171 void OnCurveProperties();
172 void OnClearContainer();
173 void OnEditContainer();
175 void OnMergeScalarBars();
176 void OnFreeScalarBars();
178 virtual void OnSaveViewParams();
179 virtual void OnRestoreViewParams();
181 void OnClippingPlanes();
183 void OnParallelTimeAnimation();
184 void OnSucccessiveTimeAnimation();
185 void OnShowAnimation();
187 void OnPointEvolution();
188 void OnShowEvolution();
190 void OnCopyPresentation();
192 void OnTranslatePrs();
193 void OnArrangeActors();
194 void OnPlot3dFromCutPlane();
196 void OnManageCache();
198 void OnFilterScalars();
200 void OnValuesLabeling();
201 void OnValuesLabelingParams();
203 void OnArcQuadMode();
204 void OnLineQuadMode();
207 void OnMultiprViewFullRes();
208 void OnMultiprViewMediumRes();
209 void OnMultiprViewLowRes();
210 void OnMultiprViewHide();
211 void OnMultiprChangeRes(VISU::Result::Resolution theResolution);
217 virtual LightApp_Selection* createSelection() const;
219 virtual void processPresentationCreated( VISU::Prs3d_i* thePrs );
221 void OnTimeAnimation(VISU::Animation::AnimationMode theMode);
224 void createActions();
226 void createToolBars();
227 void createPopupMenus();
229 void SetScalarBarVisibility( bool );
230 void activateAppropriateViewer( Handle(SALOME_InteractiveObject) theIO );
231 int addVtkFontPref( const QString& label, const int pId, const QString& param, const bool useSize );
234 QMap<int,VisuGUI_Panel*> myPanels;
235 VisuGUI_Slider* mySlider;
236 VisuGUI_Sweep* mySweep;
238 LightApp_Displayer* myDisplayer;
239 VISU::TViewToPrs3d myScalarBarsMap;