00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE 00002 // 00003 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, 00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 00005 // 00006 // This library is free software; you can redistribute it and/or 00007 // modify it under the terms of the GNU Lesser General Public 00008 // License as published by the Free Software Foundation; either 00009 // version 2.1 of the License. 00010 // 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 // Lesser General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU Lesser General Public 00017 // License along with this library; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 // 00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00021 // 00022 00023 // SMESH SMESHGUI : GUI for SMESH component 00024 // File : SMESHGUI_MergeDlg.h 00025 // Author : Open CASCADE S.A.S. 00026 // 00027 #ifndef SMESHGUI_MergeDlg_H 00028 #define SMESHGUI_MergeDlg_H 00029 00030 // SMESH includes 00031 #include "SMESH_SMESHGUI.hxx" 00032 00033 // Qt includes 00034 #include <QDialog> 00035 00036 // OCCT includes 00037 #include <gp_XYZ.hxx> 00038 00039 // STL includes 00040 #include <list> 00041 00042 // IDL includes 00043 #include <SALOMEconfig.h> 00044 #include CORBA_SERVER_HEADER(SMESH_Mesh) 00045 00046 class QGroupBox; 00047 class QLabel; 00048 class QLineEdit; 00049 class QPushButton; 00050 class QRadioButton; 00051 class QCheckBox; 00052 class QListWidget; 00053 class QButtonGroup; 00054 class SMESHGUI; 00055 class SMESHGUI_SpinBox; 00056 class SMESH_Actor; 00057 class SVTK_Selector; 00058 class LightApp_SelectionMgr; 00059 class SUIT_SelectionFilter; 00060 class TColStd_MapOfInteger; 00061 00062 namespace SMESH 00063 { 00064 struct TIdPreview; 00065 } 00066 00067 //================================================================================= 00068 // class : SMESHGUI_MergeDlg 00069 // purpose : 00070 //================================================================================= 00071 class SMESHGUI_EXPORT SMESHGUI_MergeDlg : public QDialog 00072 { 00073 Q_OBJECT; 00074 00075 public: 00076 SMESHGUI_MergeDlg( SMESHGUI*, int ); 00077 ~SMESHGUI_MergeDlg(); 00078 00079 private: 00080 void Init(); 00081 void closeEvent( QCloseEvent* ); 00082 void enterEvent( QEvent* ); /* mouse enter the QWidget */ 00083 void hideEvent( QHideEvent* ); /* ESC key */ 00084 void keyPressEvent( QKeyEvent* ); 00085 void onEditGroup(); 00086 00087 void FindGravityCenter( TColStd_MapOfInteger&, 00088 std::list<gp_XYZ>& ); 00089 // add the centers of gravity of ElemsIdMap elements to the GrCentersXYZ list 00090 00091 private: 00092 typedef QList<SMESH::SMESH_GroupBase_var> GrpList; 00093 00094 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */ 00095 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */ 00096 SVTK_Selector* mySelector; 00097 00098 QWidget* myEditCurrentArgument; 00099 00100 SMESH::SMESH_Mesh_var myMesh; 00101 SMESH::SMESH_IDSource_var mySubMeshOrGroup; 00102 SMESH_Actor* myActor; 00103 SUIT_SelectionFilter* myMeshOrSubMeshOrGroupFilter; 00104 00105 SMESH::TIdPreview* myIdPreview; 00106 00107 int myAction; 00108 bool myIsBusy; 00109 int myTypeId; 00110 00111 // Widgets 00112 QGroupBox* GroupConstructors; 00113 QRadioButton* RadioButton; 00114 00115 QGroupBox* GroupButtons; 00116 QPushButton* buttonOk; 00117 QPushButton* buttonCancel; 00118 QPushButton* buttonApply; 00119 QPushButton* buttonHelp; 00120 00121 QGroupBox* GroupMesh; 00122 QLabel* TextLabelName; 00123 QPushButton* SelectMeshButton; 00124 QLineEdit* LineEditMesh; 00125 00126 QGroupBox* GroupCoincident; 00127 QWidget* GroupCoincidentWidget; 00128 QLabel* TextLabelTolerance; 00129 SMESHGUI_SpinBox* SpinBoxTolerance; 00130 QPushButton* DetectButton; 00131 QListWidget* ListCoincident; 00132 QPushButton* AddGroupButton; 00133 QPushButton* RemoveGroupButton; 00134 QCheckBox* SelectAllCB; 00135 00136 QGroupBox* GroupEdit; 00137 QListWidget* ListEdit; 00138 QPushButton* AddElemButton; 00139 QPushButton* RemoveElemButton; 00140 QPushButton* SetFirstButton; 00141 00142 QGroupBox* GroupExclude; 00143 QListWidget* ListExclude; 00144 00145 QGroupBox* TypeBox; 00146 QButtonGroup* GroupType; 00147 00148 QString myHelpFileName; 00149 00150 QString myEntry; 00151 GrpList myGroups; 00152 00153 private slots: 00154 void ClickOnOk(); 00155 void ClickOnCancel(); 00156 bool ClickOnApply(); 00157 void ClickOnHelp(); 00158 void updateControls(); 00159 void onDetect(); 00160 void onAddGroup(); 00161 void onRemoveGroup(); 00162 void onSelectGroup(); 00163 void onSelectAll( bool ); 00164 void onSelectElementFromGroup(); 00165 void onAddElement(); 00166 void onRemoveElement(); 00167 void onSetFirst(); 00168 void SetEditCurrentArgument(); 00169 void SelectionIntoArgument(); 00170 void DeactivateActiveDialog(); 00171 void ActivateThisDialog(); 00172 void onTypeChanged(int); 00173 }; 00174 00175 #endif // SMESHGUI_MergeDlg_H