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_CopyMeshDlg.h 00025 // 00026 #ifndef SMESHGUI_CopyMeshDLG_H 00027 #define SMESHGUI_CopyMeshDLG_H 00028 00029 // SMESH includes 00030 #include "SMESH_SMESHGUI.hxx" 00031 00032 // Qt includes 00033 #include <QDialog> 00034 00035 // IDL includes 00036 #include <SALOMEconfig.h> 00037 #include CORBA_SERVER_HEADER(SMESH_Mesh) 00038 00039 class QCheckBox; 00040 class QGroupBox; 00041 class QLabel; 00042 class QLineEdit; 00043 class QPushButton; 00044 00045 class SMESHGUI; 00046 class SMESHGUI_IdValidator; 00047 class SMESHGUI_FilterDlg; 00048 class SMESH_Actor; 00049 class SVTK_Selector; 00050 class LightApp_SelectionMgr; 00051 class SUIT_SelectionFilter; 00052 00053 //================================================================================= 00054 // class : SMESHGUI_CopyMeshDlg 00055 // purpose : copy some elements or a mesh object into a new mesh 00056 //================================================================================= 00057 00058 class SMESHGUI_EXPORT SMESHGUI_CopyMeshDlg : public QDialog 00059 { 00060 Q_OBJECT 00061 00062 public: 00063 SMESHGUI_CopyMeshDlg( SMESHGUI* ); 00064 ~SMESHGUI_CopyMeshDlg(); 00065 00066 private: 00067 void Init( bool = true ); 00068 void closeEvent( QCloseEvent* ); 00069 void enterEvent( QEvent* ); /* mouse enter the QWidget */ 00070 void hideEvent( QHideEvent* ); /* ESC key */ 00071 void keyPressEvent( QKeyEvent* ); 00072 int GetConstructorId(); 00073 void setNewMeshName(); 00074 00075 bool isValid(); 00076 00077 void setIsApplyAndClose( const bool theFlag ); 00078 bool isApplyAndClose() const; 00079 00080 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */ 00081 SMESHGUI_IdValidator* myIdValidator; 00082 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */ 00083 int myNbOkElements; /* to check when elements are defined */ 00084 00085 SVTK_Selector* mySelector; 00086 00087 bool myBusy; 00088 SMESH::SMESH_Mesh_var myMesh; 00089 SMESH_Actor* myActor; 00090 SUIT_SelectionFilter* myIdSourceFilter; 00091 00092 SMESH::SMESH_IDSource_var mySelectedObject; 00093 00094 QGroupBox* ConstructorsBox; 00095 QGroupBox* GroupArguments; 00096 QGroupBox* GroupButtons; 00097 00098 QPushButton* buttonOk; 00099 QPushButton* buttonCancel; 00100 QPushButton* buttonApply; 00101 QPushButton* buttonHelp; 00102 00103 QLabel* myTextLabelElements; 00104 QLineEdit* myLineEditElements; 00105 QLineEdit* myMeshNameEdit; 00106 QCheckBox* myIdSourceCheck; 00107 QCheckBox* myCopyGroupsCheck; 00108 QCheckBox* myKeepIdsCheck; 00109 00110 QPushButton* myFilterBtn; 00111 SMESHGUI_FilterDlg* myFilterDlg; 00112 00113 QString myHelpFileName; 00114 00115 bool myIsApplyAndClose; 00116 00117 private slots: 00118 void ClickOnOk(); 00119 void ClickOnCancel(); 00120 bool ClickOnApply(); 00121 void ClickOnHelp(); 00122 void SelectionIntoArgument(); 00123 void DeactivateActiveDialog(); 00124 void ActivateThisDialog(); 00125 void onTextChange( const QString& ); 00126 void onSelectIdSource( bool ); 00127 void setFilters(); 00128 }; 00129 00130 #endif // SMESHGUI_CopyMeshDLG_H