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