Salome HOME
Copyright update 2022
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_AddNodeOnFaceDlg.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_AddNodeOnFaceDlg.h
24 // Author : Edward AGAPOV, Open CASCADE S.A.S.
25 //
26 #ifndef SMESHGUI_AddNodeOnFaceDLG_H
27 #define SMESHGUI_AddNodeOnFaceDLG_H
28
29 // SMESH includes
30 #include "SMESH_SMESHGUI.hxx"
31
32 #include "SMESHGUI_Dialog.h"
33 #include "SMESHGUI_InteractiveOp.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_AddNodeOnFaceDlg;
44 class vtkCellPicker;
45
46 /*!
47  * \brief Operation to split a face into triangles by creating a new node
48  *        on the face and connecting it to the face nodes
49  */
50 class SMESHGUI_EXPORT SMESHGUI_AddNodeOnFaceOp: public SMESHGUI_InteractiveOp
51 {
52   Q_OBJECT
53
54 public:
55   SMESHGUI_AddNodeOnFaceOp();
56   virtual ~SMESHGUI_AddNodeOnFaceOp();
57
58   virtual LightApp_Dialog*      dlg() const;  
59
60 protected:
61
62   virtual void                  startOperation() override;
63   virtual void                  stopOperation() override;
64
65   virtual void                  activateSelection() override;
66
67   bool                          isValid( QString& );
68
69   virtual void                   processStyleEvents(unsigned long event,
70                                                     void* calldata)  override;
71
72   virtual void                   processInteractorEvents(unsigned long event,
73                                                          void* calldata) override;
74
75
76 protected slots:
77   virtual bool                  onApply();
78
79 private slots:
80   void                          onSelectionDone();
81   void                          redisplayPreview();
82   void                          onSelTypeChange();
83   void                          onTextChange( const QString& );
84 //  void                          onDestCoordChanged();
85   void                          onOpenView();
86   void                          onCloseView();
87   void                          pointLocationChanged(bool);
88   void                          onDestCoordChanged();
89
90 private:
91   SMESHGUI_AddNodeOnFaceDlg*    myDlg;
92
93   SUIT_SelectionFilter*         myFilter;
94   SMESHGUI*                     mySMESHGUI;
95   SMESHGUI_MeshEditPreview*     mySimulation;
96   SMESH_Actor*                  myMeshActor;
97   bool                          myNoPreview;
98   bool                          myUpdateDestination;
99   bool                          myDestCoordChanged;
100   vtkCellPicker*                myFacePicker;      
101 };
102
103 /*!
104  * \brief Dialog to split a face into triangles by creating a new node
105  *        on the face and connecting it to the face nodes
106  */
107
108 class SMESHGUI_EXPORT SMESHGUI_AddNodeOnFaceDlg : public SMESHGUI_Dialog
109 {
110   Q_OBJECT
111
112 public:
113   SMESHGUI_AddNodeOnFaceDlg();
114
115 private:
116   QWidget*                      createMainFrame( QWidget* );
117
118   QWidget*                      myMainFrame;
119
120   QPushButton*                  myDestBtn;
121   QPushButton*                  myIdBtn;
122   QLineEdit*                    myId;
123   SMESHGUI_SpinBox*             myDestinationX;
124   SMESHGUI_SpinBox*             myDestinationY;
125   SMESHGUI_SpinBox*             myDestinationZ;
126   QCheckBox*                    myPointOnFace;
127   QCheckBox*                    myPreviewChkBox;
128
129   QString                       myHelpFileName;
130
131   friend class SMESHGUI_AddNodeOnFaceOp;
132
133 signals:
134   void                          selTypeChanged();
135
136  private slots:
137   void                          ButtonToggled( bool );
138 };
139
140 #endif // SMESHGUI_AddNodeOnFaceDLG_H