1 // Copyright (C) 2007-2016 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_SewingDlg.h
25 // Author : Michael ZORIN, Open CASCADE S.A.S.
27 #ifndef SMESHGUI_SEWINGDLG_H
28 #define SMESHGUI_SEWINGDLG_H
31 #include "SMESH_SMESHGUI.hxx"
37 #include <SALOMEconfig.h>
38 #include CORBA_SERVER_HEADER(SMESH_Mesh)
39 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
53 class LightApp_SelectionMgr;
54 class SMESHGUI_SpinBox;
55 class SalomeApp_IntSpinBox;
57 class QListWidgetItem;
59 //=================================================================================
60 // class : SMESHGUI_SewingDlg
62 //=================================================================================
63 class SMESHGUI_EXPORT SMESHGUI_SewingDlg : public QDialog
68 SMESHGUI_SewingDlg( SMESHGUI* );
69 ~SMESHGUI_SewingDlg();
73 void enterEvent( QEvent* ); /* mouse enter the QWidget */
74 void keyPressEvent( QKeyEvent* );
75 int GetConstructorId();
79 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
80 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
81 int myOk1, myOk2, myOk3, myOk4, myOk5, myOk6;
82 QLineEdit* myEditCurrentArgument; /* Current LineEdit */
83 SVTK_Selector* mySelector;
86 SMESH::SMESH_Mesh_var myMesh;
89 QGroupBox* ConstructorsBox;
90 QButtonGroup* GroupConstructors;
91 QRadioButton* RadioButton1;
92 QRadioButton* RadioButton2;
93 QRadioButton* RadioButton3;
94 QRadioButton* RadioButton4;
95 QGroupBox* GroupButtons;
96 QPushButton* buttonOk;
97 QPushButton* buttonCancel;
98 QPushButton* buttonApply;
99 QPushButton* buttonHelp;
100 QGroupBox* GroupArguments;
101 QGroupBox* SubGroup1;
102 QGroupBox* SubGroup2;
109 QPushButton* SelectButton1;
110 QPushButton* SelectButton2;
111 QPushButton* SelectButton3;
112 QPushButton* SelectButton4;
113 QPushButton* SelectButton5;
114 QPushButton* SelectButton6;
115 QLineEdit* LineEdit1;
116 QLineEdit* LineEdit2;
117 QLineEdit* LineEdit3;
118 QLineEdit* LineEdit4;
119 QLineEdit* LineEdit5;
120 QLineEdit* LineEdit6;
121 QCheckBox* CheckBoxMerge;
122 QCheckBox* CheckBoxPolygons;
123 QCheckBox* CheckBoxPolyedrs;
125 QWidget* SewFreeBordersWidget;
126 QGroupBox* ModeGroup;
127 QButtonGroup* ModeButGrp;
128 //QPushButton* SelectMeshButton;
129 QLineEdit* LineEditMesh;
131 SMESHGUI_SpinBox* SpinBoxTolerance;
132 QCheckBox* AutoSewCheck;
134 QWidget* GroupCoincidentWidget;
135 QListWidget* ListCoincident;
136 QPushButton* DetectButton;
137 QPushButton* RemoveGroupButton;
138 QCheckBox* SelectAllCheck;
140 QListWidget* ListEdit;
141 QButtonGroup* MoveBorderEndsButGrp;
142 QLineEdit* BorderEndLine[2];
143 QPushButton* SwapBut;
144 QPushButton* SetFirstButton;
145 QPushButton* RemoveElemButton;
146 SalomeApp_IntSpinBox* StepSpin;
148 QString myHelpFileName;
151 struct BorderGroupDisplayer;
152 std::vector< BorderGroupDisplayer* > myBorderDisplayers;
153 SMESH::CoincidentFreeBorders_var myBorders;
156 int myStoredRepresentation;
157 unsigned int myStoredEntityMode;
160 QString getGroupText( int groupIndex );
161 QString getPartText( const SMESH::FreeBorderPart& part );
162 void showGroup( QListWidgetItem* item );
163 bool setCurrentGroup();
164 bool setCurrentPart();
165 void onGroupChange(bool partChange=false);
166 void setDisplayMode();
167 void restoreDisplayMode();
171 virtual void reject();
174 void ConstructorsClicked( int );
175 void onModeChange( int );
176 void onAutoSew( int );
177 void onDetectClicked();
178 void onRemoveGroupClicked();
179 void onSelectGroup();
180 void onSelectAll(int);
181 void onSelectBorderPartFromGroup();
182 void onSetFirstClicked();
183 void onRemoveElemClicked();
184 void onMoveBorderEnd(int);
185 void onSwapClicked();
189 void SetEditCurrentArgument();
190 void SelectionIntoArgument( bool = true );
191 void DeactivateActiveDialog();
192 void ActivateThisDialog();
193 void onTextChange( const QString& );
198 #endif // SMESHGUI_SEWINGDLG_H