Salome HOME
*** empty log message ***
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_EditHypothesesDlg.h
1 //  SMESH SMESHGUI : GUI for SMESH component
2 //
3 //  Copyright (C) 2003  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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : SMESHGUI_EditHypothesesDlg.h
25 //  Author : Nicolas REJNERI
26 //  Module : SMESH
27 //  $Header$
28
29 #ifndef DIALOGBOX_EDIT_HYPOTHESES_H
30 #define DIALOGBOX_EDIT_HYPOTHESES_H
31
32 #include <qstring.h>
33 #include <qmap.h>
34 #include <qlistbox.h>
35
36 #include <SMESHGUI_Dialog.h>
37
38 typedef QMap< QString, int > MapIOR;
39 typedef QMap< QString, QString > MapIORText;
40
41 class ListBoxIOR : public QListBoxText
42 {
43 public:
44   enum { RTTI_IOR = 1000 };
45
46 public:
47   ListBoxIOR (QListBox* listbox,
48               const QString& ior,
49               const QString& text = QString::null )
50   : QListBoxText(listbox, text), myIOR(ior) {}
51   virtual ~ListBoxIOR() {};
52   virtual int rtti() const { return RTTI_IOR; }
53   QString GetIOR() const { return myIOR; }
54
55 private:
56   QString myIOR;
57 };
58
59
60 //=================================================================================
61 // class    : SMESHGUI_EditHypothesesDlg
62 // purpose  :
63 //=================================================================================
64 class SMESHGUI_EditHypothesesDlg : public SMESHGUI_Dialog
65 {
66     Q_OBJECT
67
68 public:
69     enum { MeshOrSubMesh, GeomShape };
70     typedef enum { HypoDef, HypoAssign, AlgoDef, AlgoAssign } ListType;
71     
72 public:
73     SMESHGUI_EditHypothesesDlg();
74     ~SMESHGUI_EditHypothesesDlg();
75
76     void setListsEnabled( const bool );
77     int  hypoCount() const;
78     int  algoCount() const;
79     bool isModified() const;
80     int  findItem( QListBox*, const QString& );
81
82 signals:
83     void needToUpdate();
84     
85 private:
86     bool      isOld(QListBoxItem* hypItem);
87
88 private:
89     MapIOR  myMapOldHypos, myMapOldAlgos;
90     int     myNbModification;
91
92     QGroupBox*    GroupHypotheses;
93     QLabel*       TextHypDefinition;
94     QListBox*     ListHypDefinition;
95     QLabel*       TextHypAssignation;
96     QListBox*     ListHypAssignation;
97
98     QGroupBox*    GroupAlgorithms;
99     QLabel*       TextAlgoDefinition;
100     QListBox*     ListAlgoDefinition;
101     QLabel*       TextAlgoAssignation;
102     QListBox*     ListAlgoAssignation;
103
104 private slots:
105     void removeItem(QListBoxItem*);
106     void addItem(QListBoxItem*);
107
108 private:
109   friend class SMESHGUI_EditHypothesesOp;
110 };
111
112 #endif // DIALOGBOX_EDIT_HYPOTHESES_H