Version: 9.16.0
SMESHGUI_MergeDlg.h
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, OPEN CASCADE
2//
3// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5//
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.
10//
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.
15//
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
19//
20// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21//
22
23// SMESH SMESHGUI : GUI for SMESH component
24// File : SMESHGUI_MergeDlg.h
25// Author : Open CASCADE S.A.S.
26//
27#ifndef SMESHGUI_MergeDlg_H
28#define SMESHGUI_MergeDlg_H
29
30// SMESH includes
31#include "SMESH_SMESHGUI.hxx"
32
33// GUI and Qt includes
34#include <QDialog>
35#include <SVTK_Hash.h>
36
37// OCCT includes
38#include <gp_XYZ.hxx>
39#include <TColStd_MapOfInteger.hxx>
40
41// STL includes
42#include <list>
43#include <vector>
44
45// IDL includes
46#include <SALOMEconfig.h>
47#include CORBA_SERVER_HEADER(SMESH_Mesh)
48
49class LightApp_SelectionMgr;
50class QButtonGroup;
51class QCheckBox;
52class QGroupBox;
53class QLabel;
54class QLineEdit;
55class QListWidget;
56class QPushButton;
57class QRadioButton;
58class SMESHGUI;
61class SMESH_Actor;
63class SVTK_Selector;
64
65namespace SMESH
66{
67 struct TIdPreview;
68}
69
70//=================================================================================
71// class : SMESHGUI_MergeDlg
72// purpose :
73//=================================================================================
75{
76 Q_OBJECT
77
78public:
81
82 static QPixmap IconFirst();
83
84private:
85 void Init();
86 void enterEvent( QEvent* ); /* mouse enter the QWidget */
87 void keyPressEvent( QKeyEvent* );
88 void onEditGroup();
89 bool isKeepIDsSelection();
90 bool isNewKeepGroup( const char* entry );
91
92 void FindGravityCenter( SVTK_TVtkIDsMap&,
93 std::vector<int>& ,
94 std::list<gp_XYZ>& );
95 // add the centers of gravity of ElemsIdMap elements to the GrCentersXYZ list
96
97private:
98 typedef QList<SMESH::SMESH_GroupBase_var> GrpList;
99
100 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
101 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
102 SVTK_Selector* mySelector;
103
105
106 SMESH::SMESH_Mesh_var myMesh;
107 SMESH::ListOfIDSources_var mySubMeshOrGroups;
109 QString myEntry;
110
114
117
120 int myTypeId; // manual(1) or automatic(0)
121
122
123
124 // Widgets
125
127 QPushButton* buttonOk;
128 QPushButton* buttonCancel;
129 QPushButton* buttonApply;
130 QPushButton* buttonHelp;
131
134 QPushButton* SelectMeshButton;
135 QLineEdit* LineEditMesh;
136
141
143 //QWidget* GroupCoincidentWidget;
144 QPushButton* DetectButton;
145 QListWidget* ListCoincident;
146 QPushButton* AddGroupButton;
147 QPushButton* RemoveGroupButton;
148 QCheckBox* SelectAllCB;
149 QCheckBox* ShowIDs;
150
152 QListWidget* ListEdit;
153 QPushButton* AddElemButton;
154 QPushButton* RemoveElemButton;
155 QPushButton* SetFirstButton;
156
158 QListWidget* ListExclude;
159
161 QButtonGroup* KeepFromButGroup;
162 QPushButton* SelectKeepButton;
163 QPushButton* AddKeepButton;
164 QPushButton* RemoveKeepButton;
165 QListWidget* KeepList;
166
168 QButtonGroup* GroupType;
169
170protected slots:
171 virtual void reject();
172
173 private slots:
174 void ClickOnOk();
175 bool ClickOnApply();
176 void ClickOnHelp();
177 void updateControls();
178 void onDetect();
179 void onAddKeep();
180 void onRemoveKeep();
181 void onSelectKeep();
182 void onKeepSourceChanged(int);
183 void onAddGroup();
184 void onRemoveGroup();
185 void onSelectGroup();
186 void onSelectAll( bool );
187 void onSelectElementFromGroup();
188 void onAddElement();
189 void onRemoveElement();
190 void onSetFirst();
191 void SetEditCurrentArgument();
192 void SelectionIntoArgument();
193 void DeactivateActiveDialog();
194 void ActivateThisDialog();
195 void onTypeChanged(int);
196 void onOpenView();
197 void onCloseView();
198};
199
200#endif // SMESHGUI_MergeDlg_H
#define SMESHGUI_EXPORT
Definition: SMESH_SMESHGUI.hxx:36
To display in the viewer IDs of selected elements or nodes.
Definition: SMESHGUI_IdPreview.h:51
Definition: SMESHGUI_MergeDlg.h:75
QListWidget * ListEdit
Definition: SMESHGUI_MergeDlg.h:152
QCheckBox * ShowIDs
Definition: SMESHGUI_MergeDlg.h:149
QWidget * NodeSpecWidget
Definition: SMESHGUI_MergeDlg.h:137
QListWidget * ListCoincident
Definition: SMESHGUI_MergeDlg.h:145
QPushButton * RemoveGroupButton
Definition: SMESHGUI_MergeDlg.h:147
QPushButton * buttonCancel
Definition: SMESHGUI_MergeDlg.h:128
QList< SMESH::SMESH_GroupBase_var > GrpList
Definition: SMESHGUI_MergeDlg.h:98
QCheckBox * SeparateCornersAndMedium
Definition: SMESHGUI_MergeDlg.h:139
QButtonGroup * KeepFromButGroup
Definition: SMESHGUI_MergeDlg.h:161
SUIT_SelectionFilter * mySubMeshOrGroupFilter
Definition: SMESHGUI_MergeDlg.h:113
QPushButton * SetFirstButton
Definition: SMESHGUI_MergeDlg.h:155
QWidget * myEditCurrentArgument
Definition: SMESHGUI_MergeDlg.h:104
int myAction
Definition: SMESHGUI_MergeDlg.h:118
QPushButton * SelectKeepButton
Definition: SMESHGUI_MergeDlg.h:162
QPushButton * DetectButton
Definition: SMESHGUI_MergeDlg.h:144
QGroupBox * GroupMesh
Definition: SMESHGUI_MergeDlg.h:132
QPushButton * AddKeepButton
Definition: SMESHGUI_MergeDlg.h:163
QListWidget * ListExclude
Definition: SMESHGUI_MergeDlg.h:158
QGroupBox * GroupButtons
Definition: SMESHGUI_MergeDlg.h:126
QPushButton * RemoveKeepButton
Definition: SMESHGUI_MergeDlg.h:164
QPushButton * AddElemButton
Definition: SMESHGUI_MergeDlg.h:153
QLabel * TextLabelName
Definition: SMESHGUI_MergeDlg.h:133
QLineEdit * LineEditMesh
Definition: SMESHGUI_MergeDlg.h:135
QPushButton * SelectMeshButton
Definition: SMESHGUI_MergeDlg.h:134
SMESH_Actor * myActor
Definition: SMESHGUI_MergeDlg.h:111
int myTypeId
Definition: SMESHGUI_MergeDlg.h:120
SMESHGUI * mySMESHGUI
Definition: SMESHGUI_MergeDlg.h:100
QCheckBox * AvoidMakingHoles
Definition: SMESHGUI_MergeDlg.h:140
bool myIsBusy
Definition: SMESHGUI_MergeDlg.h:119
SMESHGUI_SpinBox * SpinBoxTolerance
Definition: SMESHGUI_MergeDlg.h:138
SUIT_SelectionFilter * myMeshOrSubMeshOrGroupFilter
Definition: SMESHGUI_MergeDlg.h:112
QPushButton * buttonHelp
Definition: SMESHGUI_MergeDlg.h:130
QGroupBox * GroupKeep
Definition: SMESHGUI_MergeDlg.h:160
QPushButton * AddGroupButton
Definition: SMESHGUI_MergeDlg.h:146
QGroupBox * GroupExclude
Definition: SMESHGUI_MergeDlg.h:157
QGroupBox * TypeBox
Definition: SMESHGUI_MergeDlg.h:167
SMESHGUI_IdPreview * myIdPreview
Definition: SMESHGUI_MergeDlg.h:115
QButtonGroup * GroupType
Definition: SMESHGUI_MergeDlg.h:168
SMESH::ListOfIDSources_var mySubMeshOrGroups
Definition: SMESHGUI_MergeDlg.h:107
QPushButton * buttonApply
Definition: SMESHGUI_MergeDlg.h:129
QCheckBox * SelectAllCB
Definition: SMESHGUI_MergeDlg.h:148
SVTK_Selector * mySelector
Definition: SMESHGUI_MergeDlg.h:102
QListWidget * KeepList
Definition: SMESHGUI_MergeDlg.h:165
QPushButton * buttonOk
Definition: SMESHGUI_MergeDlg.h:127
QGroupBox * GroupCoincident
Definition: SMESHGUI_MergeDlg.h:142
GrpList myGroups
Definition: SMESHGUI_MergeDlg.h:108
QString myEntry
Definition: SMESHGUI_MergeDlg.h:109
SMESH::SMESH_Mesh_var myMesh
Definition: SMESHGUI_MergeDlg.h:106
QPushButton * RemoveElemButton
Definition: SMESHGUI_MergeDlg.h:154
QString myHelpFileName
Definition: SMESHGUI_MergeDlg.h:116
LightApp_SelectionMgr * mySelectionMgr
Definition: SMESHGUI_MergeDlg.h:101
QGroupBox * GroupEdit
Definition: SMESHGUI_MergeDlg.h:151
Definition: SMESHGUI_SpinBox.h:48
Definition: SMESHGUI.h:84
Definition: SMESH_Actor.h:56
Definition: SMESH_ControlsClassifier.cxx:39