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 // File : SMESHGUI_MultiEditDlg.h
24 // Author : Sergey LITONIN, Open CASCADE S.A.S.
26 #ifndef SMESHGUI_MULTIEDITDLG_H
27 #define SMESHGUI_MULTIEDITDLG_H
30 #include "SMESH_SMESHGUI.hxx"
31 #include "SMESHGUI_PreviewDlg.h"
37 #include <TColStd_MapOfInteger.hxx>
40 #include <SALOMEconfig.h>
41 #include CORBA_SERVER_HEADER(SMESH_Mesh)
42 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
44 #include <smIdType.hxx>
47 class SMESHGUI_FilterDlg;
48 class SMESHGUI_SpinBox;
52 class LightApp_SelectionMgr;
65 * Class : SMESHGUI_MultiEditDlg
66 * Description : Base class for dialogs of diagonal inversion and
67 * union of two neighboring triangles
70 class SMESHGUI_EXPORT SMESHGUI_MultiEditDlg : public SMESHGUI_PreviewDlg
75 SMESHGUI_MultiEditDlg( SMESHGUI* theModule,
77 const bool the3d2d = false,
78 bool theDoInit = true );
79 virtual ~SMESHGUI_MultiEditDlg();
83 bool eventFilter( QObject*, QEvent* );
86 void ListContensChanged();
90 virtual bool onApply();
91 virtual void reject();
95 virtual void onSelectionDone();
100 void onSortListBtn();
101 void onListSelectionChanged();
104 virtual void onToAllChk();
105 void onFilterAccepted();
106 virtual void on3d2dChanged(int);
110 SMESH::NumericalFunctor_ptr getNumericalFunctor();
113 void enterEvent( QEvent * );
114 void keyPressEvent( QKeyEvent* );
115 QWidget* createButtonFrame( QWidget* );
116 QWidget* createMainFrame( QWidget*, const bool );
117 virtual bool isValid( const bool );
118 SMESH::smIdType_array_var getIds(SMESH::SMESH_IDSource_var& obj);
119 void updateButtons();
120 virtual void setSelectionMode();
121 virtual bool isIdValid( const int ) const;
122 virtual bool process( SMESH::SMESH_MeshEditor_ptr,
123 const SMESH::smIdType_array& ,
124 SMESH::SMESH_IDSource_ptr obj) = 0;
125 virtual smIdType nbElemsInMesh() = 0;
129 QPushButton* myOkBtn;
130 QPushButton* myApplyBtn;
131 QPushButton* myCloseBtn;
132 QPushButton* myHelpBtn;
133 SMESH_Actor* myActor;
134 SMESH::SMESH_Mesh_var myMesh;
136 LightApp_SelectionMgr* mySelectionMgr;
137 SVTK_Selector* mySelector;
138 SMESHGUI* mySMESHGUI;
141 QGroupBox* myCriterionGrp;
143 QWidget* myChoiceWidget;
144 QButtonGroup* myGroupChoice;
145 QComboBox* myComboBoxFunctor;
147 QListWidget* myListBox;
148 QPushButton* myFilterBtn;
149 QPushButton* myAddBtn;
150 QPushButton* myRemoveBtn;
151 QPushButton* mySortBtn;
153 QCheckBox* myToAllChk;
154 QButtonGroup* myEntityTypeGrp;
156 QCheckBox* mySubmeshChk;
157 QPushButton* mySubmeshBtn;
158 QLineEdit* mySubmesh;
160 QCheckBox* myGroupChk;
161 QPushButton* myGroupBtn;
164 SMESHGUI_FilterDlg* myFilterDlg;
165 TColStd_MapOfInteger myIds;
170 QString myHelpFileName;
174 * Class : SMESHGUI_ChangeOrientationDlg
175 * Description : Modification of orientation of faces
177 class SMESHGUI_ChangeOrientationDlg : public SMESHGUI_MultiEditDlg
182 SMESHGUI_ChangeOrientationDlg( SMESHGUI* );
183 virtual ~SMESHGUI_ChangeOrientationDlg();
186 virtual bool process( SMESH::SMESH_MeshEditor_ptr,
187 const SMESH::smIdType_array& ,
188 SMESH::SMESH_IDSource_ptr obj);
189 virtual smIdType nbElemsInMesh();
193 * Class : SMESHGUI_UnionOfTrianglesDlg
194 * Description : Construction of quadrangles by automatic association of triangles
196 class SMESHGUI_UnionOfTrianglesDlg : public SMESHGUI_MultiEditDlg
201 SMESHGUI_UnionOfTrianglesDlg( SMESHGUI* );
202 virtual ~SMESHGUI_UnionOfTrianglesDlg();
205 virtual bool isValid( const bool );
206 virtual bool process( SMESH::SMESH_MeshEditor_ptr,
207 const SMESH::smIdType_array&,
208 SMESH::SMESH_IDSource_ptr obj );
209 virtual smIdType nbElemsInMesh();
212 virtual void onDisplaySimulation( bool );
215 SMESHGUI_SpinBox* myMaxAngleSpin;
219 Class : SMESHGUI_CuttingOfQuadsDlg
220 Description : Construction of quadrangles by automatic association of triangles
222 class SMESHGUI_CuttingOfQuadsDlg : public SMESHGUI_MultiEditDlg
227 SMESHGUI_CuttingOfQuadsDlg( SMESHGUI* );
228 virtual ~SMESHGUI_CuttingOfQuadsDlg();
231 virtual bool process( SMESH::SMESH_MeshEditor_ptr,
232 const SMESH::smIdType_array& ,
233 SMESH::SMESH_IDSource_ptr obj);
234 virtual smIdType nbElemsInMesh();
237 virtual void reject();
238 void onCriterionRB();
242 void displayPreview();
246 SALOME_Actor* myPreviewActor;
247 QCheckBox* myPreviewChk;
251 * Class : SMESHGUI_SplitVolumesDlg
252 * Description : Split all volumes into tetrahedrons
254 class SMESHGUI_SplitVolumesDlg : public SMESHGUI_MultiEditDlg
259 SMESHGUI_SplitVolumesDlg( SMESHGUI* );
260 virtual ~SMESHGUI_SplitVolumesDlg();
264 virtual void on3d2dChanged(int);
265 virtual void onSelectionDone();
267 void onFacetSelection(bool);
269 void updateNormalPreview(const QString& s="");
273 virtual bool process( SMESH::SMESH_MeshEditor_ptr,
274 const SMESH::smIdType_array&,
275 SMESH::SMESH_IDSource_ptr obj );
276 virtual smIdType nbElemsInMesh();
278 virtual void setSelectionMode();
279 void showFacetByElement( int id );
282 QGroupBox* myFacetSelGrp;
283 SMESHGUI_SpinBox* myPointSpin[3];
284 SMESHGUI_SpinBox* myDirSpin [3];
285 QPushButton* myFacetSelBtn;
286 QPushButton* myAxisBtn[3];
287 QCheckBox* myAllDomainsChk;
292 #endif // SMESHGUI_MULTIEDITDLG_H