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