Back to index

salome-smesh  6.5.0
SMESHGUI_RevolutionDlg.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_RevolutionDlg.h
00025 // Author : Michael ZORIN, Open CASCADE S.A.S.
00026 //
00027 #ifndef SMESHGUI_REVOLUTIONDLG_H
00028 #define SMESHGUI_REVOLUTIONDLG_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 // Qt includes
00038 #include <QMap>
00039 
00040 // IDL includes
00041 #include <SALOMEconfig.h>
00042 #include CORBA_SERVER_HEADER(SMESH_Mesh)
00043 
00044 class QButtonGroup;
00045 class QGroupBox;
00046 class QLabel;
00047 class QLineEdit;
00048 class QPushButton;
00049 class QRadioButton;
00050 class QCheckBox;
00051 class SalomeApp_IntSpinBox;
00052 class SMESHGUI_IdValidator;
00053 class SMESHGUI_SpinBox;
00054 class SMESHGUI;
00055 class SMESHGUI_FilterDlg;
00056 class SMESH_Actor;
00057 class SVTK_Selector;
00058 class LightApp_SelectionMgr;
00059 class SMESH_LogicalFilter;
00060 class SALOME_Actor;
00061 class SMESHGUI_MeshEditPreview;
00062 class QMenu;
00063 class QAction;
00064 
00065 //=================================================================================
00066 // class    : SMESHGUI_RevolutionDlg
00067 // purpose  :
00068 //=================================================================================
00069 class SMESHGUI_EXPORT SMESHGUI_RevolutionDlg : public SMESHGUI_PreviewDlg
00070 { 
00071   Q_OBJECT
00072 
00073 public:
00074   SMESHGUI_RevolutionDlg( SMESHGUI* );
00075   ~SMESHGUI_RevolutionDlg();
00076 
00077   void                      reject();
00078 
00079 private:
00080   enum {NONE_SELECT, POINT_SELECT, FACE_SELECT};
00081   
00082   void                      Init( bool = true);
00083   void                      closeEvent( QCloseEvent* );
00084   void                      enterEvent( QEvent* );           /* mouse enter the QWidget */
00085   void                      keyPressEvent( QKeyEvent* );
00086   int                       GetConstructorId();
00087   bool                      IsAxisOk();
00088   
00089   bool                      isValid();
00090   
00091   SMESHGUI_IdValidator*     myIdValidator;
00092   LightApp_SelectionMgr*    mySelectionMgr;          /* User shape selection */
00093   int                       myNbOkElements;          /* to check when elements are defined */
00094   QString                   myElementsId;
00095   QWidget*                  myEditCurrentArgument;   /* Current  argument */
00096   SVTK_Selector*            mySelector;
00097   Handle(SALOME_InteractiveObject) myIO;
00098   
00099   SMESH::SMESH_IDSource_var mySelectedObject;
00100 
00101   bool                      myBusy;
00102   SMESH::SMESH_Mesh_var     myMesh;
00103   SMESH_Actor*              myActor;
00104   SMESH_LogicalFilter*      myMeshOrSubMeshOrGroupFilter;
00105   SMESHGUI_MeshEditPreview* mySimulation;
00106   SALOME_Actor*             myPreviewActor;
00107 
00108   QGroupBox*                ConstructorsBox;
00109   QButtonGroup*             GroupConstructors;
00110   QRadioButton*             RadioButton1;
00111   QRadioButton*             RadioButton2;
00112   QGroupBox*                GroupButtons;
00113   QPushButton*              buttonOk;
00114   QPushButton*              buttonCancel;
00115   QPushButton*              buttonApply;
00116   QPushButton*              buttonHelp;
00117   QGroupBox*                GroupArguments;
00118   QGroupBox*                GroupAxis;
00119   QLabel*                   TextLabelElements;
00120   QPushButton*              SelectElementsButton;
00121   QLineEdit*                LineEditElements;
00122   QCheckBox*                CheckBoxMesh;
00123   QCheckBox*                MakeGroupsCheck;
00124   QGroupBox*                GroupAngleBox;
00125   QButtonGroup*             GroupAngle;
00126   QRadioButton*             RadioButton3;
00127   QRadioButton*             RadioButton4;
00128   
00129   QLabel*                   TextLabelPoint;
00130   QPushButton*              SelectPointButton;
00131   QLabel*                   TextLabelX;
00132   SMESHGUI_SpinBox*         SpinBox_X;
00133   QLabel*                   TextLabelY;
00134   SMESHGUI_SpinBox*         SpinBox_Y;
00135   QLabel*                   TextLabelZ;
00136   SMESHGUI_SpinBox*         SpinBox_Z;
00137   QLabel*                   TextLabelVector;
00138   QPushButton*              SelectVectorButton;
00139   QLabel*                   TextLabelDX;
00140   SMESHGUI_SpinBox*         SpinBox_DX;
00141   QLabel*                   TextLabelDY;
00142   SMESHGUI_SpinBox*         SpinBox_DY;
00143   QLabel*                   TextLabelDZ;
00144   SMESHGUI_SpinBox*         SpinBox_DZ;
00145   
00146   QLabel*                   TextLabelAngle;
00147   SMESHGUI_SpinBox*         SpinBox_Angle;
00148   QLabel*                   TextLabelNbSteps;
00149   SalomeApp_IntSpinBox*     SpinBox_NbSteps;
00150   QLabel*                   TextLabelTolerance;
00151   SMESHGUI_SpinBox*         SpinBox_Tolerance;
00152 
00153   QMenu*                    SelectVectorMenu;
00154   QMap<QAction*,int>        myMenuActions;
00155   int                       myVectorDefinition;
00156 
00157   
00158   QString                   myHelpFileName;
00159   QString                   myIDs;
00160   
00161   QPushButton*              myFilterBtn;
00162   SMESHGUI_FilterDlg*       myFilterDlg;
00163 
00164 protected slots:
00165   virtual void              onDisplaySimulation( bool );
00166    
00167 private slots:
00168   void                      ConstructorsClicked( int );
00169   void                      ClickOnOk();
00170   void                      ClickOnCancel();
00171   bool                      ClickOnApply();
00172   void                      ClickOnHelp();
00173   void                      SetEditCurrentArgument();
00174   void                      SelectionIntoArgument();
00175   void                      DeactivateActiveDialog();
00176   void                      ActivateThisDialog();
00177   void                      onTextChange( const QString& );
00178   void                      onAngleTextChange( const QString& );
00179   void                      onSelectMesh( bool );
00180   void                      onVectorChanged();
00181   void                      onSelectVectorMenu( QAction* );
00182   void                      onSelectVectorButton();
00183   void                      setFilters();
00184 };
00185 
00186 #endif // SMESHGUI_REVOLUTIONDLG_H