Salome HOME
correct previous integration (Porting to Python 2.6)
[modules/smesh.git] / src / StdMeshersGUI / StdMeshersGUI_FixedPointsParamWdg.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_FixedPointsParamWdg.h
23 // Author : Open CASCADE S.A.S. (dmv)
24 //
25 #ifndef STDMESHERSGUI_FIXEDPOINTSPARAMWGD_H
26 #define STDMESHERSGUI_FIXEDPOINTSPARAMWGD_H
27
28 // SMESH includes
29 #include <SMESHGUI.h>
30 #include "SMESH_StdMeshersGUI.hxx"
31
32 // Qt includes
33 #include <QWidget>
34 #include <QStringList>
35
36 class SMESHGUI;
37 class QtxDoubleSpinBox;
38 class QPushButton;
39 class QLineEdit;
40 class QCheckBox;
41 class QListWidget;
42 class QListWidgetItem;
43 class QTreeWidget;
44 class QTreeWidgetItem;
45
46 class STDMESHERSGUI_EXPORT StdMeshersGUI_FixedPointsParamWdg : public QWidget
47 {
48   Q_OBJECT
49
50     class LineDelegate;
51
52 public:
53   StdMeshersGUI_FixedPointsParamWdg( QWidget* parent = 0 );
54   ~StdMeshersGUI_FixedPointsParamWdg();
55
56   bool                           eventFilter( QObject*, QEvent* );
57
58   SMESH::double_array_var        GetListOfPoints();
59   void                           SetListOfPoints( SMESH::double_array_var );
60
61   SMESH::long_array_var          GetListOfSegments();
62   void                           SetListOfSegments( SMESH::long_array_var );
63
64   QString                        GetValue() const { return myParamValue; }
65
66 private slots:
67   void                           onAdd(); 
68   void                           onRemove(); 
69   void                           onCheckBoxChanged();
70   void                           updateState();
71
72 private:
73   void                           clear();
74   void                           addPoint( double ); 
75   void                           removePoints(); 
76   double                         point( int ) const;
77   void                           setNbSegments( int, int );
78   int                            nbSegments( int ) const;
79
80   static QTreeWidgetItem*        newTreeItem( double v1, double v2 );
81   static QListWidgetItem*        newListItem( double v1 );
82   static QString                 treeItemText( double v1, double v2 );
83
84 private:
85   QListWidget*                   myListWidget;
86   QTreeWidget*                   myTreeWidget;
87   QtxDoubleSpinBox*              mySpinBox;
88   QPushButton*                   myAddButton;
89   QPushButton*                   myRemoveButton;
90   QCheckBox*                     mySameValues;
91   QString                        myParamValue;
92 };
93
94 #endif // STDMESHERSGUI_FIXEDPOINTSPARAMWGD_H