Salome HOME
Merge from BR_phase16 branch (09/12/09)
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MeshOrderDlg.h
1 //  Copyright (C) 2007-2009  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 // File   : SMESHGUI_MeshOrderDlg.h
23 // Author : Pavel TELKOV, Open CASCADE S.A.S.
24 //
25 #ifndef SMESHGUI_MeshOrderDlg_H
26 #define SMESHGUI_MeshOrderDlg_H
27
28 // SMESH includes
29 #include "SMESH_SMESHGUI.hxx"
30 #include "SMESHGUI_Dialog.h"
31
32 // Qt includes
33 #include <QGroupBox>
34
35 // IDL includes
36 #include <SALOMEconfig.h>
37 #include CORBA_SERVER_HEADER(SMESH_Mesh)
38
39 class QToolButton;
40 class QListWidget;
41
42 typedef QList<QStringList> ListListName;
43 typedef QList<int>         ListId;
44 typedef QList<ListId>  ListListId;
45
46 /*!
47  * \brief Reusable widget that shows and allows modify meshing order
48  */
49
50 class SMESHGUI_EXPORT SMESHGUI_MeshOrderBox : public QGroupBox
51 {
52   Q_OBJECT
53     
54  public:
55   /*! Public methods */
56   SMESHGUI_MeshOrderBox( QWidget* );
57   ~SMESHGUI_MeshOrderBox();
58
59   //! Clear mesh box
60   void         Clear();
61
62   //! Set mesh (submesh) names and indeces
63   void         SetMeshes(const ListListName& theMeshNames,
64                          const ListListId&   theMeshIds);
65
66   //! returns status is order changed by user
67   bool         IsOrderChanged() const;
68
69   //! Returns result (ordered by user) mesh names
70   ListListId   GetMeshIds() const;
71   //! Returns result (ordered by user) mesh indeces
72   ListListName GetMeshNames() const;
73  
74  private slots:
75   /*! Private slots */
76   //! update state of arrow buttons according to selection
77   void         onSelectionChanged();
78   //! move item according to clicked arrow button
79   void         onMoveItem();
80
81  private:
82   /*! Privatemethods */
83   //! move mesh in order up or down
84   void         moveItem(const bool theIsUp);
85
86  private:
87   /*! Private fields */
88   bool         myIsChanged;
89   QToolButton* myUpBtn;
90   QToolButton* myDownBtn;
91   QListWidget* myMeshNames;
92 };
93
94 /*!
95  * \brief Dialog contains mesh order box for modification operation
96  */
97
98 class SMESHGUI_EXPORT SMESHGUI_MeshOrderDlg : public SMESHGUI_Dialog
99 {
100   Q_OBJECT
101     
102  public:
103   /*! Public methods */
104   SMESHGUI_MeshOrderDlg( QWidget* );
105   ~SMESHGUI_MeshOrderDlg();
106
107   SMESHGUI_MeshOrderBox* GetMeshOrderBox() const;
108
109  private:
110   /*! Private fields */
111   SMESHGUI_MeshOrderBox* myBox;
112 };
113
114 #endif // SMESHGUI_MeshOrderDlg_H