Back to index

salome-smesh  6.5.0
StdMeshersGUI_FixedPointsParamWdg.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 // File   : StdMeshersGUI_FixedPointsParamWdg.h
00021 // Author : Open CASCADE S.A.S. (dmv)
00022 //
00023 #ifndef STDMESHERSGUI_FIXEDPOINTSPARAMWGD_H
00024 #define STDMESHERSGUI_FIXEDPOINTSPARAMWGD_H
00025 
00026 // SMESH includes
00027 #include <SMESHGUI.h>
00028 #include "SMESH_StdMeshersGUI.hxx"
00029 
00030 // Qt includes
00031 #include <QWidget>
00032 #include <QStringList>
00033 
00034 class SMESHGUI;
00035 class SMESHGUI_SpinBox;
00036 class QPushButton;
00037 class QLineEdit;
00038 class QCheckBox;
00039 class QListWidget;
00040 class QListWidgetItem;
00041 class QTreeWidget;
00042 class QTreeWidgetItem;
00043 
00044 class STDMESHERSGUI_EXPORT StdMeshersGUI_FixedPointsParamWdg : public QWidget
00045 {
00046   Q_OBJECT
00047 
00048     class LineDelegate;
00049 
00050 public:
00051   StdMeshersGUI_FixedPointsParamWdg( QWidget* parent = 0 );
00052   ~StdMeshersGUI_FixedPointsParamWdg();
00053 
00054   bool                           eventFilter( QObject*, QEvent* );
00055 
00056   SMESH::double_array_var        GetListOfPoints();
00057   void                           SetListOfPoints( SMESH::double_array_var );
00058 
00059   SMESH::long_array_var          GetListOfSegments();
00060   void                           SetListOfSegments( SMESH::long_array_var );
00061 
00062   QString                        GetValue() const { return myParamValue; }
00063 
00064 private slots:
00065   void                           onAdd(); 
00066   void                           onRemove(); 
00067   void                           onCheckBoxChanged();
00068   void                           updateState();
00069 
00070 private:
00071   void                           clear();
00072   void                           addPoint( double ); 
00073   void                           removePoints(); 
00074   double                         point( int ) const;
00075   void                           setNbSegments( int, int );
00076   int                            nbSegments( int ) const;
00077 
00078   static QTreeWidgetItem*        newTreeItem( double v1, double v2 );
00079   static QListWidgetItem*        newListItem( double v1 );
00080   static QString                 treeItemText( double v1, double v2 );
00081 
00082 private:
00083   QListWidget*                   myListWidget;
00084   QTreeWidget*                   myTreeWidget;
00085   SMESHGUI_SpinBox*              mySpinBox;
00086   QPushButton*                   myAddButton;
00087   QPushButton*                   myRemoveButton;
00088   QCheckBox*                     mySameValues;
00089   QString                        myParamValue;
00090 };
00091 
00092 #endif // STDMESHERSGUI_FIXEDPOINTSPARAMWGD_H