Salome HOME
00fe956b16a175ae26aee425b88463cddaa82971
[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 // File   : SMESHGUI_SingleEditDlg.h
21 // Author : Sergey LITONIN, Open CASCADE S.A.S.
22 //
23
24 #ifndef SMESHGUI_SINGLEEDITDLG_H
25 #define SMESHGUI_SINGLEEDITDLG_H
26
27 // SMESH includes
28 #include "SMESH_SMESHGUI.hxx"
29
30 // Qt includes
31 #include <QDialog>
32
33 // IDL includes
34 #include <SALOMEconfig.h>
35 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
36
37 class QLineEdit;
38 class QPushButton;
39
40 class SMESHGUI;
41 class SMESH_Actor;
42 class SVTK_Selector;
43 class LightApp_SelectionMgr;
44
45 /*!
46  *  Class       : SMESHGUI_SingleEditDlg
47  *  Description : Base class for dialogs of diagonal inversion and 
48  *                union of two neighboring triangles
49  */
50 class SMESHGUI_EXPORT SMESHGUI_SingleEditDlg : public QDialog
51
52   Q_OBJECT
53
54 public:
55   SMESHGUI_SingleEditDlg( SMESHGUI* );
56   virtual ~SMESHGUI_SingleEditDlg();
57
58   void                    Init();
59
60 protected slots:
61   void                    onOk();
62   virtual bool            onApply();
63   void                    onClose();
64   void                    onHelp();
65
66   void                    onDeactivate();
67
68   void                    onSelectionDone();
69   void                    onTextChange( const QString& );
70
71 protected:
72   void                    closeEvent( QCloseEvent* );
73   void                    enterEvent( QEvent* );
74   void                    hideEvent( QHideEvent* );                        /* ESC key */
75   void                    keyPressEvent( QKeyEvent* );
76   QWidget*                createButtonFrame( QWidget* );
77   QWidget*                createMainFrame( QWidget* );
78   bool                    isValid( const bool ) const;
79   bool                    getNodeIds( const QString&, int&, int& ) const;
80   virtual bool            process( SMESH::SMESH_MeshEditor_ptr, const int, const int ) = 0;
81
82 protected:
83   bool                    myBusy;
84   QPushButton*            myOkBtn;
85   QPushButton*            myApplyBtn;
86   QPushButton*            myCloseBtn;
87   QPushButton*            myHelpBtn;
88   QLineEdit*              myEdge;
89   SMESH_Actor*            myActor;
90
91   LightApp_SelectionMgr*  mySelectionMgr;
92   SVTK_Selector*          mySelector;
93   SMESHGUI*               mySMESHGUI;
94   
95   QString                 myHelpFileName;
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* );
109   virtual ~SMESHGUI_TrianglesInversionDlg();
110
111 protected:
112   virtual bool process( SMESH::SMESH_MeshEditor_ptr, const int, const int );
113 };
114
115 /*!
116  *  Class       : SMESHGUI_UnionOfTwoTrianglesDlg
117  *  Description : Construction of a quadrangle by deletion of the 
118  *                common border of 2 neighboring triangles
119  */
120 class SMESHGUI_UnionOfTwoTrianglesDlg : public SMESHGUI_SingleEditDlg
121 {
122   Q_OBJECT
123
124 public:
125   SMESHGUI_UnionOfTwoTrianglesDlg( SMESHGUI* );
126   virtual ~SMESHGUI_UnionOfTwoTrianglesDlg();
127
128 protected:
129   virtual bool process( SMESH::SMESH_MeshEditor_ptr, const int, const int );
130 };
131
132 #endif // SMESHGUI_SINGLEEDITDLG_H