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