]> SALOME platform Git repositories - modules/hexablock.git/blob - src/HEXABLOCKGUI/MyBasicGUI_PointDlg.hxx
Salome HOME
555b1c730cfae8aaa80581c15b0045423f6ba260
[modules/hexablock.git] / src / HEXABLOCKGUI / MyBasicGUI_PointDlg.hxx
1 // Copyright (C) 2009-2013  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20
21 #ifndef MYBASICGUI_POINTDLG_H
22 #define MYBASICGUI_POINTDLG_H
23
24
25
26
27 #include "MyGEOMBase_Skeleton.hxx"
28 #include <QMap>
29
30 class DlgRef_2Sel1Spin;
31 class DlgRef_3Spin;
32 class DlgRef_2Sel;
33 class DlgRef_1Sel3Spin;
34 class DlgRef_1Sel2Spin;
35
36 class QLineEdit;
37 class QGroupBox;
38 class QButtonGroup;
39 class QMenu;
40 class QAction;
41
42 class gp_Pnt;
43
44 #include <QItemSelection>
45 #include <SUIT_ViewManager.h>
46 #include <SUIT_Session.h>
47 #include <OCCViewer_ViewWindow.h>
48 #include <OCCViewer_ViewManager.h>
49
50 #include "SVTK_Selection.h"
51 #include <SVTK_ViewModel.h>
52 namespace HEXABLOCK
53 {
54   namespace GUI
55   {
56     class DocumentModel;
57     class PatternDataSelectionModel;
58 //   }
59 // }
60
61
62 //=================================================================================
63 // class    : MyBasicGUI_PointDlg
64 // purpose  :
65 //=================================================================================
66 #include "hexa_base.hxx"
67 #include "HEXABLOCKGUI_Export.hxx"
68 typedef class HEXABLOCK_EXPORT MyBasicGUI_PointDlg : public MyGEOMBase_Skeleton
69 {
70   Q_OBJECT
71
72 public:
73   MyBasicGUI_PointDlg( QWidget* = 0, Qt::WindowFlags = 0 );
74   ~MyBasicGUI_PointDlg();
75
76   bool                               acceptMouseEvent() const { return ( getConstructorId() == 0 );  }
77   void                               OnPointSelected( const gp_Pnt& );
78
79 private:
80   double                             getParameter() const;
81   double                             getUParameter() const;
82   double                             getVParameter() const;
83   void                               updateParamCoord(bool theIsUpdate);
84
85 private:
86   bool                               myBusy;
87
88   DlgRef_3Spin*                      GroupXYZ;
89   DlgRef_1Sel3Spin*                  GroupRefPoint;
90   DlgRef_2Sel1Spin*                  GroupOnCurve;
91   DlgRef_2Sel*                       GroupLineIntersection;
92   DlgRef_1Sel2Spin*                  GroupOnSurface;
93
94   QGroupBox*                         myCoordGrp;
95   QLineEdit*                         myX;
96   QLineEdit*                         myY;
97   QLineEdit*                         myZ;
98
99
100
101   QGroupBox*                         myParamGroup;
102   QButtonGroup*                      myParamCoord;
103
104   QMenu*                             myBtnPopup;
105   QMenu*                             myBtnPopup2;
106   QAction*                           action_line1_edge;
107   QAction*                           action_line1_wire;
108   QAction*                           action_line2_edge;
109   QAction*                           action_line2_wire;
110
111 private slots:
112   void                               ConstructorsClicked( int );
113   void                               SetDoubleSpinBoxStep( double );
114   void                               ClickParamCoord( int );
115   void                               onBtnPopup( QAction* );
116   void                               updateSize();
117   void                               onRefPointChanged(const QString& pointName);
118   void                               onStartPointSelected(const QString& pointName);
119   void                               onParamValueChanged(double newValue);
120   void                               onXCoordChanged(double newValue);
121   void                               onYCoordChanged(double newValue);
122   void                               onZCoordChanged(double newValue);
123   void                               onUpdateResults(const QString& data);
124
125 // HEXABLOCK
126 public:
127   void clear();
128   TopoDS_Vertex computeGeomVertex(bool preview=false);
129   TopoDS_Vertex computeGeomPointXYZ();
130   TopoDS_Vertex computeGeomPointRef();
131   TopoDS_Vertex computeGeomPointEdge();
132   TopoDS_Vertex computeGeomPointInt();
133   TopoDS_Vertex computeGeomPointSurf();
134
135 protected:
136   virtual void showEvent ( QShowEvent * event );
137
138   virtual bool apply(QModelIndex& result);
139   virtual void _initInputWidget( Mode editmode );
140   void updateInputs(const int constructorId);
141
142   TopoDS_Vertex currentVertex;
143   QMap<int, double> paramInputValue;
144   QMap<int, QVector3D*> coordsInputValue;
145
146 protected slots:
147   void onWindowActivated( SUIT_ViewManager* vm );
148   void updateHelpFileName();
149   virtual void onSelectionChanged(  const QItemSelection& sel, const QItemSelection& unsel );
150
151 } VertexAssocDialog;
152
153   }
154 }
155
156 #endif // MYBASICGUI_POINTDLG_H