src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.h

Go to the documentation of this file.
00001 //  SMESH SMESHGUI : GUI for SMESH component
00002 //
00003 //  Copyright (C) 2003  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 //
00024 //  File   : SMESHGUI_ExtrusionAlongPathDlg.h
00025 //  Author : Vadim SANDLER
00026 //  Module : SMESH
00027 //  $Header: 
00028 
00029 #ifndef DIALOGBOX_EXTRUSION_PATH_H
00030 #define DIALOGBOX_EXTRUSION_PATH_H
00031 
00032 #include "LightApp_SelectionMgr.h"
00033 #include "SUIT_SelectionFilter.h"
00034 
00035 // QT Includes
00036 #include <qdialog.h>
00037 
00038 class QButtonGroup;
00039 class QRadioButton;
00040 class QGroupBox;
00041 class QLabel;
00042 class QToolButton;
00043 class QLineEdit;
00044 class QCheckBox;
00045 class QListBox;
00046 class QPushButton;
00047 
00048 class SMESHGUI;
00049 class SMESH_Actor;
00050 class SMESHGUI_SpinBox;
00051 class SVTK_ViewWindow;
00052 class SVTK_Selector;
00053 
00054 
00055 // IDL Headers
00056 #include <SALOMEconfig.h>
00057 #include CORBA_SERVER_HEADER(SMESH_Mesh)
00058 
00059 //=================================================================================
00060 // class    : SMESHGUI_ExtrusionAlongPathDlg
00061 // purpose  :
00062 //=================================================================================
00063 class SMESHGUI_ExtrusionAlongPathDlg : public QDialog
00064 {
00065   Q_OBJECT
00066 
00067   class SetBusy {
00068     public:
00069       SetBusy (SMESHGUI_ExtrusionAlongPathDlg* _dlg) { myDlg = _dlg; myDlg->myBusy = true; }
00070       ~SetBusy() { myDlg->myBusy = false; }
00071     private:
00072       SMESHGUI_ExtrusionAlongPathDlg* myDlg;
00073   };
00074   friend class SetBusy;
00075 
00076 public:
00077   SMESHGUI_ExtrusionAlongPathDlg (SMESHGUI*,
00078                       bool modal = FALSE);
00079   ~SMESHGUI_ExtrusionAlongPathDlg();
00080 
00081   bool eventFilter (QObject* object, QEvent* event);
00082 
00083 private:
00084   void Init (bool ResetControls = true);
00085   void enterEvent (QEvent*);                           /* mouse enter the QWidget */
00086   void keyPressEvent(QKeyEvent*);
00087   int  GetConstructorId();
00088   void SetEditCurrentArgument (QToolButton* button);
00089 
00090   SMESHGUI*                     mySMESHGUI;            /* Current SMESHGUI object */
00091   LightApp_SelectionMgr*        mySelectionMgr;        /* User shape selection */
00092   SVTK_Selector*                mySelector;
00093 
00094   QWidget*                      myEditCurrentArgument; /* Current  argument */
00095 
00096   bool                          myBusy;
00097   SMESH::SMESH_Mesh_var         myMesh;
00098   SMESH_Actor*                  myMeshActor;
00099   SMESH::SMESH_IDSource_var     myIDSource;
00100   SMESH::SMESH_Mesh_var         myPathMesh;
00101   GEOM::GEOM_Object_var         myPathShape;
00102   SUIT_SelectionFilter*         myElementsFilter;
00103   SUIT_SelectionFilter*         myPathMeshFilter;
00104   int                           myType;
00105 
00106   // widgets
00107   QButtonGroup*     GroupConstructors;
00108   QRadioButton*     Elements1dRB;
00109   QRadioButton*     Elements2dRB;
00110 
00111   QGroupBox*        GroupArguments;
00112   QLabel*           ElementsLab;
00113   QToolButton*      SelectElementsButton;
00114   QLineEdit*        ElementsLineEdit;
00115   QCheckBox*        MeshCheck;
00116   QGroupBox*        PathGrp;
00117   QLabel*           PathMeshLab;
00118   QToolButton*      SelectPathMeshButton;
00119   QLineEdit*        PathMeshLineEdit;
00120   QLabel*           PathShapeLab;
00121   QToolButton*      SelectPathShapeButton;
00122   QLineEdit*        PathShapeLineEdit;
00123   QLabel*           StartPointLab;
00124   QToolButton*      SelectStartPointButton;
00125   QLineEdit*        StartPointLineEdit;
00126   QCheckBox*        LinearAnglesCheck;
00127   QCheckBox*        AnglesCheck;
00128   QGroupBox*        AnglesGrp;
00129   QListBox*         AnglesList;
00130   QToolButton*      AddAngleButton;
00131   QToolButton*      RemoveAngleButton;
00132   SMESHGUI_SpinBox* AngleSpin;
00133   QCheckBox*        BasePointCheck;
00134   QGroupBox*        BasePointGrp;
00135   QToolButton*      SelectBasePointButton;
00136   QLabel*           XLab;
00137   SMESHGUI_SpinBox* XSpin;
00138   QLabel*           YLab;
00139   SMESHGUI_SpinBox* YSpin;
00140   QLabel*           ZLab;
00141   SMESHGUI_SpinBox* ZSpin;
00142 
00143   QGroupBox*        GroupButtons;
00144   QPushButton*      OkButton;
00145   QPushButton*      ApplyButton;
00146   QPushButton*      CloseButton;
00147   QPushButton*      HelpButton;
00148 
00149   QString           myHelpFileName;
00150 
00151 protected slots:
00152   void reject();
00153 
00154 private slots:
00155   void ConstructorsClicked (int);
00156   void ClickOnOk();
00157   bool ClickOnApply();
00158   void ClickOnHelp();
00159   void SetEditCurrentArgument();
00160   void SelectionIntoArgument();
00161   void DeactivateActiveDialog();
00162   void ActivateThisDialog();
00163   void onTextChange (const QString&);
00164   void onSelectMesh();
00165   void onAnglesCheck();
00166   void onBasePointCheck();
00167   void OnAngleAdded();
00168   void OnAngleRemoved();
00169 };
00170 
00171 #endif // DIALOGBOX_EXTRUSION_PATH_H