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 OnCreateStreamLines();
114 void OnCreatePlot3D();
115 void OnCreateManyMesh();
116 void OnCreatePlot2dView();
117 void OnCreateDeformedShapeAndScalarMap();
119 void OnEditScalarMap();
120 void OnEditDeformedShape();
121 void OnEditCutPlanes();
122 void OnEditCutLines();
123 void OnEditIsoSurfaces();
124 void OnEditVectors();
125 void OnEditStreamLines();
127 void OnEditDeformedShapeAndScalarMap();
129 virtual void OnDisplayPrs();
130 virtual void OnDisplayOnlyPrs();
131 virtual void OnErasePrs();
132 // virtual void OnEraseAll();
134 void OnToggleSelectionPanel();
135 void OnSwitchSelectionMode();
136 void OnSwitchSelectionMode( int );
138 void OnMakeSurfaceframe();
139 void OnMakeInsideframe();
140 void OnMakeWireframe();
141 void OnMakeSurface();
145 void OnMakeFeatureEdges();
147 void OnSetShadingOn();
148 void OnSetShadingOff();
150 void OnChangeColor();
151 void OnChangeWireframeColor();
152 void OnChangeOpacity();
153 void OnChangeLines();
156 void OnShowTablePlot();
157 void OnShowScalarBar();
158 void OnHideScalarBar();
159 void OnCreateTable();
160 void OnDeleteObjects();
162 void OnCurveProperties();
163 void OnClearContainer();
164 void OnEditContainer();
166 void OnMergeScalarBars();
167 void OnFreeScalarBars();
169 virtual void OnSaveViewParams();
170 virtual void OnRestoreViewParams();
173 void OnClippingPlanes();
175 void OnParallelTimeAnimation();
176 void OnSucccessiveTimeAnimation();
177 void OnShowAnimation();
179 void OnCopyPresentation();
181 void OnTranslatePrs();
182 void OnArrangeActors();
183 void OnPlot3dFromCutPlane();
185 void OnManageCache();
187 void OnFilterScalars();
189 void OnValuesLabeling();
190 void OnValuesLabelingParams();
192 void OnArcQuadMode();
193 void OnLineQuadMode();
196 void OnMultiprViewFullRes();
197 void OnMultiprViewMediumRes();
198 void OnMultiprViewLowRes();
199 void OnMultiprViewHide();
200 void OnMultiprChangeRes(VISU::Result::Resolution theResolution);
206 virtual LightApp_Selection* createSelection() const;
208 void OnTimeAnimation(VISU::Animation::AnimationMode theMode);
211 void createActions();
213 void createToolBars();
214 void createPopupMenus();
216 void SetScalarBarVisibility( bool );
217 void activateAppropriateViewer( Handle(SALOME_InteractiveObject) theIO );
218 int addVtkFontPref( const QString& label, const int pId, const QString& param, const bool useSize );
221 QMap<int,VisuGUI_Panel*> myPanels;
222 VisuGUI_Slider* mySlider;
223 VisuGUI_Sweep* mySweep;
225 LightApp_Displayer* myDisplayer;
226 VISU::TViewToPrs3d myScalarBarsMap;