1 // Copyright (C) 2007-2008 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.
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
22 #ifndef SMESHGUI_EditMeshDlg_H
23 #define SMESHGUI_EditMeshDlg_H
25 #include "SMESH_SMESHGUI.hxx"
27 #include "LightApp_SelectionMgr.h"
28 #include "SUIT_SelectionFilter.h"
33 // Open CASCADE Includes
46 class SMESHGUI_SpinBox;
49 class SVTK_ViewWindow;
57 #include <SALOMEconfig.h>
58 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
60 //=================================================================================
61 // class : SMESHGUI_EditMeshDlg
63 //=================================================================================
64 class SMESHGUI_EXPORT SMESHGUI_EditMeshDlg : public QDialog
69 SMESHGUI_EditMeshDlg (SMESHGUI * theModule,
71 ~SMESHGUI_EditMeshDlg();
75 void closeEvent (QCloseEvent*);
76 void enterEvent (QEvent*); /* mouse enter the QWidget */
77 void hideEvent (QHideEvent*); /* ESC key */
78 void keyPressEvent(QKeyEvent*);
81 void FindGravityCenter(TColStd_MapOfInteger & ElemsIdMap,
82 std::list< gp_XYZ > & GrCentersXYZ);
83 // add the centers of gravity of ElemsIdMap elements to the GrCentersXYZ list
86 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
87 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
88 SVTK_Selector* mySelector;
90 QWidget* myEditCurrentArgument;
92 SMESH::SMESH_Mesh_var myMesh;
93 SMESH::SMESH_IDSource_var mySubMeshOrGroup;
95 SUIT_SelectionFilter* myMeshOrSubMeshOrGroupFilter;
97 SMESH::TIdPreview* myIdPreview;
103 QButtonGroup* GroupConstructors;
104 QRadioButton* RadioButton;
106 QGroupBox* GroupButtons;
107 QPushButton* buttonOk;
108 QPushButton* buttonCancel;
109 QPushButton* buttonApply;
110 QPushButton* buttonHelp;
112 QGroupBox* GroupMesh;
113 QLabel* TextLabelName;
114 QPushButton* SelectMeshButton;
115 QLineEdit* LineEditMesh;
117 QGroupBox* GroupCoincident;
118 QLabel* TextLabelTolerance;
119 SMESHGUI_SpinBox* SpinBoxTolerance;
120 QPushButton* DetectButton;
121 QListBox* ListCoincident;
122 QPushButton* AddGroupButton;
123 QPushButton* RemoveGroupButton;
124 QCheckBox* SelectAllCB;
126 QGroupBox* GroupEdit;
128 QPushButton* AddElemButton;
129 QPushButton* RemoveElemButton;
130 QPushButton* SetFirstButton;
133 QGridLayout* DlgLayout;
134 QGridLayout* GroupConstructorsLayout;
135 QGridLayout* GroupButtonsLayout;
136 QGridLayout* GroupMeshLayout;
137 QGridLayout* GroupCoincidentLayout;
138 QGridLayout* GroupEditLayout;
140 QString myHelpFileName;
144 void ClickOnCancel();
147 void updateControls();
150 void onRemoveGroup();
151 void onSelectGroup();
152 void onSelectAll(bool isToggled);
153 void onSelectElementFromGroup();
155 void onRemoveElement();
157 void SetEditCurrentArgument();
158 void SelectionIntoArgument() ;
159 void DeactivateActiveDialog() ;
160 void ActivateThisDialog() ;
164 #endif // SMESHGUI_EditMeshDlg_H