00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE 00002 // 00003 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, 00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 00005 // 00006 // This library is free software; you can redistribute it and/or 00007 // modify it under the terms of the GNU Lesser General Public 00008 // License as published by the Free Software Foundation; either 00009 // version 2.1 of the License. 00010 // 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 // Lesser General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU Lesser General Public 00017 // License along with this library; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 // 00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00021 // 00022 00023 // File : StdMeshersGUI_DistrTable.h 00024 // Author : Open CASCADE S.A.S. 00025 // 00026 #ifndef STDMESHERSGUI_DISTRTABLE_H 00027 #define STDMESHERSGUI_DISTRTABLE_H 00028 00029 // SMESH includes 00030 #include "SMESH_StdMeshersGUI.hxx" 00031 00032 // Qt includes 00033 #include <QWidget> 00034 #include <QList> 00035 #include <QMap> 00036 00037 // IDL includes 00038 #include <SALOMEconfig.h> 00039 #include CORBA_SERVER_HEADER(SMESH_Mesh) 00040 00041 class QPushButton; 00042 00043 class StdMeshersGUI_DistrTableFrame : public QWidget 00044 { 00045 Q_OBJECT 00046 00047 enum { ArgColumn, FuncColumn }; 00048 00049 class Table; 00050 class SpinBoxDelegate; 00051 00052 typedef SMESH::double_array DataArray; 00053 00054 public: 00055 typedef enum { InsertRowBtn, RemoveRowBtn } TableButton; 00056 00057 StdMeshersGUI_DistrTableFrame( QWidget* = 0 ); 00058 ~StdMeshersGUI_DistrTableFrame(); 00059 00060 void showButton( const TableButton, const bool ); 00061 bool isButtonShown( const TableButton ) const; 00062 00063 void data( DataArray& ) const; 00064 void setData( const DataArray& ); 00065 00066 void setFuncMinValue( double ); 00067 00068 private: 00069 QPushButton* button( const TableButton ) const; 00070 00071 private slots: 00072 void onInsert(); 00073 void onRemove(); 00074 00075 signals: 00076 void valueChanged( int, int ); 00077 void currentChanged( int, int ); 00078 00079 private: 00080 QMap<int, QPushButton*> myButtons; 00081 Table* myTable; 00082 }; 00083 00084 #endif // STDMESHERSGUI_DISTRTABLE_H