1 // Copyright (C) 2007-2015 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)
53 class SMESHGUI_IdValidator;
54 class SMESHGUI_SpinBox;
55 class SMESHGUI_FilterDlg;
57 class LightApp_SelectionMgr;
58 class SUIT_SelectionFilter;
59 class SalomeApp_IntSpinBox;
61 //=================================================================================
62 // class : SMESHGUI_ExtrusionDlg
63 // purpose : A widget used to select both nodes, edges and faces for
64 // Extrusion and Revolution operations
65 //=================================================================================
67 class SMESHGUI_EXPORT SMESHGUI_3TypesSelector : public QWidget
73 SMESHGUI_3TypesSelector( QWidget * parent = 0 );
74 ~SMESHGUI_3TypesSelector();
77 void SetEnabled( bool enable, SMESH::ElementType type );
78 bool IsAnythingSelected( SMESH::ElementType type = SMESH::ALL );
79 SMESH::ElementType GetSelected( SMESH::ListOfIDSources & nodes,
80 SMESH::ListOfIDSources & edges,
81 SMESH::ListOfIDSources & faces );
82 SMESH::SMESH_Mesh_var GetMesh() { return myMesh; }
83 SMESH_Actor* GetActor() { return myActor; }
84 Handle(SALOME_InteractiveObject) GetIO() { return myIO; }
85 QButtonGroup* GetButtonGroup() { return mySelectBtnGrp; }
89 void selectionChanged();
93 void selectionIntoArgument();
94 void onTextChange( const QString& );
95 void onSelectMesh( bool on );
97 void onSelectType( int iType );
101 void addTmpIdSource( SMESH::long_array_var& ids,
102 int iType, int index);
104 QGroupBox* myGroups [3];
106 QLineEdit* myLineEdit [3];
107 QCheckBox* myMeshChk [3];
108 QPushButton* myFilterBtn[3];
109 QButtonGroup* mySelectBtnGrp;
110 SMESHGUI_FilterDlg* myFilterDlg;
111 SUIT_SelectionFilter* myFilter [3];
112 SMESHGUI_IdValidator* myIdValidator;
115 SMESH::SMESH_Mesh_var myMesh;
116 SMESH_Actor* myActor;
117 Handle(SALOME_InteractiveObject) myIO;
118 SMESH::ListOfIDSources_var myIDSource[3];
119 QList<SMESH::IDSource_wrap> myTmpIDSourceList;
121 LightApp_SelectionMgr* mySelectionMgr;
122 SVTK_Selector* mySelector;
125 //=================================================================================
126 // class : SMESHGUI_ExtrusionDlg
128 //=================================================================================
130 class SMESHGUI_EXPORT SMESHGUI_ExtrusionDlg : public SMESHGUI_PreviewDlg
135 SMESHGUI_ExtrusionDlg( SMESHGUI* );
136 ~SMESHGUI_ExtrusionDlg();
139 void Init( bool = true );
140 void enterEvent( QEvent* ); /* mouse enter the QWidget */
141 void keyPressEvent( QKeyEvent* );
142 int GetConstructorId();
143 void getExtrusionVector(SMESH::DirStruct& aVector);
144 void extrusionByNormal(SMESH::SMESH_MeshEditor_ptr meshEditor,
145 const bool makeGroups=false);
148 bool isValuesValid();
150 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
151 SVTK_Selector* mySelector;
154 SMESHGUI_3TypesSelector* SelectorWdg;
155 QRadioButton* ExtrMethod_RBut0;
156 QRadioButton* ExtrMethod_RBut1;
157 QRadioButton* ExtrMethod_RBut2;
159 QGroupBox* GroupArguments;
160 QLabel* TextLabelVector;
161 QLabel* TextLabelDistance;
162 QPushButton* SelectVectorButton;
164 SMESHGUI_SpinBox* SpinBox_Dx;
166 SMESHGUI_SpinBox* SpinBox_Dy;
168 SMESHGUI_SpinBox* SpinBox_Dz;
170 SMESHGUI_SpinBox* SpinBox_Vx;
172 SMESHGUI_SpinBox* SpinBox_Vy;
174 SMESHGUI_SpinBox* SpinBox_Vz;
175 QLabel* TextLabelDist;
176 SMESHGUI_SpinBox* SpinBox_VDist;
177 QLabel* TextLabelNbSteps;
178 SalomeApp_IntSpinBox* SpinBox_NbSteps;
179 QCheckBox* ByAverageNormalCheck;
180 QCheckBox* UseInputElemsOnlyCheck;
181 QCheckBox* MakeGroupsCheck;
183 QGroupBox* GroupButtons;
184 QPushButton* buttonOk;
185 QPushButton* buttonCancel;
186 QPushButton* buttonApply;
187 QPushButton* buttonHelp;
189 QString myHelpFileName;
193 virtual void onDisplaySimulation( bool );
194 virtual void reject();
197 void CheckIsEnable();
202 void SetEditCurrentArgument();
203 void SelectionIntoArgument();
204 void DeactivateActiveDialog();
205 void ActivateThisDialog();
211 #endif // SMESHGUI_EXTRUSIONDLG_H