Salome HOME
correct previous integration (Porting to Python 2.6)
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_SingleEditDlg.h
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 // File   : SMESHGUI_SingleEditDlg.h
23 // Author : Sergey LITONIN, Open CASCADE S.A.S.
24 //
25 #ifndef SMESHGUI_SINGLEEDITDLG_H
26 #define SMESHGUI_SINGLEEDITDLG_H
27
28 // SMESH includes
29 #include "SMESH_SMESHGUI.hxx"
30
31 // Qt includes
32 #include <QDialog>
33
34 // IDL includes
35 #include <SALOMEconfig.h>
36 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
37
38 class QLineEdit;
39 class QPushButton;
40
41 class SMESHGUI;
42 class SMESH_Actor;
43 class SVTK_Selector;
44 class LightApp_SelectionMgr;
45
46 /*!
47  *  Class       : SMESHGUI_SingleEditDlg
48  *  Description : Base class for dialogs of diagonal inversion and 
49  *                union of two neighboring triangles
50  */
51 class SMESHGUI_EXPORT SMESHGUI_SingleEditDlg : public QDialog
52
53   Q_OBJECT
54
55 public:
56   SMESHGUI_SingleEditDlg( SMESHGUI* );
57   virtual ~SMESHGUI_SingleEditDlg();
58
59   void                    Init();
60
61 protected slots:
62   void                    onOk();
63   virtual bool            onApply();
64   void                    onClose();
65   void                    onHelp();
66
67   void                    onDeactivate();
68
69   void                    onSelectionDone();
70   void                    onTextChange( const QString& );
71
72 protected:
73   void                    closeEvent( QCloseEvent* );
74   void                    enterEvent( QEvent* );
75   void                    hideEvent( QHideEvent* );                        /* ESC key */
76   void                    keyPressEvent( QKeyEvent* );
77   QWidget*                createButtonFrame( QWidget* );
78   QWidget*                createMainFrame( QWidget* );
79   bool                    isValid( const bool ) const;
80   bool                    getNodeIds( const QString&, int&, int& ) const;
81   virtual bool            process( SMESH::SMESH_MeshEditor_ptr, const int, const int ) = 0;
82
83 protected:
84   bool                    myBusy;
85   QPushButton*            myOkBtn;
86   QPushButton*            myApplyBtn;
87   QPushButton*            myCloseBtn;
88   QPushButton*            myHelpBtn;
89   QLineEdit*              myEdge;
90   SMESH_Actor*            myActor;
91
92   LightApp_SelectionMgr*  mySelectionMgr;
93   SVTK_Selector*          mySelector;
94   SMESHGUI*               mySMESHGUI;
95   
96   QString                 myHelpFileName;
97 };
98
99 /*!
100  *  Class       : SMESHGUI_TrianglesInversionDlg
101  *  Description : Inversion of the diagonal of a pseudo-quadrangle formed by 
102  *                2 neighboring triangles with 1 common edge
103  */
104 class SMESHGUI_TrianglesInversionDlg : public SMESHGUI_SingleEditDlg
105 {
106   Q_OBJECT
107
108 public:
109   SMESHGUI_TrianglesInversionDlg( SMESHGUI* );
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* );
127   virtual ~SMESHGUI_UnionOfTwoTrianglesDlg();
128
129 protected:
130   virtual bool process( SMESH::SMESH_MeshEditor_ptr, const int, const int );
131 };
132
133 #endif // SMESHGUI_SINGLEEDITDLG_H