00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE 00002 // 00003 // This library is free software; you can redistribute it and/or 00004 // modify it under the terms of the GNU Lesser General Public 00005 // License as published by the Free Software Foundation; either 00006 // version 2.1 of the License. 00007 // 00008 // This library is distributed in the hope that it will be useful, 00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 // Lesser General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU Lesser General Public 00014 // License along with this library; if not, write to the Free Software 00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00016 // 00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00018 // 00019 00020 // SMESH SMESHGUI : GUI for SMESH component 00021 // File : SMESHGUI_ScaleDlg.h 00022 // Author : Sergey Kuul, Open CASCADE S.A.S. 00023 // 00024 #ifndef SMESHGUI_SCALEDLG_H 00025 #define SMESHGUI_SCALEDLG_H 00026 00027 // SMESH includes 00028 #include "SMESH_SMESHGUI.hxx" 00029 #include "SMESHGUI_PreviewDlg.h" 00030 00031 // IDL includes 00032 #include <SALOMEconfig.h> 00033 #include CORBA_SERVER_HEADER(SMESH_Mesh) 00034 00035 class QButtonGroup; 00036 class QGroupBox; 00037 class QLabel; 00038 class QLineEdit; 00039 class QPushButton; 00040 class QRadioButton; 00041 class QCheckBox; 00042 class SMESHGUI; 00043 class SMESHGUI_IdValidator; 00044 class SMESHGUI_SpinBox; 00045 class SMESHGUI_FilterDlg; 00046 class SMESH_Actor; 00047 class SVTK_Selector; 00048 class LightApp_SelectionMgr; 00049 class SMESH_LogicalFilter; 00050 00051 //================================================================================= 00052 // class : SMESHGUI_ScaleDlg 00053 // purpose : 00054 //================================================================================= 00055 class SMESHGUI_EXPORT SMESHGUI_ScaleDlg : public SMESHGUI_PreviewDlg 00056 { 00057 Q_OBJECT 00058 00059 public: 00060 SMESHGUI_ScaleDlg( SMESHGUI* ); 00061 ~SMESHGUI_ScaleDlg(); 00062 00063 private: 00064 void Init( bool = true ); 00065 void closeEvent( QCloseEvent* ); 00066 void enterEvent( QEvent* ); /* mouse enter the QWidget */ 00067 void hideEvent( QHideEvent* ); /* ESC key */ 00068 void keyPressEvent( QKeyEvent* ); 00069 int GetConstructorId(); 00070 void setNewMeshName(); 00071 00072 bool isValid(); 00073 void getScale( SMESH::PointStruct& thePoint, 00074 SMESH::double_array_var& theScaleFact); 00075 00076 SMESHGUI_IdValidator* myIdValidator; 00077 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */ 00078 QString myElementsId; 00079 int myNbOkElements; /* to check when elements are defined */ 00080 00081 SVTK_Selector* mySelector; 00082 00083 QWidget* myEditCurrentArgument; 00084 00085 bool myBusy; 00086 SMESH::SMESH_Mesh_var myMesh; 00087 SMESH_Actor* myActor; 00088 SMESH_LogicalFilter* myMeshOrSubMeshOrGroupFilter; 00089 00090 SMESH::SMESH_IDSource_var mySelectedObject; 00091 00092 QGroupBox* ConstructorsBox; 00093 QButtonGroup* GroupConstructors; 00094 QRadioButton* RadioButton1; 00095 QRadioButton* RadioButton2; 00096 QGroupBox* GroupButtons; 00097 QPushButton* buttonOk; 00098 QPushButton* buttonCancel; 00099 QPushButton* buttonApply; 00100 QPushButton* buttonHelp; 00101 QGroupBox* GroupArguments; 00102 QLabel* TextLabelElements; 00103 QPushButton* SelectElementsButton; 00104 QLineEdit* LineEditElements; 00105 QCheckBox* CheckBoxMesh; 00106 QLabel* TextLabel1; 00107 QPushButton* SelectButton1; 00108 QLabel* TextLabel1_1; 00109 SMESHGUI_SpinBox* SpinBox1_1; 00110 QLabel* TextLabel1_2; 00111 SMESHGUI_SpinBox* SpinBox1_2; 00112 QLabel* TextLabel1_3; 00113 SMESHGUI_SpinBox* SpinBox1_3; 00114 QLabel* TextLabel2; 00115 SMESHGUI_SpinBox* SpinBox_FX; 00116 QLabel* TextLabel3; 00117 SMESHGUI_SpinBox* SpinBox_FY; 00118 QLabel* TextLabel4; 00119 SMESHGUI_SpinBox* SpinBox_FZ; 00120 QGroupBox* ActionBox; 00121 QButtonGroup* ActionGroup; 00122 QCheckBox* MakeGroupsCheck; 00123 QLineEdit* LineEditNewMesh; 00124 00125 QString myHelpFileName; 00126 00127 QPushButton* myFilterBtn; 00128 SMESHGUI_FilterDlg* myFilterDlg; 00129 00130 00131 protected slots: 00132 virtual void onDisplaySimulation( bool ); 00133 00134 private slots: 00135 void ConstructorsClicked( int ); 00136 void ClickOnOk(); 00137 void ClickOnCancel(); 00138 bool ClickOnApply(); 00139 void ClickOnHelp(); 00140 void SetEditCurrentArgument(); 00141 void SelectionIntoArgument(); 00142 void DeactivateActiveDialog(); 00143 void ActivateThisDialog(); 00144 void onTextChange( const QString& ); 00145 void onSelectMesh( bool ); 00146 void onActionClicked( int ); 00147 void setFilters(); 00148 }; 00149 00150 #endif // SMESHGUI_SCALEDLG_H