Salome HOME
merge V7_7_BR
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MakeNodeAtPointDlg.h
1 // Copyright (C) 2007-2015  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, or (at your option) any later version.
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 // File   : SMESHGUI_MakeNodeAtPointDlg.h
24 // Author : Edward AGAPOV, Open CASCADE S.A.S.
25 //
26 #ifndef SMESHGUI_MAKENODEATPOINTDLG_H
27 #define SMESHGUI_MAKENODEATPOINTDLG_H
28
29 // SMESH includes
30 #include "SMESH_SMESHGUI.hxx"
31
32 #include "SMESHGUI_Dialog.h"
33 #include "SMESHGUI_SelectionOp.h"
34
35 class QButtonGroup;
36 class QCheckBox;
37 class QGroupBox;
38 class QLineEdit;
39 class QPushButton;
40 class QRadioButton;
41 class SMESHGUI_SpinBox;
42 class SMESHGUI_MeshEditPreview;
43 class SMESHGUI_MakeNodeAtPointDlg;
44
45 /*!
46  * \brief Operation to make a mesh pass through a point
47  */
48 class SMESHGUI_EXPORT SMESHGUI_MakeNodeAtPointOp: public SMESHGUI_SelectionOp
49 {
50   Q_OBJECT
51
52 public:
53   SMESHGUI_MakeNodeAtPointOp();
54   virtual ~SMESHGUI_MakeNodeAtPointOp();
55
56   virtual LightApp_Dialog*       dlg() const;  
57
58 protected:
59
60   virtual void                   startOperation();
61   virtual void                   stopOperation();
62
63   virtual void                   activateSelection();
64
65   bool                           isValid( QString& );
66
67 protected slots:
68   virtual bool                   onApply();
69
70 private slots:
71   void                           onSelectionDone();
72   void                           redisplayPreview();
73   void                           onTextChange( const QString& );
74   void                           onUpdateDestination();
75   void                           onDestCoordChanged();
76   void                           onOpenView();
77   void                           onCloseView();
78
79 private:
80   int                           GetConstructorId();
81
82   SMESHGUI_MakeNodeAtPointDlg*  myDlg;
83
84   SUIT_SelectionFilter*         myFilter;
85   int                           myMeshOldDisplayMode;
86   SMESHGUI*                     mySMESHGUI;
87   SMESHGUI_MeshEditPreview*     mySimulation;
88   SMESH_Actor*                  myMeshActor;
89   bool                          myNoPreview;
90   bool                          myUpdateDestination;
91   bool                          myDestCoordChanged;
92 };
93
94 /*!
95  * \brief Dialog to make a mesh pass through a point
96  */
97
98 class SMESHGUI_EXPORT SMESHGUI_MakeNodeAtPointDlg : public SMESHGUI_Dialog
99 {
100   Q_OBJECT
101
102 public:
103   SMESHGUI_MakeNodeAtPointDlg();
104
105 private:
106   QWidget*                      createMainFrame( QWidget* );
107
108   QWidget*                      myMainFrame;
109
110   QButtonGroup*                 myButtonGroup;
111   QRadioButton*                 myRButNodeToMove;
112   QRadioButton*                 myRButMoveWithoutNode;
113   QPushButton*                  myDestBtn;
114   QPushButton*                  myUpdateBtn;
115   QGroupBox*                    myDestinationGrp;
116   QGroupBox*                    myNodeToMoveGrp;
117   QPushButton*                  myIdBtn;
118   QLineEdit*                    myId;
119   SMESHGUI_SpinBox*             myCurrentX;
120   SMESHGUI_SpinBox*             myCurrentY;
121   SMESHGUI_SpinBox*             myCurrentZ;
122   SMESHGUI_SpinBox*             myDestinationX;
123   SMESHGUI_SpinBox*             myDestinationY;
124   SMESHGUI_SpinBox*             myDestinationZ;
125   QLabel*                       myDestDXLabel;
126   QLabel*                       myDestDYLabel;
127   QLabel*                       myDestDZLabel;
128   SMESHGUI_SpinBox*             myDestDX;
129   SMESHGUI_SpinBox*             myDestDY;
130   SMESHGUI_SpinBox*             myDestDZ;
131   QCheckBox*                    myPreviewChkBox;
132
133   QString                       myHelpFileName;
134
135   friend class SMESHGUI_MakeNodeAtPointOp;
136
137 private slots:
138   void                          ButtonToggled( bool );
139   void                          ConstructorsClicked( int );
140 };
141
142 #endif // SMESHGUI_MAKENODEATPOINTDLG_H