Back to index

salome-smesh  6.5.0
SMESHGUI_ExtrusionAlongPathDlg.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_ExtrusionAlongPathDlg.h
00025 // Author : Vadim SANDLER, Open CASCADE S.A.S.
00026 //
00027 #ifndef SMESHGUI_EXTRUSIONALONGPATHDLG_H
00028 #define SMESHGUI_EXTRUSIONALONGPATHDLG_H
00029 
00030 // SMESH includes
00031 #include "SMESH_SMESHGUI.hxx"
00032 #include "SMESHGUI_PreviewDlg.h"
00033 
00034 // IDL includes
00035 #include <SALOMEconfig.h>
00036 #include CORBA_SERVER_HEADER(SMESH_Mesh)
00037 
00038 class QButtonGroup;
00039 class QRadioButton;
00040 class QGroupBox;
00041 class QLabel;
00042 class QToolButton;
00043 class QLineEdit;
00044 class QCheckBox;
00045 class QListWidget;
00046 class QPushButton;
00047 
00048 class SMESHGUI;
00049 class SMESH_Actor;
00050 class SMESHGUI_IdValidator;
00051 class SMESHGUI_SpinBox;
00052 class SMESHGUI_FilterDlg;
00053 class SVTK_Selector;
00054 class LightApp_SelectionMgr;
00055 class SUIT_SelectionFilter;
00056 
00057 //=================================================================================
00058 // class    : SMESHGUI_ExtrusionAlongPathDlg
00059 // purpose  :
00060 //=================================================================================
00061 class SMESHGUI_EXPORT SMESHGUI_ExtrusionAlongPathDlg : public SMESHGUI_PreviewDlg
00062 {
00063   Q_OBJECT
00064 
00065   class SetBusy;
00066   friend class SetBusy;
00067 
00068 public:
00069   SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* );
00070   ~SMESHGUI_ExtrusionAlongPathDlg();
00071 
00072   bool                      eventFilter( QObject*, QEvent* );
00073 
00074 private:
00075   void                      Init( bool = true );
00076   void                      enterEvent( QEvent* );                           /* mouse enter the QWidget */
00077   void                      keyPressEvent( QKeyEvent* );
00078   int                       GetConstructorId();
00079   void                      SetEditCurrentArgument( QToolButton* );
00080 
00081   bool                      isValid();
00082   bool                      isValuesValid();
00083   
00084   SMESH::long_array_var     getSelectedElements();
00085   SMESH::double_array_var   getAngles();
00086 
00087   void                      updateLinearAngles();
00088   
00089   SMESHGUI_IdValidator*     myIdValidator;
00090   LightApp_SelectionMgr*    mySelectionMgr;        /* User shape selection */
00091   SVTK_Selector*            mySelector;
00092 
00093   QWidget*                  myEditCurrentArgument; /* Current  argument */
00094 
00095   bool                      myBusy;
00096   SMESH::SMESH_Mesh_var     myMesh;
00097   SMESH_Actor*              myMeshActor;
00098   SMESH::SMESH_IDSource_var myIDSource;
00099   //SMESH::SMESH_Mesh_var     myPathMesh;
00100   SMESH::SMESH_IDSource_var myPath;
00101   //GEOM::GEOM_Object_var     myPathShape;
00102   SUIT_SelectionFilter*     myElementsFilter;
00103   SUIT_SelectionFilter*     myPathMeshFilter;
00104   int                       myType;
00105   QList<double>             myAnglesList;
00106 
00107   // widgets
00108   QGroupBox*                ConstructorsBox;
00109   QButtonGroup*             GroupConstructors;
00110   QRadioButton*             Elements1dRB;
00111   QRadioButton*             Elements2dRB;
00112 
00113   QGroupBox*                GroupArguments;
00114   QLabel*                   ElementsLab;
00115   QToolButton*              SelectElementsButton;
00116   QLineEdit*                ElementsLineEdit;
00117   QCheckBox*                MeshCheck;
00118   QGroupBox*                PathGrp;
00119   QToolButton*              SelectPathMeshButton;
00120   QLineEdit*                PathMeshLineEdit;
00121   //QToolButton*              SelectPathShapeButton;
00122   //QLineEdit*                PathShapeLineEdit;
00123   QToolButton*              SelectStartPointButton;
00124   QLineEdit*                StartPointLineEdit;
00125   QCheckBox*                LinearAnglesCheck;
00126   QGroupBox*                AnglesGrp;
00127   QListWidget*              AnglesList;
00128   QToolButton*              AddAngleButton;
00129   QToolButton*              RemoveAngleButton;
00130   SMESHGUI_SpinBox*         AngleSpin;
00131   QGroupBox*                BasePointGrp;
00132   QToolButton*              SelectBasePointButton;
00133   SMESHGUI_SpinBox*         XSpin;
00134   SMESHGUI_SpinBox*         YSpin;
00135   SMESHGUI_SpinBox*         ZSpin;
00136   QCheckBox*                MakeGroupsCheck;
00137 
00138   QGroupBox*                GroupButtons;
00139   QPushButton*              OkButton;
00140   QPushButton*              ApplyButton;
00141   QPushButton*              CloseButton;
00142   QPushButton*              HelpButton;
00143 
00144   QString                   myHelpFileName;
00145 
00146   QPushButton*              myFilterBtn;
00147   SMESHGUI_FilterDlg*       myFilterDlg;
00148    
00149 protected slots:
00150   void                      reject();
00151   virtual void              onDisplaySimulation( bool );
00152 
00153 private slots:
00154   void                      ConstructorsClicked( int );
00155   void                      ClickOnOk();
00156   bool                      ClickOnApply();
00157   void                      ClickOnHelp();
00158   void                      SetEditCurrentArgument();
00159   void                      SelectionIntoArgument();
00160   void                      DeactivateActiveDialog();
00161   void                      ActivateThisDialog();
00162   void                      onTextChange( const QString& );
00163   void                      onSelectMesh();
00164   void                      OnAngleAdded();
00165   void                      OnAngleRemoved();
00166   void                      setFilters();
00167 };
00168 
00169 #endif // SMESHGUI_EXTRUSIONALONGPATHDLG_H