Salome HOME
Movement of examples to CVS EXAMPLES SAMPLES_SRC.
[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
54 private:
55   
56   QMap< int, SMESHGUI_MeshTab* > myTabs;
57   QTabWidget*                    myTabWg;
58 };
59
60 /*!
61  * \brief Tab for tab widget containing controls for definition of 
62  * algorithms and hypotheses
63 */ 
64
65 class SMESHGUI_MeshTab : public QFrame
66 {
67   Q_OBJECT
68       
69 public:      
70   /*! To differ main algorithms, hypotheses and additional ones*/
71   enum HypType
72   { 
73     Algo = 0, //!< algorithms
74     MainHyp,  //!< main hypothesis
75     AddHyp    //!< additional hypothesis
76   };            
77       
78 public:      
79   SMESHGUI_MeshTab( QWidget* );
80   virtual ~SMESHGUI_MeshTab();
81   
82   void                         setAvailableHyps( const int, const QStringList& );
83   void                         setExistingHyps( const int, const QStringList& );
84   void                         addHyp( const int, const QString& );
85   void                         renameHyp( const int, const int, const QString& );
86   void                         setCurrentHyp( const int, const int );
87   int                          currentHyp( const int ) const;
88   void                         reset();
89
90 signals:  
91
92   void                         createHyp( const int theHypType, const int theIndex );
93   //!< Emited when "Create hypothesis" button clicked
94   void                         editHyp( const int theHypType, const int theIndex );
95   //!< Emited when "Edit hypothesis" button clicked
96   
97 private slots:  
98
99   void                         onCreateHyp();  
100   void                         onEditHyp();
101   void                         onHyp( int );
102   void                         onPopupItem( int );
103   
104 private:  
105   
106   QMap< int, QComboBox* >      myHyp;
107   QMap< int, QToolButton* >    myCreateHyp;
108   QMap< int, QToolButton* >    myEditHyp;
109   
110   QMap< int, QStringList >     myAvailableHyps;
111   QMap< int, QStringList >     myExistingHyps;
112   
113   QPopupMenu*                  myPopup;
114 };
115
116 #endif
117
118
119
120