1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #ifndef SMESHGUI_EditMeshDlg_H
22 #define SMESHGUI_EditMeshDlg_H
24 #include "SMESH_SMESHGUI.hxx"
26 #include "LightApp_SelectionMgr.h"
27 #include "SUIT_SelectionFilter.h"
32 // Open CASCADE Includes
45 class SMESHGUI_SpinBox;
48 class SVTK_ViewWindow;
56 #include <SALOMEconfig.h>
57 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
59 //=================================================================================
60 // class : SMESHGUI_EditMeshDlg
62 //=================================================================================
63 class SMESHGUI_EXPORT SMESHGUI_EditMeshDlg : public QDialog
68 SMESHGUI_EditMeshDlg (SMESHGUI * theModule,
70 ~SMESHGUI_EditMeshDlg();
74 void closeEvent (QCloseEvent*);
75 void enterEvent (QEvent*); /* mouse enter the QWidget */
76 void hideEvent (QHideEvent*); /* ESC key */
77 void keyPressEvent(QKeyEvent*);
80 void FindGravityCenter(TColStd_MapOfInteger & ElemsIdMap,
81 std::list< gp_XYZ > & GrCentersXYZ);
82 // add the centers of gravity of ElemsIdMap elements to the GrCentersXYZ list
85 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
86 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
87 SVTK_Selector* mySelector;
89 QWidget* myEditCurrentArgument;
91 SMESH::SMESH_Mesh_var myMesh;
92 SMESH::SMESH_IDSource_var mySubMeshOrGroup;
94 SUIT_SelectionFilter* myMeshOrSubMeshOrGroupFilter;
96 SMESH::TIdPreview* myIdPreview;
102 QButtonGroup* GroupConstructors;
103 QRadioButton* RadioButton;
105 QGroupBox* GroupButtons;
106 QPushButton* buttonOk;
107 QPushButton* buttonCancel;
108 QPushButton* buttonApply;
109 QPushButton* buttonHelp;
111 QGroupBox* GroupMesh;
112 QLabel* TextLabelName;
113 QPushButton* SelectMeshButton;
114 QLineEdit* LineEditMesh;
116 QGroupBox* GroupCoincident;
117 QLabel* TextLabelTolerance;
118 SMESHGUI_SpinBox* SpinBoxTolerance;
119 QPushButton* DetectButton;
120 QListBox* ListCoincident;
121 QPushButton* AddGroupButton;
122 QPushButton* RemoveGroupButton;
123 QCheckBox* SelectAllCB;
125 QGroupBox* GroupEdit;
127 QPushButton* AddElemButton;
128 QPushButton* RemoveElemButton;
129 QPushButton* SetFirstButton;
132 QGridLayout* DlgLayout;
133 QGridLayout* GroupConstructorsLayout;
134 QGridLayout* GroupButtonsLayout;
135 QGridLayout* GroupMeshLayout;
136 QGridLayout* GroupCoincidentLayout;
137 QGridLayout* GroupEditLayout;
139 QString myHelpFileName;
143 void ClickOnCancel();
146 void updateControls();
149 void onRemoveGroup();
150 void onSelectGroup();
151 void onSelectAll(bool isToggled);
152 void onSelectElementFromGroup();
154 void onRemoveElement();
156 void SetEditCurrentArgument();
157 void SelectionIntoArgument() ;
158 void DeactivateActiveDialog() ;
159 void ActivateThisDialog() ;
163 #endif // SMESHGUI_EditMeshDlg_H