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 // 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);
108 SMESH::NumericalFunctor_ptr getNumericalFunctor();
111 void enterEvent( QEvent * );
112 void keyPressEvent( QKeyEvent* );
113 QWidget* createButtonFrame( QWidget* );
114 QWidget* createMainFrame( QWidget*, const bool );
115 virtual bool isValid( const bool );
116 SMESH::long_array_var getIds(SMESH::SMESH_IDSource_var& obj);
117 void updateButtons();
118 virtual void setSelectionMode();
119 virtual bool isIdValid( const int ) const;
120 virtual bool process( SMESH::SMESH_MeshEditor_ptr,
121 const SMESH::long_array& ,
122 SMESH::SMESH_IDSource_ptr obj) = 0;
123 virtual int nbElemsInMesh() = 0;
127 QPushButton* myOkBtn;
128 QPushButton* myApplyBtn;
129 QPushButton* myCloseBtn;
130 QPushButton* myHelpBtn;
131 SMESH_Actor* myActor;
132 SMESH::SMESH_Mesh_var myMesh;
134 LightApp_SelectionMgr* mySelectionMgr;
135 SVTK_Selector* mySelector;
136 SMESHGUI* mySMESHGUI;
139 QGroupBox* myCriterionGrp;
141 QWidget* myChoiceWidget;
142 QButtonGroup* myGroupChoice;
143 QComboBox* myComboBoxFunctor;
145 QListWidget* myListBox;
146 QPushButton* myFilterBtn;
147 QPushButton* myAddBtn;
148 QPushButton* myRemoveBtn;
149 QPushButton* mySortBtn;
151 QCheckBox* myToAllChk;
152 QButtonGroup* myEntityTypeGrp;
154 QCheckBox* mySubmeshChk;
155 QPushButton* mySubmeshBtn;
156 QLineEdit* mySubmesh;
158 QCheckBox* myGroupChk;
159 QPushButton* myGroupBtn;
162 SMESHGUI_FilterDlg* myFilterDlg;
163 TColStd_MapOfInteger myIds;
168 QString myHelpFileName;
172 * Class : SMESHGUI_ChangeOrientationDlg
173 * Description : Modification of orientation of faces
175 class SMESHGUI_ChangeOrientationDlg : public SMESHGUI_MultiEditDlg
180 SMESHGUI_ChangeOrientationDlg( SMESHGUI* );
181 virtual ~SMESHGUI_ChangeOrientationDlg();
184 virtual bool process( SMESH::SMESH_MeshEditor_ptr,
185 const SMESH::long_array& ,
186 SMESH::SMESH_IDSource_ptr obj);
187 virtual int nbElemsInMesh();
191 * Class : SMESHGUI_UnionOfTrianglesDlg
192 * Description : Construction of quadrangles by automatic association of triangles
194 class SMESHGUI_UnionOfTrianglesDlg : public SMESHGUI_MultiEditDlg
199 SMESHGUI_UnionOfTrianglesDlg( SMESHGUI* );
200 virtual ~SMESHGUI_UnionOfTrianglesDlg();
203 virtual bool isValid( const bool );
204 virtual bool process( SMESH::SMESH_MeshEditor_ptr,
205 const SMESH::long_array&,
206 SMESH::SMESH_IDSource_ptr obj );
207 virtual int nbElemsInMesh();
210 virtual void onDisplaySimulation( bool );
213 SMESHGUI_SpinBox* myMaxAngleSpin;
217 Class : SMESHGUI_CuttingOfQuadsDlg
218 Description : Construction of quadrangles by automatic association of triangles
220 class SMESHGUI_CuttingOfQuadsDlg : public SMESHGUI_MultiEditDlg
225 SMESHGUI_CuttingOfQuadsDlg( SMESHGUI* );
226 virtual ~SMESHGUI_CuttingOfQuadsDlg();
229 virtual bool process( SMESH::SMESH_MeshEditor_ptr,
230 const SMESH::long_array& ,
231 SMESH::SMESH_IDSource_ptr obj);
232 virtual int nbElemsInMesh();
235 virtual void reject();
236 void onCriterionRB();
240 void displayPreview();
244 SALOME_Actor* myPreviewActor;
245 QCheckBox* myPreviewChk;
249 * Class : SMESHGUI_SplitVolumesDlg
250 * Description : Split all volumes into tetrahedrons
252 class SMESHGUI_SplitVolumesDlg : public SMESHGUI_MultiEditDlg
257 SMESHGUI_SplitVolumesDlg( SMESHGUI* );
258 virtual ~SMESHGUI_SplitVolumesDlg();
262 virtual void on3d2dChanged(int);
263 virtual void onSelectionDone();
265 void onFacetSelection(bool);
267 void updateNormalPreview(const QString& s="");
271 virtual bool process( SMESH::SMESH_MeshEditor_ptr,
272 const SMESH::long_array&,
273 SMESH::SMESH_IDSource_ptr obj );
274 virtual int nbElemsInMesh();
276 virtual void setSelectionMode();
277 void showFacetByElement( int id );
280 QGroupBox* myFacetSelGrp;
281 SMESHGUI_SpinBox* myPointSpin[3];
282 SMESHGUI_SpinBox* myDirSpin [3];
283 QPushButton* myFacetSelBtn;
284 QPushButton* myAxisBtn[3];
285 QCheckBox* myAllDomainsChk;
290 #endif // SMESHGUI_MULTIEDITDLG_H