1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: CollectionPlugin_WidgetField.h
4 // Created: 16 Nov 2016
5 // Author: Vitaly SMETANNIKOV
8 #ifndef CollectionPlugin_WidgetField_H
9 #define CollectionPlugin_WidgetField_H
12 #include "CollectionPlugin.h"
14 #include <ModuleBase_WidgetSelector.h>
15 #include <ModuleBase_ViewerPrs.h>
18 #include <QStringList>
32 * Represent a content of the property panel to show/modify parameters of a Field feature.
34 class CollectionPlugin_WidgetField : public ModuleBase_WidgetSelector
38 CollectionPlugin_WidgetField(QWidget* theParent,
39 ModuleBase_IWorkshop* theWorkshop,
40 const Config_WidgetAPI* theData);
42 virtual ~CollectionPlugin_WidgetField() {}
44 /// Returns list of widget controls
45 /// \return a control list
46 virtual QList<QWidget*> getControls() const;
48 /// Checks the widget validity. By default, it returns true.
49 /// \param thePrs a selected presentation in the view
50 /// \return a boolean value
51 virtual bool isValidSelection(const std::shared_ptr<ModuleBase_ViewerPrs>& theValue);
55 /// Saves the internal parameters to the given feature
56 /// \return True in success
57 virtual bool storeValueCustom();
59 /// Restore value from attribute data to the widget's control
60 virtual bool restoreValueCustom();
62 /// Retunrs a list of possible shape types
63 /// \return a list of shapes
64 virtual QIntList shapeTypes() const;
68 /// Slot which is called on selection event
69 virtual void onSelectionChanged();
72 void onNbCompChanged(int theVal);
78 void onStepMove(int theStep);
80 void onFieldTypeChanged(int theIdx);
85 void appendStepControls();
86 void removeStepControls();
88 /// Types of shapes selection
89 QComboBox* myShapeTypeCombo;
91 /// Types of field data
92 QComboBox* myFieldTypeCombo;
94 /// Number of components
95 QSpinBox* myNbComponentsSpn;
97 /// Label of current step
100 /// Slider for steps management
101 QSlider* myStepSlider;
104 QList<QSpinBox*> myStampSpnList;
106 QList<QTableWidget*> myDataTblList;
110 QStackedWidget* myStepWgt;
112 QStringList myCompNamesList;
114 QList<ModuleBase_ViewerPrsPtr> mySelection;
116 QPushButton* myRemoveBtn;