]> SALOME platform Git repositories - modules/smesh.git/blob - src/SMESHGUI/SMESHGUI_SingleEditDlg.h
Salome HOME
First executable version
[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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
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
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   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   QLineEdit*              myEdge;
91   SMESH_Actor*            myActor;
92
93   LightApp_SelectionMgr*  mySelectionMgr;
94   SVTK_Selector*          mySelector;
95   SMESHGUI*               mySMESHGUI;
96 };
97
98 /*!
99  *  Class       : SMESHGUI_TrianglesInversionDlg
100  *  Description : Inversion of the diagonal of a pseudo-quadrangle formed by 
101  *                2 neighboring triangles with 1 common edge
102  */
103 class SMESHGUI_TrianglesInversionDlg : public SMESHGUI_SingleEditDlg
104 {
105   Q_OBJECT
106
107 public:
108   SMESHGUI_TrianglesInversionDlg(SMESHGUI* theModule, 
109                                  const char* theName = 0);
110   virtual ~SMESHGUI_TrianglesInversionDlg();
111
112 protected:
113   virtual bool process (SMESH::SMESH_MeshEditor_ptr, const int, const int);
114 };
115
116 /*!
117  *  Class       : SMESHGUI_UnionOfTwoTrianglesDlg
118  *  Description : Construction of a quadrangle by deletion of the 
119  *                common border of 2 neighboring triangles
120  */
121 class SMESHGUI_UnionOfTwoTrianglesDlg : public SMESHGUI_SingleEditDlg
122 {
123   Q_OBJECT
124
125 public:
126   SMESHGUI_UnionOfTwoTrianglesDlg(SMESHGUI* theModule, 
127                                   const char* theName = 0);
128   virtual ~SMESHGUI_UnionOfTwoTrianglesDlg();
129
130 protected:
131   virtual bool process (SMESH::SMESH_MeshEditor_ptr, const int, const int);
132 };
133
134 #endif