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