Salome HOME
Merge branch 'V9_9_BR'
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MakeNodeAtPointDlg.h
1 // Copyright (C) 2007-2022  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_InteractiveOp.h"
34
35 #include <vtkSmartPointer.h>
36
37 class QButtonGroup;
38 class QCheckBox;
39 class QGroupBox;
40 class QLineEdit;
41 class QPushButton;
42 class QRadioButton;
43 class SMESHGUI_SpinBox;
44 class SMESHGUI_MeshEditPreview;
45 class SMESHGUI_MakeNodeAtPointDlg;
46
47
48 /*!
49  * \brief Operation to make a mesh pass through a point
50  */
51 class SMESHGUI_EXPORT SMESHGUI_MakeNodeAtPointOp: public SMESHGUI_InteractiveOp
52 {
53   Q_OBJECT
54
55 public:
56   SMESHGUI_MakeNodeAtPointOp(int defaultConstructor = 0);
57   virtual ~SMESHGUI_MakeNodeAtPointOp();
58
59   virtual LightApp_Dialog*       dlg() const;  
60
61 protected:
62
63   virtual void                   startOperation() override;
64   virtual void                   stopOperation() override;
65
66   virtual void                   activateSelection() override;
67
68   bool                           isValid( QString& );
69
70   virtual void                   processStyleEvents(unsigned long event,
71                                                     void* calldata)  override;
72
73   virtual void                   processInteractorEvents(unsigned long event,
74                                                          void* calldata) override;
75
76 protected slots:
77   virtual bool                   onApply();
78
79 private slots:
80   void                           onSelectionDone();
81   void                           redisplayPreview();
82   void                           onTextChange( const QString& );
83   void                           onUpdateDestination();
84   void                           onDestCoordChanged();
85   void                           onOpenView();
86   void                           onCloseView();
87   void                           constructorChanged();
88
89 private:
90   int                           GetConstructorId();
91
92   int                           myDefaultConstructor;
93   SMESHGUI_MakeNodeAtPointDlg*  myDlg;
94
95   SUIT_SelectionFilter*         myFilter;
96   SMESHGUI*                     mySMESHGUI;
97   SMESHGUI_MeshEditPreview*     mySimulation;
98   SMESH_Actor*                  myMeshActor;
99   bool                          myNoPreview;
100   bool                          myUpdateDestination;
101   bool                          myDestCoordChanged;
102 };
103
104 /*!
105  * \brief Dialog to make a mesh pass through a point
106  */
107
108 class SMESHGUI_EXPORT SMESHGUI_MakeNodeAtPointDlg : public SMESHGUI_Dialog
109 {
110   Q_OBJECT
111
112 public:
113   SMESHGUI_MakeNodeAtPointDlg();
114
115 private:
116   QWidget*                      createMainFrame( QWidget* );
117
118   QWidget*                      myMainFrame;
119
120   QButtonGroup*                 myButtonGroup;
121   QRadioButton*                 myRButNodeToMove;
122   QRadioButton*                 myRButMoveWithoutNode;
123   QRadioButton*                 myRButMoveInteractive;
124   QPushButton*                  myDestBtn;
125   QPushButton*                  myUpdateBtn;
126   QGroupBox*                    myDestinationGrp;
127   QGroupBox*                    myNodeToMoveGrp;
128   QPushButton*                  myIdBtn;
129   QLineEdit*                    myId;
130   SMESHGUI_SpinBox*             myCurrentX;
131   SMESHGUI_SpinBox*             myCurrentY;
132   SMESHGUI_SpinBox*             myCurrentZ;
133   SMESHGUI_SpinBox*             myDestinationX;
134   SMESHGUI_SpinBox*             myDestinationY;
135   SMESHGUI_SpinBox*             myDestinationZ;
136   QLabel*                       myDestDXLabel;
137   QLabel*                       myDestDYLabel;
138   QLabel*                       myDestDZLabel;
139   SMESHGUI_SpinBox*             myDestDX;
140   SMESHGUI_SpinBox*             myDestDY;
141   SMESHGUI_SpinBox*             myDestDZ;
142   QCheckBox*                    myPreviewChkBox;
143
144   QString                       myHelpFileName;
145
146   friend class SMESHGUI_MakeNodeAtPointOp;
147
148 private slots:
149   void                          ButtonToggled( bool );
150   void                          ConstructorsClicked( int );
151 };
152
153 #endif // SMESHGUI_MAKENODEATPOINTDLG_H