Salome HOME
Merge from BR_V5_DEV 16Feb09
[modules/smesh.git] / src / StdMeshersGUI / StdMeshersGUI_DistrTable.h
1 //  Copyright (C) 2007-2008  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   : StdMeshersGUI_DistrTable.h
23 // Author : Open CASCADE S.A.S.
24 //
25 #ifndef STDMESHERSGUI_DISTRTABLE_H
26 #define STDMESHERSGUI_DISTRTABLE_H
27
28 // SMESH includes
29 #include "SMESH_StdMeshersGUI.hxx"
30
31 // Qt includes
32 #include <QWidget>
33 #include <QList>
34 #include <QMap>
35
36 // IDL includes
37 #include <SALOMEconfig.h>
38 #include CORBA_SERVER_HEADER(SMESH_Mesh)
39
40 class QPushButton;
41
42 class StdMeshersGUI_DistrTableFrame : public QWidget
43 {
44   Q_OBJECT
45
46   enum { ArgColumn, FuncColumn };
47
48   class Table;
49   class SpinBoxDelegate;
50
51   typedef SMESH::double_array DataArray;
52
53 public:
54   typedef enum { InsertRowBtn, RemoveRowBtn } TableButton;
55   
56   StdMeshersGUI_DistrTableFrame( QWidget* = 0 );
57   ~StdMeshersGUI_DistrTableFrame();
58
59   void         showButton( const TableButton, const bool );
60   bool         isButtonShown( const TableButton ) const;
61
62   void         data( DataArray& ) const;
63   void         setData( const DataArray& );
64
65   void         setFuncMinValue( double );
66
67 private:
68   QPushButton* button( const TableButton ) const;
69
70 private slots:
71   void onInsert();
72   void onRemove();
73
74 signals:
75   void         valueChanged( int, int );
76   void         currentChanged( int, int );
77
78 private:
79   QMap<int, QPushButton*>   myButtons;
80   Table*                    myTable;
81 };
82
83 #endif // STDMESHERSGUI_DISTRTABLE_H