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