Salome HOME
Fix bug 12796: Warning missed for the bad file 'test18.med'
[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 <qdialog.h>
31
32 #include <SALOMEconfig.h>
33 #include CORBA_SERVER_HEADER(SMESH_Mesh)
34
35 class QCloseEvent;
36 class QFrame;
37 class QLineEdit;
38 class SMESHGUI_SpinBox;
39 class QPushButton;
40
41 class SMESHGUI;
42 class SMESH_Actor;
43 class SVTK_Selector;
44 class SVTK_ViewWindow;
45 class LightApp_SelectionMgr;
46
47 /*!
48  *  Class       : SMESHGUI_SingleEditDlg
49  *  Description : Base class for dialogs of diagonal inversion and 
50  *                union of two neighboring triangles
51  */
52 class SMESHGUI_SingleEditDlg : public QDialog
53
54   Q_OBJECT
55
56 public:
57   SMESHGUI_SingleEditDlg(SMESHGUI* theModule, 
58                          const char* theName = 0);
59   virtual ~SMESHGUI_SingleEditDlg();
60
61   void Init();
62
63 protected slots:
64   void                    onOk();
65   virtual bool            onApply();
66   void                    onClose();
67   void                    onHelp();
68
69   void                    onDeactivate();
70
71   void                    onSelectionDone();
72   void                    onTextChange (const QString&);
73
74 protected:
75   void                    closeEvent (QCloseEvent*);
76   void                    enterEvent (QEvent*);
77   void                    hideEvent (QHideEvent*);                        /* ESC key */
78   void                    keyPressEvent(QKeyEvent*);
79   QFrame*                 createButtonFrame (QWidget*);
80   QFrame*                 createMainFrame (QWidget*);
81   bool                    isValid (const bool) const;
82   bool                    getNodeIds (const QString&, int&, int&) const;
83   virtual bool            process (SMESH::SMESH_MeshEditor_ptr, const int, const int) = 0;
84
85 protected:
86   bool                    myBusy;
87   QPushButton*            myOkBtn;
88   QPushButton*            myApplyBtn;
89   QPushButton*            myCloseBtn;
90   QPushButton*            myHelpBtn;
91   QLineEdit*              myEdge;
92   SMESH_Actor*            myActor;
93
94   LightApp_SelectionMgr*  mySelectionMgr;
95   SVTK_Selector*          mySelector;
96   SMESHGUI*               mySMESHGUI;
97   
98   QString                 myHelpFileName;
99 };
100
101 /*!
102  *  Class       : SMESHGUI_TrianglesInversionDlg
103  *  Description : Inversion of the diagonal of a pseudo-quadrangle formed by 
104  *                2 neighboring triangles with 1 common edge
105  */
106 class SMESHGUI_TrianglesInversionDlg : public SMESHGUI_SingleEditDlg
107 {
108   Q_OBJECT
109
110 public:
111   SMESHGUI_TrianglesInversionDlg(SMESHGUI* theModule, 
112                                  const char* theName = 0);
113   virtual ~SMESHGUI_TrianglesInversionDlg();
114
115 protected:
116   virtual bool process (SMESH::SMESH_MeshEditor_ptr, const int, const int);
117 };
118
119 /*!
120  *  Class       : SMESHGUI_UnionOfTwoTrianglesDlg
121  *  Description : Construction of a quadrangle by deletion of the 
122  *                common border of 2 neighboring triangles
123  */
124 class SMESHGUI_UnionOfTwoTrianglesDlg : public SMESHGUI_SingleEditDlg
125 {
126   Q_OBJECT
127
128 public:
129   SMESHGUI_UnionOfTwoTrianglesDlg(SMESHGUI* theModule, 
130                                   const char* theName = 0);
131   virtual ~SMESHGUI_UnionOfTwoTrianglesDlg();
132
133 protected:
134   virtual bool process (SMESH::SMESH_MeshEditor_ptr, const int, const int);
135 };
136
137 #endif