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_MergeDlg.h
25 // Author : Open CASCADE S.A.S.
27 #ifndef SMESHGUI_MergeDlg_H
28 #define SMESHGUI_MergeDlg_H
31 #include "SMESH_SMESHGUI.hxx"
38 #include <TColStd_MapOfInteger.hxx>
45 #include <SALOMEconfig.h>
46 #include CORBA_SERVER_HEADER(SMESH_Mesh)
48 class LightApp_SelectionMgr;
58 class SMESHGUI_IdPreview;
59 class SMESHGUI_SpinBox;
61 class SUIT_SelectionFilter;
69 //=================================================================================
70 // class : SMESHGUI_MergeDlg
72 //=================================================================================
73 class SMESHGUI_EXPORT SMESHGUI_MergeDlg : public QDialog
78 SMESHGUI_MergeDlg( SMESHGUI*, int );
81 static QPixmap IconFirst();
85 void enterEvent( QEvent* ); /* mouse enter the QWidget */
86 void keyPressEvent( QKeyEvent* );
88 bool isKeepNodesIDsSelection();
89 bool isNewKeepNodesGroup( const char* entry );
91 void FindGravityCenter( TColStd_MapOfInteger&,
94 // add the centers of gravity of ElemsIdMap elements to the GrCentersXYZ list
97 typedef QList<SMESH::SMESH_GroupBase_var> GrpList;
99 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
100 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
101 SVTK_Selector* mySelector;
103 QWidget* myEditCurrentArgument;
105 SMESH::SMESH_Mesh_var myMesh;
106 SMESH::SMESH_IDSource_var mySubMeshOrGroup;
107 SMESH_Actor* myActor;
108 SUIT_SelectionFilter* myMeshOrSubMeshOrGroupFilter;
109 SUIT_SelectionFilter* mySubMeshOrGroupFilter;
111 SMESHGUI_IdPreview* myIdPreview;
115 int myTypeId; // manual(1) or automatic(0)
119 QGroupBox* GroupButtons;
120 QPushButton* buttonOk;
121 QPushButton* buttonCancel;
122 QPushButton* buttonApply;
123 QPushButton* buttonHelp;
125 QGroupBox* GroupMesh;
126 QLabel* TextLabelName;
127 QPushButton* SelectMeshButton;
128 QLineEdit* LineEditMesh;
130 QWidget* NodeSpecWidget;
131 SMESHGUI_SpinBox* SpinBoxTolerance;
132 QCheckBox* SeparateCornersAndMedium;
133 QCheckBox* AvoidMakingHoles;
135 QGroupBox* GroupCoincident;
136 //QWidget* GroupCoincidentWidget;
137 QPushButton* DetectButton;
138 QListWidget* ListCoincident;
139 QPushButton* AddGroupButton;
140 QPushButton* RemoveGroupButton;
141 QCheckBox* SelectAllCB;
144 QGroupBox* GroupEdit;
145 QListWidget* ListEdit;
146 QPushButton* AddElemButton;
147 QPushButton* RemoveElemButton;
148 QPushButton* SetFirstButton;
150 QGroupBox* GroupExclude;
151 QListWidget* ListExclude;
153 QGroupBox* GroupKeep;
154 QButtonGroup* KeepFromButGroup;
155 QPushButton* SelectKeepNodesButton;
156 QPushButton* AddKeepNodesButton;
157 QPushButton* RemoveKeepNodesButton;
158 QListWidget* KeepList;
161 QButtonGroup* GroupType;
163 QString myHelpFileName;
169 virtual void reject();
175 void updateControls();
177 void onAddKeepNode();
178 void onRemoveKeepNode();
179 void onSelectKeepNode();
180 void onKeepNodeSourceChanged(int);
182 void onRemoveGroup();
183 void onSelectGroup();
184 void onSelectAll( bool );
185 void onSelectElementFromGroup();
187 void onRemoveElement();
189 void SetEditCurrentArgument();
190 void SelectionIntoArgument();
191 void DeactivateActiveDialog();
192 void ActivateThisDialog();
193 void onTypeChanged(int);
198 #endif // SMESHGUI_MergeDlg_H