Back to index

salome-geom  6.5.0
OperationGUI_ChamferDlg.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 // GEOM GEOMGUI : GUI for Geometry component
00024 // File   : OperationGUI_ChamferDlg.h
00025 // Author : Damien COQUERET, Open CASCADE S.A.S.
00026 //
00027 #ifndef OPERATIONGUI_CHAMFERDLG_H
00028 #define OPERATIONGUI_CHAMFERDLG_H
00029 
00030 #include <GEOMBase_Skeleton.h>
00031 
00032 #include <TColStd_IndexedMapOfInteger.hxx>
00033 
00034 #include <QMap>
00035 
00036 class SalomeApp_DoubleSpinBox;
00037 class QGroupBox;
00038 class QPushButton;
00039 class QLineEdit;
00040 class QGridLayout;
00041 class QRadioButton;
00042 
00043 //=================================================================================
00044 // class    : OperationGUI_ChamferDlg
00045 // purpose  :
00046 //=================================================================================
00047 class OperationGUI_ChamferDlg : public GEOMBase_Skeleton
00048 { 
00049   Q_OBJECT
00050 
00051   enum { MainObj1, MainObj2, Face1, Face2, MainObj3, Faces, MainObj4, Edges};
00052   enum { SpinBox1,
00053          SpinBox21, SpinBox22, SpinBox23, SpinBox24, 
00054          SpinBox31, SpinBox32, SpinBox33, SpinBox34,
00055          SpinBox41, SpinBox42, SpinBox43, SpinBox44  };
00056   enum { RadioButton21, RadioButton22,
00057          RadioButton31, RadioButton32,
00058          RadioButton41, RadioButton42 };
00059 
00060 public:
00061   OperationGUI_ChamferDlg( GeometryGUI*, QWidget* );
00062   virtual ~OperationGUI_ChamferDlg();
00063 
00064 protected:
00065   // redefined from GEOMBase_Helper
00066   virtual                             GEOM::GEOM_IOperations_ptr createOperation();
00067   virtual                             bool isValid( QString& );
00068   virtual                             bool execute( ObjectList& );    
00069 
00070 private slots:
00071   void                                ClickOnOk();
00072   bool                                ClickOnApply();
00073   void                                ActivateThisDialog();
00074   void                                LineEditReturnPressed();
00075   void                                RadioButtonPressed();
00076   void                                SelectionIntoArgument();
00077   void                                SetEditCurrentArgument();
00078   void                                ValueChangedInSpinBox( double );
00079   void                                ConstructorsClicked( int );
00080 
00081 private:
00082   void                                Init();
00083   void                                enterEvent( QEvent* );
00084   void                                createSelWg( const QString&, QPixmap&, QWidget*, 
00085                                                    QGridLayout*, const int );
00086   void                                createRadioWg( const QString&, const QString&, QWidget*, 
00087                                                      QGridLayout*, const int, const int, const int );
00088   void                                activateSelection();
00089   void                                enableWidgets();
00090   
00091 private:
00092   int                                 myConstructorId;
00093   
00094   GEOM::GEOM_Object_var               myShape; 
00095   QMap< int, int >                    myFace;  // indexes of faces from second tab ( Face1,2 )
00096   TColStd_IndexedMapOfInteger         myFaces; // indexes of faces from first tab ( Faces )
00097   TColStd_IndexedMapOfInteger         myEdges; // indexes of edges from fourth tab (Edges)
00098 
00099   // to initialize the first selection field with a selected object on the dialog creation
00100   bool                               myInitial;
00101   
00102   QGroupBox*                          myGrp1;
00103   QGroupBox*                          myGrp2;
00104   QGroupBox*                          myGrp3;
00105   QGroupBox*                          myGrp4;
00106   
00107   QMap< int, QPushButton* >           mySelBtn;
00108   QMap< int, QLineEdit* >             mySelName;
00109   QMap< int, SalomeApp_DoubleSpinBox* > mySpinBox;
00110   QMap< int, QRadioButton* >          myRadioButton;
00111 };
00112 
00113 #endif // OPERATIONGUI_CHAMFERDLG_H