Salome HOME
Merge from V5_1_3_BR branch (07/12/09)
[modules/geom.git] / src / BasicGUI / BasicGUI_PointDlg.h
1 //  Copyright (C) 2007-2008  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 // GEOM GEOMGUI : GUI for Geometry component
23 // File   : BasicGUI_PointDlg.h
24 // Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
25 //
26 #ifndef BASICGUI_POINTDLG_H
27 #define BASICGUI_POINTDLG_H
28
29 #include <GEOMBase_Skeleton.h>
30
31 class DlgRef_1Sel1Spin;
32 class DlgRef_3Spin;
33 class DlgRef_2Sel;
34 class DlgRef_1Sel3Spin;
35 class DlgRef_1Sel2Spin;
36
37 class QLineEdit;
38 class QGroupBox;
39 class QButtonGroup;
40
41 class gp_Pnt;
42
43 //=================================================================================
44 // class    : BasicGUI_PointDlg
45 // purpose  :
46 //=================================================================================
47 class BasicGUI_PointDlg : public GEOMBase_Skeleton
48
49   Q_OBJECT
50
51 public:
52   BasicGUI_PointDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
53
54   ~BasicGUI_PointDlg();
55
56   bool                               acceptMouseEvent() const { return ( getConstructorId() == 0 );  }
57   void                               OnPointSelected( const gp_Pnt& ); // called by BasicGUI::OnMousePress()
58
59 protected:
60   // redefined from GEOMBase_Helper
61   virtual GEOM::GEOM_IOperations_ptr createOperation();
62   virtual bool                       isValid( QString& );
63   virtual bool                       execute( ObjectList& );
64   virtual void                       addSubshapesToStudy();
65
66 private:
67   void                               Init();
68   void                               enterEvent( QEvent* );
69   double                             getParameter() const;
70   double                             getUParameter() const;
71   double                             getVParameter() const;
72   void                               updateParamCoord(bool theIsUpdate);
73
74 private:
75   GEOM::GEOM_Object_var              myEdge;
76   GEOM::GEOM_Object_var              myFace;
77   GEOM::GEOM_Object_var              myRefPoint; 
78   GEOM::GEOM_Object_var              myLine1; 
79   GEOM::GEOM_Object_var              myLine2;
80   
81   DlgRef_3Spin*                      GroupXYZ;
82   DlgRef_1Sel3Spin*                  GroupRefPoint;
83   DlgRef_1Sel1Spin*                  GroupOnCurve;
84   DlgRef_2Sel*                       GroupLineIntersection;
85   DlgRef_1Sel2Spin*                  GroupOnSurface;
86   
87   QGroupBox*                         myCoordGrp;
88   QLineEdit*                         myX;
89   QLineEdit*                         myY;
90   QLineEdit*                         myZ;
91   QButtonGroup*                      myParamCoord;
92   
93 private slots:
94   void                               ClickOnOk();
95   bool                               ClickOnApply();
96   void                               ActivateThisDialog();
97   void                               DeactivateActiveDialog();
98   void                               LineEditReturnPressed();
99   void                               SelectionIntoArgument();
100   void                               SetEditCurrentArgument();
101   void                               ConstructorsClicked( int );
102   void                               ValueChangedInSpinBox( double );
103   void                               SetDoubleSpinBoxStep( double );
104   void                               ClickParamCoord();
105 };
106
107 #endif // BASICGUI_POINTDLG_H