Salome HOME
Merge from V5_1_main 14/05/2010
[modules/geom.git] / src / BlocksGUI / BlocksGUI_QuadFaceDlg.h
1 //  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 // GEOM GEOMGUI : GUI for Geometry component
24 // File   : BlocksGUI_QuadFaceDlg.h
25 // Author : Julia DOROVSKIKH, Open CASCADE S.A.S. (julia.dorovskikh@opencascade.com)
26 //
27 #ifndef BLOCKSGUI_QUADFACEDLG_H
28 #define BLOCKSGUI_QUADFACEDLG_H
29
30 #include <GEOMBase_Skeleton.h>
31
32 #include <QMap>
33
34 class QGroupBox;
35 class QPushButton;
36 class QLineEdit;
37
38 //=================================================================================
39 // class    : BlocksGUI_QuadFaceDlg
40 // purpose  :
41 //=================================================================================
42 class BlocksGUI_QuadFaceDlg : public GEOMBase_Skeleton
43 {
44   Q_OBJECT
45
46   enum { Vertex1, Vertex2, Vertex3, Vertex4,
47          Edge12, Edge22,
48          Edge14, Edge24, Edge34, Edge44 };
49
50 public:
51   BlocksGUI_QuadFaceDlg (GeometryGUI*, QWidget*);
52   ~BlocksGUI_QuadFaceDlg();
53
54 protected:
55   // redefined from GEOMBase_Helper
56   virtual GEOM::GEOM_IOperations_ptr createOperation();
57   virtual bool                       isValid (QString&);
58   virtual bool                       execute (ObjectList&);
59   virtual void                       addSubshapesToStudy();
60
61 private:
62   void                               Init();
63   void                               enterEvent (QEvent*);
64
65   void                               createSelWg (const QString&, QPixmap&,
66                                                   QWidget*, const int);
67   void                               activateSelection();
68
69 private:
70   int                                myConstructorId;
71
72   GEOM::GEOM_Object_var              myShape1;
73   GEOM::GEOM_Object_var              myShape2;
74   GEOM::GEOM_Object_var              myShape3;
75   GEOM::GEOM_Object_var              myShape4;
76
77   // to initialize the first selection field with a selected object on the dialog creation
78   bool                               myInitial;
79
80   QGroupBox*                         myGrp1;
81   QGroupBox*                         myGrp2;
82   QGroupBox*                         myGrp3;
83
84   QMap<int, QPushButton*>            mySelBtn;
85   QMap<int, QLineEdit*>              mySelName;
86
87 private slots:
88   void                               ClickOnOk();
89   bool                               ClickOnApply();
90   void                               ActivateThisDialog();
91   void                               ConstructorsClicked (int);
92
93   void                               SelectionIntoArgument();
94   void                               SetEditCurrentArgument();
95 };
96
97 #endif // BLOCKSGUI_QUADFACEDLG_H