Salome HOME
efdd034d23b80800002c45386685fe5f8b26e50e
[modules/geom.git] / 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   virtual void                       restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
54
55 private:
56   void                               Init();
57   void                               enterEvent( QEvent* );
58   void                               initSelection();
59   
60   void                               clearTemporary();
61   
62   bool                               onAcceptLocal();
63   void                               clearShapeBufferLocal( GEOM::GEOM_Object_ptr );
64   // Reimplementation of onAccept for local case of this class.
65   
66   void                               activateSelection();
67   void                               updateButtonState();
68   void                               selectTmpInViewer();
69     
70 private:    
71   GEOM::GEOM_Object_var              myObject;
72   ObjectList                         myTmpObjs;
73     
74   DlgRef_1SelExt*                    GroupPoints;
75   DlgRef_1SelExt*                    GroupPoints2;
76   QDoubleSpinBox*                    myTolEdt;
77   QDoubleSpinBox*                    myTolEdt2;
78   QPushButton*                       myDetectBtn;
79   QCheckBox*                         mySubShapesChk;
80   
81   int                                myCurrConstrId;
82     
83 protected slots:
84   virtual void                       ClickOnCancel();
85     
86 private slots:
87   void                               ClickOnOk();
88   bool                               ClickOnApply();
89
90   void                               ActivateThisDialog();
91
92   void                               LineEditReturnPressed();
93   void                               SelectionIntoArgument();
94   void                               SetEditCurrentArgument();
95
96   void                               ConstructorsClicked( int );
97   //void                               ValueChangedInSpinBox();
98   
99   void                               onDetect();
100   void                               onTolerChanged( double );
101   void                               onSubShapesChk();
102 };
103
104 #endif // REPAIRGUI_GLUEDLG_H