Salome HOME
PAL9022. before algo->Compute(), clean only elements directly bound to the shape...
[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 <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 QPushButton;
39 class SALOME_Selection;
40 class SMESH_Actor;
41
42 /*
43   Class       : SMESHGUI_SingleEditDlg
44   Description : Base class for dialogs of diagonal inversion and 
45                 union of two neighboring triangles
46 */
47
48 class SMESHGUI_SingleEditDlg : public QDialog
49
50   Q_OBJECT
51
52 public:
53                             SMESHGUI_SingleEditDlg( QWidget*, SALOME_Selection*, const char* = 0 );
54   virtual                   ~SMESHGUI_SingleEditDlg();
55
56   void                      Init( SALOME_Selection* ) ;
57
58 protected slots:
59
60   void                      onOk();
61   virtual bool              onApply();
62   void                      onClose();
63
64   void                      onDeactivate();
65
66   void                      onSelectionDone();
67   void                      onTextChange(const QString&);
68
69 protected:
70
71   void                      closeEvent( QCloseEvent* e ) ;
72   void                      enterEvent ( QEvent * ) ;            
73   void                      hideEvent ( QHideEvent * );                        /* ESC key */
74   QFrame*                   createButtonFrame( QWidget* );
75   QFrame*                   createMainFrame  ( QWidget* );
76   bool                      isValid( const bool ) const;
77   bool                      getNodeIds( const QString&, int&, int& ) const;
78   virtual bool              process( SMESH::SMESH_MeshEditor_ptr, const int, const int ) = 0;
79   
80 protected:
81
82   bool                      myBusy;
83   QPushButton*              myOkBtn;
84   QPushButton*              myApplyBtn;
85   QPushButton*              myCloseBtn;
86   QLineEdit*                myEdge;
87   SALOME_Selection*         mySelection;
88   SMESH_Actor*              myActor;
89
90 };
91
92 /*
93   Class       : SMESHGUI_TrianglesInversionDlg
94   Description : Inversion of the diagonal of a pseudo-quadrangle formed by 
95                 2 neighboring triangles with 1 common edge
96 */
97 class SMESHGUI_TrianglesInversionDlg : public SMESHGUI_SingleEditDlg
98 {
99   Q_OBJECT
100   
101 public:
102                             SMESHGUI_TrianglesInversionDlg( QWidget*, SALOME_Selection*, const char* = 0 );
103   virtual                   ~SMESHGUI_TrianglesInversionDlg();
104
105 protected:
106
107   virtual bool              process( SMESH::SMESH_MeshEditor_ptr, const int, const int );
108 };
109
110 /*
111   Class       : SMESHGUI_UnionOfTwoTrianglesDlg
112   Description : Construction of a quadrangle by deletion of the 
113                 common border of 2 neighboring triangles
114 */
115 class SMESHGUI_UnionOfTwoTrianglesDlg : public SMESHGUI_SingleEditDlg
116 {
117   Q_OBJECT
118
119 public:
120                             SMESHGUI_UnionOfTwoTrianglesDlg( QWidget*, SALOME_Selection*, const char* = 0 );
121   virtual                   ~SMESHGUI_UnionOfTwoTrianglesDlg();
122
123 protected:
124
125   virtual bool              process( SMESH::SMESH_MeshEditor_ptr, const int, const int );
126 };
127
128 #endif