Salome HOME
Mantis issue 0021071: Regression in GetInPlace. A fix by PKV on Partition error.
[modules/geom.git] / src / BasicGUI / BasicGUI_PointDlg.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   : BasicGUI_PointDlg.h
25 // Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
26 //
27 #ifndef BASICGUI_POINTDLG_H
28 #define BASICGUI_POINTDLG_H
29
30 #include <GEOMBase_Skeleton.h>
31 #include <QMap>
32
33 class DlgRef_1Sel1Spin;
34 class DlgRef_3Spin;
35 class DlgRef_2Sel;
36 class DlgRef_1Sel3Spin;
37 class DlgRef_1Sel2Spin;
38
39 class QLineEdit;
40 class QGroupBox;
41 class QButtonGroup;
42 class QMenu;
43 class QAction;
44
45 class gp_Pnt;
46
47 //=================================================================================
48 // class    : BasicGUI_PointDlg
49 // purpose  :
50 //=================================================================================
51 class BasicGUI_PointDlg : public GEOMBase_Skeleton
52
53   Q_OBJECT
54
55 public:
56   BasicGUI_PointDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
57
58   ~BasicGUI_PointDlg();
59
60   bool                               acceptMouseEvent() const { return ( getConstructorId() == 0 );  }
61   void                               OnPointSelected( const gp_Pnt& ); // called by BasicGUI::OnMousePress()
62
63 protected:
64   // redefined from GEOMBase_Helper
65   virtual GEOM::GEOM_IOperations_ptr createOperation();
66   virtual bool                       isValid( QString& );
67   virtual bool                       execute( ObjectList& );
68   virtual void                       addSubshapesToStudy();
69
70 private:
71   void                               Init();
72   void                               enterEvent( QEvent* );
73   double                             getParameter() const;
74   double                             getUParameter() const;
75   double                             getVParameter() const;
76   void                               updateParamCoord(bool theIsUpdate);
77
78 private:
79   GEOM::GEOM_Object_var              myEdge;
80   GEOM::GEOM_Object_var              myFace;
81   GEOM::GEOM_Object_var              myRefPoint; 
82   GEOM::GEOM_Object_var              myLine1; 
83   GEOM::GEOM_Object_var              myLine2;
84   
85   bool                               myBusy;
86
87   DlgRef_3Spin*                      GroupXYZ;
88   DlgRef_1Sel3Spin*                  GroupRefPoint;
89   DlgRef_1Sel1Spin*                  GroupOnCurve;
90   DlgRef_2Sel*                       GroupLineIntersection;
91   DlgRef_1Sel2Spin*                  GroupOnSurface;
92   
93   QGroupBox*                         myCoordGrp;
94   QLineEdit*                         myX;
95   QLineEdit*                         myY;
96   QLineEdit*                         myZ;
97
98   QGroupBox*                         myParamGroup;
99   QButtonGroup*                      myParamCoord;
100
101   QMenu*                             myBtnPopup;
102   QMap<QAction*, int>                myActions;
103
104   TopAbs_ShapeEnum                   myNeedType;
105   
106 private slots:
107   void                               ClickOnOk();
108   bool                               ClickOnApply();
109   void                               ActivateThisDialog();
110   void                               DeactivateActiveDialog();
111   void                               LineEditReturnPressed();
112   void                               SelectionIntoArgument();
113   void                               SetEditCurrentArgument();
114   void                               ConstructorsClicked( int );
115   void                               ValueChangedInSpinBox( double );
116   void                               SetDoubleSpinBoxStep( double );
117   void                               ClickParamCoord( int );
118   void                               onBtnPopup( QAction* );
119   void                               updateSize();
120 };
121
122 #endif // BASICGUI_POINTDLG_H