Salome HOME
typo-fix by Kunda
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MeshOrderDlg.h
1 // Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 // File   : SMESHGUI_MeshOrderDlg.h
21 // Author : Pavel TELKOV, Open CASCADE S.A.S.
22 //
23 #ifndef SMESHGUI_MeshOrderDlg_H
24 #define SMESHGUI_MeshOrderDlg_H
25
26 // SMESH includes
27 #include "SMESH_SMESHGUI.hxx"
28 #include "SMESHGUI_Dialog.h"
29
30 // Qt includes
31 #include <QGroupBox>
32
33 // IDL includes
34 #include <SALOMEconfig.h>
35 #include CORBA_SERVER_HEADER(SMESH_Mesh)
36
37 class QToolButton;
38 class QListWidget;
39
40 typedef QList<QStringList> ListListName;
41 typedef QList<int>         ListId;
42 typedef QList<ListId>  ListListId;
43
44 /*!
45  * \brief Reusable widget that shows and allows modify meshing order
46  */
47
48 class SMESHGUI_EXPORT SMESHGUI_MeshOrderBox : public QGroupBox
49 {
50   Q_OBJECT
51     
52  public:
53   /*! Public methods */
54   SMESHGUI_MeshOrderBox( QWidget* );
55   ~SMESHGUI_MeshOrderBox();
56
57   //! Clear mesh box
58   void         Clear();
59
60   //! Set mesh (submesh) names and indices
61   void         SetMeshes(const ListListName& theMeshNames,
62                          const ListListId&   theMeshIds);
63
64   //! returns status is order changed by user
65   bool         IsOrderChanged() const;
66
67   //! Returns result (ordered by user) mesh names
68   ListListId   GetMeshIds() const;
69   //! Returns result (ordered by user) mesh indices
70   ListListName GetMeshNames() const;
71  
72  private slots:
73   /*! Private slots */
74   //! update state of arrow buttons according to selection
75   void         onSelectionChanged();
76   //! move item according to clicked arrow button
77   void         onMoveItem();
78
79  private:
80   /*! Privatemethods */
81   //! move mesh in order up or down
82   void         moveItem(const bool theIsUp);
83
84  private:
85   /*! Private fields */
86   bool         myIsChanged;
87   QToolButton* myUpBtn;
88   QToolButton* myDownBtn;
89   QListWidget* myMeshNames;
90 };
91
92 /*!
93  * \brief Dialog contains mesh order box for modification operation
94  */
95
96 class SMESHGUI_EXPORT SMESHGUI_MeshOrderDlg : public SMESHGUI_Dialog
97 {
98   Q_OBJECT
99     
100  public:
101   /*! Public methods */
102   SMESHGUI_MeshOrderDlg( QWidget* );
103   ~SMESHGUI_MeshOrderDlg();
104
105   SMESHGUI_MeshOrderBox* GetMeshOrderBox() const;
106
107  private:
108   /*! Private fields */
109   SMESHGUI_MeshOrderBox* myBox;
110 };
111
112 #endif // SMESHGUI_MeshOrderDlg_H