1 // Copyright (C) 2007-2021 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_MergeDlg.h
25 // Author : Open CASCADE S.A.S.
27 #ifndef SMESHGUI_MergeDlg_H
28 #define SMESHGUI_MergeDlg_H
31 #include "SMESH_SMESHGUI.hxx"
33 // GUI and Qt includes
35 #include <SVTK_Hash.h>
39 #include <TColStd_MapOfInteger.hxx>
46 #include <SALOMEconfig.h>
47 #include CORBA_SERVER_HEADER(SMESH_Mesh)
49 class LightApp_SelectionMgr;
59 class SMESHGUI_IdPreview;
60 class SMESHGUI_SpinBox;
62 class SUIT_SelectionFilter;
70 //=================================================================================
71 // class : SMESHGUI_MergeDlg
73 //=================================================================================
74 class SMESHGUI_EXPORT SMESHGUI_MergeDlg : public QDialog
79 SMESHGUI_MergeDlg( SMESHGUI*, int );
82 static QPixmap IconFirst();
86 void enterEvent( QEvent* ); /* mouse enter the QWidget */
87 void keyPressEvent( QKeyEvent* );
89 bool isKeepIDsSelection();
90 bool isNewKeepGroup( const char* entry );
92 void FindGravityCenter( SVTK_TVtkIDsMap&,
95 // add the centers of gravity of ElemsIdMap elements to the GrCentersXYZ list
98 typedef QList<SMESH::SMESH_GroupBase_var> GrpList;
100 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
101 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
102 SVTK_Selector* mySelector;
104 QWidget* myEditCurrentArgument;
106 SMESH::SMESH_Mesh_var myMesh;
107 SMESH::ListOfIDSources_var mySubMeshOrGroups;
111 SMESH_Actor* myActor;
112 SUIT_SelectionFilter* myMeshOrSubMeshOrGroupFilter;
113 SUIT_SelectionFilter* mySubMeshOrGroupFilter;
115 SMESHGUI_IdPreview* myIdPreview;
116 QString myHelpFileName;
120 int myTypeId; // manual(1) or automatic(0)
126 QGroupBox* GroupButtons;
127 QPushButton* buttonOk;
128 QPushButton* buttonCancel;
129 QPushButton* buttonApply;
130 QPushButton* buttonHelp;
132 QGroupBox* GroupMesh;
133 QLabel* TextLabelName;
134 QPushButton* SelectMeshButton;
135 QLineEdit* LineEditMesh;
137 QWidget* NodeSpecWidget;
138 SMESHGUI_SpinBox* SpinBoxTolerance;
139 QCheckBox* SeparateCornersAndMedium;
140 QCheckBox* AvoidMakingHoles;
142 QGroupBox* GroupCoincident;
143 //QWidget* GroupCoincidentWidget;
144 QPushButton* DetectButton;
145 QListWidget* ListCoincident;
146 QPushButton* AddGroupButton;
147 QPushButton* RemoveGroupButton;
148 QCheckBox* SelectAllCB;
151 QGroupBox* GroupEdit;
152 QListWidget* ListEdit;
153 QPushButton* AddElemButton;
154 QPushButton* RemoveElemButton;
155 QPushButton* SetFirstButton;
157 QGroupBox* GroupExclude;
158 QListWidget* ListExclude;
160 QGroupBox* GroupKeep;
161 QButtonGroup* KeepFromButGroup;
162 QPushButton* SelectKeepButton;
163 QPushButton* AddKeepButton;
164 QPushButton* RemoveKeepButton;
165 QListWidget* KeepList;
168 QButtonGroup* GroupType;
171 virtual void reject();
177 void updateControls();
182 void onKeepSourceChanged(int);
184 void onRemoveGroup();
185 void onSelectGroup();
186 void onSelectAll( bool );
187 void onSelectElementFromGroup();
189 void onRemoveElement();
191 void SetEditCurrentArgument();
192 void SelectionIntoArgument();
193 void DeactivateActiveDialog();
194 void ActivateThisDialog();
195 void onTypeChanged(int);
200 #endif // SMESHGUI_MergeDlg_H