Salome HOME
PAL10237. Add a button assigning a set of hypotheses
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MeshDlg.h
1 /**
2 *  SMESH SMESHGUI
3 *
4 *  Copyright (C) 2005  CEA/DEN, EDF R&D
5 *
6 *
7 *
8 *  File   : SMESHGUI_MeshDlg.h
9 *  Author : Sergey LITONIN
10 *  Module : SMESH
11 */
12
13
14 #ifndef SMESHGUI_MeshDlg_H
15 #define SMESHGUI_MeshDlg_H
16
17 #include "SMESHGUI_Dialog.h"
18 #include <qframe.h>
19 #include <qstringlist.h>
20 #include <qmap.h>
21
22 class SMESHGUI_MeshTab;
23 class QTabWidget;
24 class QLineEdit;
25 class QComboBox;
26 class QToolButton;
27 class QString;
28 class QPopupMenu;
29
30 /*!
31  * \brief Dialog for mech creation or editing
32  *
33  *  This dialog is used for mech creation or editing. 
34 */
35 class SMESHGUI_MeshDlg : public SMESHGUI_Dialog
36
37   Q_OBJECT       
38       
39 public:
40   
41   enum Controls { Obj, Mesh, Geom };
42   
43   /*! Describes dimensions */
44   enum Dimensions { Dim1D = 0, Dim2D, Dim3D };      
45   
46 public:
47   SMESHGUI_MeshDlg( const bool theToCreate, const bool theIsMesh );
48   virtual ~SMESHGUI_MeshDlg();
49   
50   SMESHGUI_MeshTab*            tab( const int ) const;
51   void                         reset();
52   void                         setCurrentTab( const int );
53   void                         setMaxHypoDim( const int );
54   void                         setHypoSets( const QStringList& );
55
56 signals:
57
58   void                         hypoSet( const QString& );
59
60 private slots:  
61
62   void                         onHypoSetPopup( int );
63   void                         onHypoSetButton();
64
65 private:
66
67   QMap< int, SMESHGUI_MeshTab* > myTabs;
68   QTabWidget*                    myTabWg;
69   QPopupMenu*                    myHypoSetPopup;
70 };
71
72 /*!
73  * \brief Tab for tab widget containing controls for definition of 
74  * algorithms and hypotheses
75 */ 
76
77 class SMESHGUI_MeshTab : public QFrame
78 {
79   Q_OBJECT
80       
81 public:      
82   /*! To differ main algorithms, hypotheses and additional ones*/
83   enum HypType
84   { 
85     Algo = 0, //!< algorithms
86     MainHyp,  //!< main hypothesis
87     AddHyp    //!< additional hypothesis
88   };            
89       
90 public:      
91   SMESHGUI_MeshTab( QWidget* );
92   virtual ~SMESHGUI_MeshTab();
93   
94   void                         setAvailableHyps( const int, const QStringList& );
95   void                         setExistingHyps( const int, const QStringList& );
96   void                         addHyp( const int, const QString& );
97   void                         renameHyp( const int, const int, const QString& );
98   void                         setCurrentHyp( const int, const int );
99   int                          currentHyp( const int ) const;
100   void                         reset();
101
102 signals:  
103
104   void                         createHyp( const int theHypType, const int theIndex );
105   //!< Emited when "Create hypothesis" button clicked
106   void                         editHyp( const int theHypType, const int theIndex );
107   //!< Emited when "Edit hypothesis" button clicked
108   
109 private slots:  
110
111   void                         onCreateHyp();  
112   void                         onEditHyp();
113   void                         onHyp( int );
114   void                         onPopupItem( int );
115   
116 private:  
117   
118   QMap< int, QComboBox* >      myHyp;
119   QMap< int, QToolButton* >    myCreateHyp;
120   QMap< int, QToolButton* >    myEditHyp;
121   
122   QMap< int, QStringList >     myAvailableHyps;
123   QMap< int, QStringList >     myExistingHyps;
124   
125   QPopupMenu*                  myPopup;
126 };
127
128 #endif
129
130
131
132