Salome HOME
Merging with WPdev
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_SingleEditDlg.h
1 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
3 // 
4 //  This library is free software; you can redistribute it and/or 
5 //  modify it under the terms of the GNU Lesser General Public 
6 //  License as published by the Free Software Foundation; either 
7 //  version 2.1 of the License. 
8 // 
9 //  This library is distributed in the hope that it will be useful, 
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 //  Lesser General Public License for more details. 
13 // 
14 //  You should have received a copy of the GNU Lesser General Public 
15 //  License along with this library; if not, write to the Free Software 
16 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
17 // 
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 //
21 //
22 //  File   : SMESHGUI_SingleEditDlg.h
23 //  Author : Sergey LITONIN
24 //  Module : SMESH
25
26
27 #ifndef SMESHGUI_SingleEditDlg_H
28 #define SMESHGUI_SingleEditDlg_H
29
30 #include "SMESH_SMESHGUI.hxx"
31
32 #include <qdialog.h>
33
34 #include <SALOMEconfig.h>
35 #include CORBA_SERVER_HEADER(SMESH_Mesh)
36
37 class QCloseEvent;
38 class QFrame;
39 class QLineEdit;
40 class SMESHGUI_SpinBox;
41 class QPushButton;
42
43 class SMESHGUI;
44 class SMESH_Actor;
45 class SVTK_Selector;
46 class SVTK_ViewWindow;
47 class LightApp_SelectionMgr;
48
49 /*!
50  *  Class       : SMESHGUI_SingleEditDlg
51  *  Description : Base class for dialogs of diagonal inversion and 
52  *                union of two neighboring triangles
53  */
54 class SMESHGUI_EXPORT SMESHGUI_SingleEditDlg : public QDialog
55
56   Q_OBJECT
57
58 public:
59   SMESHGUI_SingleEditDlg(SMESHGUI* theModule, 
60                          const char* theName = 0);
61   virtual ~SMESHGUI_SingleEditDlg();
62
63   void Init();
64
65 protected slots:
66   void                    onOk();
67   virtual bool            onApply();
68   void                    onClose();
69   void                    onHelp();
70
71   void                    onDeactivate();
72
73   void                    onSelectionDone();
74   void                    onTextChange (const QString&);
75
76 protected:
77   void                    closeEvent (QCloseEvent*);
78   void                    enterEvent (QEvent*);
79   void                    hideEvent (QHideEvent*);                        /* ESC key */
80   void                    keyPressEvent(QKeyEvent*);
81   QFrame*                 createButtonFrame (QWidget*);
82   QFrame*                 createMainFrame (QWidget*);
83   bool                    isValid (const bool) const;
84   bool                    getNodeIds (const QString&, int&, int&) const;
85   virtual bool            process (SMESH::SMESH_MeshEditor_ptr, const int, const int) = 0;
86
87 protected:
88   bool                    myBusy;
89   QPushButton*            myOkBtn;
90   QPushButton*            myApplyBtn;
91   QPushButton*            myCloseBtn;
92   QPushButton*            myHelpBtn;
93   QLineEdit*              myEdge;
94   SMESH_Actor*            myActor;
95
96   LightApp_SelectionMgr*  mySelectionMgr;
97   SVTK_Selector*          mySelector;
98   SMESHGUI*               mySMESHGUI;
99   
100   QString                 myHelpFileName;
101 };
102
103 /*!
104  *  Class       : SMESHGUI_TrianglesInversionDlg
105  *  Description : Inversion of the diagonal of a pseudo-quadrangle formed by 
106  *                2 neighboring triangles with 1 common edge
107  */
108 class SMESHGUI_TrianglesInversionDlg : public SMESHGUI_SingleEditDlg
109 {
110   Q_OBJECT
111
112 public:
113   SMESHGUI_TrianglesInversionDlg(SMESHGUI* theModule, 
114                                  const char* theName = 0);
115   virtual ~SMESHGUI_TrianglesInversionDlg();
116
117 protected:
118   virtual bool process (SMESH::SMESH_MeshEditor_ptr, const int, const int);
119 };
120
121 /*!
122  *  Class       : SMESHGUI_UnionOfTwoTrianglesDlg
123  *  Description : Construction of a quadrangle by deletion of the 
124  *                common border of 2 neighboring triangles
125  */
126 class SMESHGUI_UnionOfTwoTrianglesDlg : public SMESHGUI_SingleEditDlg
127 {
128   Q_OBJECT
129
130 public:
131   SMESHGUI_UnionOfTwoTrianglesDlg(SMESHGUI* theModule, 
132                                   const char* theName = 0);
133   virtual ~SMESHGUI_UnionOfTwoTrianglesDlg();
134
135 protected:
136   virtual bool process (SMESH::SMESH_MeshEditor_ptr, const int, const int);
137 };
138
139 #endif