1 // Copyright (C) 2007-2022 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, or (at your option) any later version.
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 // SMESH SMESHGUI : GUI for SMESH component
24 // File : SMESHGUI_ExtrusionDlg.h
25 // Author : Michael ZORIN, Open CASCADE S.A.S.
27 #ifndef SMESHGUI_EXTRUSIONDLG_H
28 #define SMESHGUI_EXTRUSIONDLG_H
31 #include "SMESH_SMESHGUI.hxx"
32 #include "SMESHGUI_PreviewDlg.h"
33 #include "SMESHGUI_Utils.h"
35 // SALOME GUI includes
36 #include <SALOME_InteractiveObject.hxx>
39 #include <SALOMEconfig.h>
40 #include CORBA_SERVER_HEADER(SMESH_Mesh)
41 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
55 class SMESHGUI_IdValidator;
56 class SMESHGUI_SpinBox;
57 class SMESHGUI_FilterDlg;
59 class LightApp_SelectionMgr;
60 class SUIT_SelectionFilter;
61 class SalomeApp_IntSpinBox;
63 //=================================================================================
64 // class : SMESHGUI_3TypesSelector
65 // purpose : A widget used to select both nodes, edges and faces for
66 // Extrusion and Revolution operations
67 //=================================================================================
69 class SMESHGUI_EXPORT SMESHGUI_3TypesSelector : public QWidget
75 SMESHGUI_3TypesSelector( QWidget * parent = 0 );
76 ~SMESHGUI_3TypesSelector();
79 void SetEnabled( bool enable, SMESH::ElementType type );
80 bool IsAnythingSelected( SMESH::ElementType type = SMESH::ALL );
81 SMESH::ElementType GetSelected( SMESH::ListOfIDSources & nodes,
82 SMESH::ListOfIDSources & edges,
83 SMESH::ListOfIDSources & faces );
84 SMESH::SMESH_Mesh_var GetMesh() { return myMesh; }
85 SMESH_Actor* GetActor() { return myActor; }
86 Handle(SALOME_InteractiveObject) GetIO() { return myIO; }
87 QButtonGroup* GetButtonGroup() { return mySelectBtnGrp; }
91 void selectionChanged();
95 void selectionIntoArgument();
96 void onTextChange( const QString& );
97 void onSelectMesh( bool on );
99 void onSelectType( int iType );
103 void addTmpIdSource( SMESH::smIdType_array_var& ids,
104 int iType, int index);
106 QGroupBox* myGroups [3];
108 QLineEdit* myLineEdit [3];
109 QCheckBox* myMeshChk [3];
110 QPushButton* myFilterBtn[3];
111 QButtonGroup* mySelectBtnGrp;
112 SMESHGUI_FilterDlg* myFilterDlg;
113 SUIT_SelectionFilter* myFilter [3];
114 SMESHGUI_IdValidator* myIdValidator;
117 SMESH::SMESH_Mesh_var myMesh;
118 SMESH_Actor* myActor;
119 Handle(SALOME_InteractiveObject) myIO;
120 SMESH::ListOfIDSources_var myIDSource[3];
121 QList<SMESH::IDSource_wrap> myTmpIDSourceList;
123 LightApp_SelectionMgr* mySelectionMgr;
124 SVTK_Selector* mySelector;
127 //=================================================================================
128 // class : SMESHGUI_ExtrusionDlg
130 //=================================================================================
132 class SMESHGUI_EXPORT SMESHGUI_ExtrusionDlg : public SMESHGUI_PreviewDlg
137 SMESHGUI_ExtrusionDlg( SMESHGUI* );
138 ~SMESHGUI_ExtrusionDlg();
141 void Init( bool = true );
142 void enterEvent( QEvent* ); /* mouse enter the QWidget */
143 void keyPressEvent( QKeyEvent* );
144 int GetConstructorId();
145 void getExtrusionVector(SMESH::DirStruct& aVector);
146 void extrusionByNormal(SMESH::SMESH_MeshEditor_ptr meshEditor,
147 const bool makeGroups=false);
148 void getScaleParams( SMESH::double_array*& scales,
149 SMESH::double_array*& basePoint,
150 bool & scalesVariation,
151 SMESH::double_array*& angles,
152 bool & anglesVariation);
155 bool isValuesValid();
157 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
158 SVTK_Selector* mySelector;
159 QList<double> myScalesList;
160 QList<double> myAnglesList;
163 SMESHGUI_3TypesSelector* SelectorWdg;
164 QRadioButton* ExtrMethod_RBut0;
165 QRadioButton* ExtrMethod_RBut1;
166 QRadioButton* ExtrMethod_RBut2;
168 QGroupBox* GroupArguments;
169 QLabel* TextLabelVector;
170 QLabel* TextLabelDistance;
171 QPushButton* SelectVectorButton;
173 SMESHGUI_SpinBox* SpinBox_Dx;
175 SMESHGUI_SpinBox* SpinBox_Dy;
177 SMESHGUI_SpinBox* SpinBox_Dz;
179 SMESHGUI_SpinBox* SpinBox_Vx;
181 SMESHGUI_SpinBox* SpinBox_Vy;
183 SMESHGUI_SpinBox* SpinBox_Vz;
184 QLabel* TextLabelDist;
185 SMESHGUI_SpinBox* SpinBox_VDist;
186 QLabel* TextLabelNbSteps;
187 SalomeApp_IntSpinBox* SpinBox_NbSteps;
188 QCheckBox* ByAverageNormalCheck;
189 QCheckBox* UseInputElemsOnlyCheck;
190 QCheckBox* MakeGroupsCheck;
192 QGroupBox* BasePointGrp;
193 QPushButton* SelectBasePointButton;
194 SMESHGUI_SpinBox* BasePoint_XSpin;
195 SMESHGUI_SpinBox* BasePoint_YSpin;
196 SMESHGUI_SpinBox* BasePoint_ZSpin;
198 QGroupBox* ScalesGrp;
199 QListWidget* ScalesList;
200 QToolButton* AddScaleButton;
201 QToolButton* RemoveScaleButton;
202 SMESHGUI_SpinBox* ScaleSpin;
203 QCheckBox* LinearScalesCheck;
205 QGroupBox* AnglesGrp;
206 QListWidget* AnglesList;
207 QToolButton* AddAngleButton;
208 QToolButton* RemoveAngleButton;
209 SMESHGUI_SpinBox* AngleSpin;
210 QCheckBox* LinearAnglesCheck;
212 QGroupBox* GroupButtons;
213 QPushButton* buttonOk;
214 QPushButton* buttonCancel;
215 QPushButton* buttonApply;
216 QPushButton* buttonHelp;
218 QString myHelpFileName;
222 virtual void onDisplaySimulation( bool );
223 virtual void reject();
226 void CheckIsEnable();
231 void SetEditCurrentArgument();
232 void SelectionIntoArgument();
233 void DeactivateActiveDialog();
234 void ActivateThisDialog();
238 void OnScaleRemoved();
242 #endif // SMESHGUI_EXTRUSIONDLG_H