1 // Copyright (C) 2007-2014 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)
45 class SMESHGUI_FilterDlg;
46 class SMESHGUI_SpinBox;
50 class LightApp_SelectionMgr;
63 * Class : SMESHGUI_MultiEditDlg
64 * Description : Base class for dialogs of diagonal inversion and
65 * union of two neighboring triangles
68 class SMESHGUI_EXPORT SMESHGUI_MultiEditDlg : public SMESHGUI_PreviewDlg
73 SMESHGUI_MultiEditDlg( SMESHGUI* theModule,
75 const bool the3d2d = false,
76 bool theDoInit = true );
77 virtual ~SMESHGUI_MultiEditDlg();
81 bool eventFilter( QObject*, QEvent* );
84 void ListContensChanged();
88 virtual bool onApply();
89 virtual void reject();
93 virtual void onSelectionDone();
99 void onListSelectionChanged();
102 virtual void onToAllChk();
103 void onFilterAccepted();
104 virtual void on3d2dChanged(int);
106 SMESH::NumericalFunctor_ptr getNumericalFunctor();
109 void enterEvent( QEvent * );
110 void keyPressEvent( QKeyEvent* );
111 QWidget* createButtonFrame( QWidget* );
112 QWidget* createMainFrame( QWidget*, const bool );
113 virtual bool isValid( const bool );
114 SMESH::long_array_var getIds(SMESH::SMESH_IDSource_var& obj);
115 void updateButtons();
116 virtual void setSelectionMode();
117 virtual bool isIdValid( const int ) const;
118 virtual bool process( SMESH::SMESH_MeshEditor_ptr,
119 const SMESH::long_array& ,
120 SMESH::SMESH_IDSource_ptr obj) = 0;
121 virtual int nbElemsInMesh() = 0;
125 QPushButton* myOkBtn;
126 QPushButton* myApplyBtn;
127 QPushButton* myCloseBtn;
128 QPushButton* myHelpBtn;
129 SMESH_Actor* myActor;
130 SMESH::SMESH_Mesh_var myMesh;
132 LightApp_SelectionMgr* mySelectionMgr;
133 SVTK_Selector* mySelector;
134 SMESHGUI* mySMESHGUI;
137 QGroupBox* myCriterionGrp;
139 QWidget* myChoiceWidget;
140 QButtonGroup* myGroupChoice;
141 QComboBox* myComboBoxFunctor;
143 QListWidget* myListBox;
144 QPushButton* myFilterBtn;
145 QPushButton* myAddBtn;
146 QPushButton* myRemoveBtn;
147 QPushButton* mySortBtn;
149 QCheckBox* myToAllChk;
150 QButtonGroup* myEntityTypeGrp;
152 QCheckBox* mySubmeshChk;
153 QPushButton* mySubmeshBtn;
154 QLineEdit* mySubmesh;
156 QCheckBox* myGroupChk;
157 QPushButton* myGroupBtn;
160 SMESHGUI_FilterDlg* myFilterDlg;
161 TColStd_MapOfInteger myIds;
166 QString myHelpFileName;
170 * Class : SMESHGUI_ChangeOrientationDlg
171 * Description : Modification of orientation of faces
173 class SMESHGUI_ChangeOrientationDlg : public SMESHGUI_MultiEditDlg
178 SMESHGUI_ChangeOrientationDlg( SMESHGUI* );
179 virtual ~SMESHGUI_ChangeOrientationDlg();
182 virtual bool process( SMESH::SMESH_MeshEditor_ptr,
183 const SMESH::long_array& ,
184 SMESH::SMESH_IDSource_ptr obj);
185 virtual int nbElemsInMesh();
189 * Class : SMESHGUI_UnionOfTrianglesDlg
190 * Description : Construction of quadrangles by automatic association of triangles
192 class SMESHGUI_UnionOfTrianglesDlg : public SMESHGUI_MultiEditDlg
197 SMESHGUI_UnionOfTrianglesDlg( SMESHGUI* );
198 virtual ~SMESHGUI_UnionOfTrianglesDlg();
201 virtual bool isValid( const bool );
202 virtual bool process( SMESH::SMESH_MeshEditor_ptr,
203 const SMESH::long_array&,
204 SMESH::SMESH_IDSource_ptr obj );
205 virtual int nbElemsInMesh();
208 virtual void onDisplaySimulation( bool );
211 SMESHGUI_SpinBox* myMaxAngleSpin;
215 Class : SMESHGUI_CuttingOfQuadsDlg
216 Description : Construction of quadrangles by automatic association of triangles
218 class SMESHGUI_CuttingOfQuadsDlg : public SMESHGUI_MultiEditDlg
223 SMESHGUI_CuttingOfQuadsDlg( SMESHGUI* );
224 virtual ~SMESHGUI_CuttingOfQuadsDlg();
227 virtual bool process( SMESH::SMESH_MeshEditor_ptr,
228 const SMESH::long_array& ,
229 SMESH::SMESH_IDSource_ptr obj);
230 virtual int nbElemsInMesh();
233 virtual void reject();
234 void onCriterionRB();
238 void displayPreview();
242 SALOME_Actor* myPreviewActor;
243 QCheckBox* myPreviewChk;
247 * Class : SMESHGUI_SplitVolumesDlg
248 * Description : Split all volumes into tetrahedrons
250 class SMESHGUI_SplitVolumesDlg : public SMESHGUI_MultiEditDlg
255 SMESHGUI_SplitVolumesDlg( SMESHGUI* );
256 virtual ~SMESHGUI_SplitVolumesDlg();
260 virtual void on3d2dChanged(int);
261 virtual void onSelectionDone();
263 void onFacetSelection(bool);
265 void updateNormalPreview(const QString& s="");
269 virtual bool process( SMESH::SMESH_MeshEditor_ptr,
270 const SMESH::long_array&,
271 SMESH::SMESH_IDSource_ptr obj );
272 virtual int nbElemsInMesh();
274 virtual void setSelectionMode();
275 void showFacetByElement( int id );
278 QGroupBox* myFacetSelGrp;
279 SMESHGUI_SpinBox* myPointSpin[3];
280 SMESHGUI_SpinBox* myDirSpin [3];
281 QPushButton* myFacetSelBtn;
282 QPushButton* myAxisBtn[3];
283 QCheckBox* myAllDomainsChk;
288 #endif // SMESHGUI_MULTIEDITDLG_H