Salome HOME
Merge branch 'master' into cgt/devCEA
[modules/shaper.git] / src / CollectionPlugin / CollectionPlugin_WidgetField.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        CollectionPlugin_WidgetField.h
4 // Created:     16 Nov 2016
5 // Author:      Vitaly SMETANNIKOV
6
7
8 #ifndef CollectionPlugin_WidgetField_H
9 #define CollectionPlugin_WidgetField_H
10
11
12 #include "CollectionPlugin.h"
13
14 #include <ModuleBase_ModelWidget.h>
15
16 class QWidget;
17 class QComboBox;
18 class QSpinBox;
19 class QLabel;
20 class QSlider;
21 class QTableWidget;
22
23 /*!
24  * \ingroup GUI
25  * Represent a content of the property panel to show/modify parameters of a Field feature.
26  */
27 class CollectionPlugin_WidgetField : public ModuleBase_ModelWidget
28 {
29  Q_OBJECT
30 public:
31   CollectionPlugin_WidgetField(QWidget* theParent, const Config_WidgetAPI* theData);
32
33   virtual ~CollectionPlugin_WidgetField() {}
34
35   /// Returns list of widget controls
36   /// \return a control list
37   virtual QList<QWidget*> getControls() const;
38
39 protected:
40   /// Saves the internal parameters to the given feature
41   /// \return True in success
42   virtual bool storeValueCustom();
43
44   /// Restore value from attribute data to the widget's control
45   virtual bool restoreValueCustom();
46
47 private slots:
48   void onNbCompChanged(int theVal);
49
50   void onAddStep();
51
52   void onRemoveStep();
53
54   void onStepMove(int theStep);
55
56 private:
57   void clearData();
58
59   /// Types of shapes selection
60   QComboBox* myShapeTypeCombo;
61
62   /// Types of field data
63   QComboBox* myFieldTypeCombo;
64
65   /// Number of components
66   QSpinBox* myNbComponentsSpn;
67
68   /// Label of current step
69   QLabel* myCurStepLbl;
70
71   /// Slider for steps management
72   QSlider* myStepSlider;
73
74   /// Stamp value
75   QSpinBox* myStampSpn;
76
77   QTableWidget* myDataTbl;
78
79   QLabel* myMaxLbl;
80 };
81
82 #endif