Back to index

salome-smesh  6.5.0
SMESHGUI_ExtrusionDlg.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  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_ExtrusionDlg.h
00025 // Author : Michael ZORIN, Open CASCADE S.A.S.
00026 //
00027 #ifndef SMESHGUI_EXTRUSIONDLG_H
00028 #define SMESHGUI_EXTRUSIONDLG_H
00029 
00030 // SMESH includes
00031 #include "SMESH_SMESHGUI.hxx"
00032 #include "SMESHGUI_PreviewDlg.h"
00033 
00034 // SALOME GUI includes
00035 #include <SALOME_InteractiveObject.hxx>
00036 
00037 // IDL includes
00038 #include <SALOMEconfig.h>
00039 #include CORBA_SERVER_HEADER(SMESH_Mesh)
00040 
00041 class QButtonGroup;
00042 class QRadioButton;
00043 class QGroupBox;
00044 class QLabel;
00045 class QLineEdit;
00046 class QCheckBox;
00047 class QPushButton;
00048 
00049 class SMESHGUI;
00050 class SMESH_Actor;
00051 class SMESHGUI_IdValidator;
00052 class SMESHGUI_SpinBox;
00053 class SMESHGUI_FilterDlg;
00054 class SVTK_Selector;
00055 class LightApp_SelectionMgr;
00056 class SUIT_SelectionFilter;
00057 class SalomeApp_IntSpinBox;
00058 
00059 //=================================================================================
00060 // class    : SMESHGUI_ExtrusionDlg
00061 // purpose  :
00062 //=================================================================================
00063 class SMESHGUI_EXPORT SMESHGUI_ExtrusionDlg : public SMESHGUI_PreviewDlg
00064 {
00065   Q_OBJECT
00066 
00067 public:
00068   SMESHGUI_ExtrusionDlg( SMESHGUI* );
00069   ~SMESHGUI_ExtrusionDlg();
00070 
00071   void                             reject();
00072 
00073 private:
00074   void                             Init( bool = true );
00075   void                             enterEvent( QEvent* );       /* mouse enter the QWidget */
00076   void                             closeEvent( QCloseEvent* );
00077   void                             keyPressEvent( QKeyEvent* );
00078   int                              GetConstructorId();
00079   void                             getExtrusionVector(SMESH::DirStruct& aVector);
00080   
00081   bool                             isValid();
00082   bool                             isValuesValid();
00083   
00084   SMESHGUI_IdValidator*            myIdValidator;
00085   LightApp_SelectionMgr*           mySelectionMgr;        /* User shape selection */
00086   QWidget*                         myEditCurrentArgument; /* Current  argument editor */
00087   int                              myNbOkElements;        /* to check when elements are defined */
00088   SVTK_Selector*                   mySelector;
00089 
00090   SMESH::SMESH_IDSource_var        mySelectedObject;
00091 
00092   bool                             myBusy;
00093   SMESH::SMESH_Mesh_var            myMesh;
00094   SMESH::long_array_var            myElementsId;
00095   SMESH_Actor*                     myActor;
00096   Handle(SALOME_InteractiveObject) myIO;
00097   SUIT_SelectionFilter*            myMeshOrSubMeshOrGroupFilter;
00098 
00099   // widgets
00100   QGroupBox*                       ConstructorsBox;
00101   QButtonGroup*                    GroupConstructors;
00102   QRadioButton*                    RadioButton0;
00103   QRadioButton*                    RadioButton1;
00104   QRadioButton*                    RadioButton2;
00105   QRadioButton*                    RadioButton3;
00106   QRadioButton*                    RadioButton4;
00107 
00108   QGroupBox*                       GroupArguments;
00109   QGroupBox*                       GroupDimensions;
00110   QLabel*                          TextLabelElements;
00111   QPushButton*                     SelectElementsButton;
00112   QLineEdit*                       LineEditElements;
00113   QCheckBox*                       CheckBoxMesh;
00114   QLabel*                          TextLabelVector;
00115   QLabel*                          TextLabelDistance;
00116   QPushButton*                     SelectVectorButton;
00117   QLabel*                          TextLabelDx;
00118   SMESHGUI_SpinBox*                SpinBox_Dx;
00119   QLabel*                          TextLabelDy;
00120   SMESHGUI_SpinBox*                SpinBox_Dy;
00121   QLabel*                          TextLabelDz;
00122   SMESHGUI_SpinBox*                SpinBox_Dz;
00123   QLabel*                          TextLabelVx;
00124   SMESHGUI_SpinBox*                SpinBox_Vx;
00125   QLabel*                          TextLabelVy;
00126   SMESHGUI_SpinBox*                SpinBox_Vy;
00127   QLabel*                          TextLabelVz;
00128   SMESHGUI_SpinBox*                SpinBox_Vz;
00129   QLabel*                          TextLabelDist;
00130   SMESHGUI_SpinBox*                SpinBox_VDist;
00131   QLabel*                          TextLabelNbSteps;
00132   SalomeApp_IntSpinBox*            SpinBox_NbSteps;
00133   QCheckBox*                       MakeGroupsCheck;
00134 
00135   QGroupBox*                       GroupButtons;
00136   QPushButton*                     buttonOk;
00137   QPushButton*                     buttonCancel;
00138   QPushButton*                     buttonApply;
00139   QPushButton*                     buttonHelp;
00140 
00141   QString                          myHelpFileName;
00142   QString                          myIDs;
00143 
00144   QPushButton*                     myFilterBtn;
00145   SMESHGUI_FilterDlg*              myFilterDlg;
00146 
00147 protected slots:
00148   virtual void              onDisplaySimulation( bool );
00149    
00150 private slots:
00151   void                            ConstructorsClicked( int );
00152   void                            CheckIsEnable();
00153   void                            ClickOnOk();
00154   bool                            ClickOnApply();
00155   void                            ClickOnCancel();
00156   void                            ClickOnHelp();
00157   void                            ClickOnRadio();
00158   void                            SetEditCurrentArgument();
00159   void                            SelectionIntoArgument();
00160   void                            DeactivateActiveDialog();
00161   void                            ActivateThisDialog();
00162   void                            onTextChange( const QString& );
00163   void                            onSelectMesh( bool );
00164   void                            setFilters();
00165 };
00166 
00167 #endif // SMESHGUI_EXTRUSIONDLG_H