Salome HOME
Merge from branch BR_Dev_For_4_0 (from tag mergeto_BR_QT4_Dev_12Feb08)
[modules/geom.git] / src / RepairGUI / RepairGUI_GlueDlg.h
1 // GEOM GEOMGUI : GUI for Geometry component
2 //
3 // Copyright (C) 2003  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 // File   : RepairGUI_GlueDlg.h
23 // Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
24 //
25
26 #ifndef REPAIRGUI_GLUEDLG_H
27 #define REPAIRGUI_GLUEDLG_H
28
29 #include <GEOMBase_Skeleton.h>
30
31 class DlgRef_1SelExt;
32 class QDoubleSpinBox;
33 class QPushButton;
34 class QCheckBox;
35
36 //=================================================================================
37 // class    : RepairGUI_GlueDlg
38 // purpose  :
39 //=================================================================================
40 class RepairGUI_GlueDlg : public GEOMBase_Skeleton
41 {
42   Q_OBJECT
43
44 public:
45   RepairGUI_GlueDlg( GeometryGUI*, QWidget* = 0, bool = false );
46   ~RepairGUI_GlueDlg();
47
48 protected:
49   // redefined from GEOMBase_Helper
50   virtual GEOM::GEOM_IOperations_ptr createOperation();
51   virtual bool                       isValid( QString& );
52   virtual bool                       execute( ObjectList& );
53
54 private:
55   void                               Init();
56   void                               enterEvent( QEvent* );
57   void                               initSelection();
58   
59   void                               clearTemporary();
60   
61   bool                               onAcceptLocal();
62   void                               clearShapeBufferLocal( GEOM::GEOM_Object_ptr );
63   // Reimplementation of onAccept for local case of this class.
64   
65   void                               activateSelection();
66   void                               updateButtonState();
67   void                               selectTmpInViewer();
68     
69 private:    
70   GEOM::GEOM_Object_var              myObject;
71   ObjectList                         myTmpObjs;
72     
73   DlgRef_1SelExt*                    GroupPoints;
74   DlgRef_1SelExt*                    GroupPoints2;
75   QDoubleSpinBox*                    myTolEdt;
76   QDoubleSpinBox*                    myTolEdt2;
77   QPushButton*                       myDetectBtn;
78   QCheckBox*                         mySubShapesChk;
79   
80   int                                myCurrConstrId;
81     
82 protected slots:
83   virtual void                       ClickOnCancel();
84     
85 private slots:
86   void                               ClickOnOk();
87   bool                               ClickOnApply();
88
89   void                               ActivateThisDialog();
90
91   void                               LineEditReturnPressed();
92   void                               SelectionIntoArgument();
93   void                               SetEditCurrentArgument();
94
95   void                               ConstructorsClicked( int );
96   //void                               ValueChangedInSpinBox();
97   
98   void                               onDetect();
99   void                               onTolerChanged( double );
100   void                               onSubShapesChk();
101 };
102
103 #endif // REPAIRGUI_GLUEDLG_H