1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: PartSet_WidgetSketchCreator.h
4 // Created: 08 June 2015
5 // Author: Vitaly SMETANNIKOV
7 #ifndef PartSet_WidgetSketchCreator_H
8 #define PartSet_WidgetSketchCreator_H
12 #include <ModuleBase_ModelWidget.h>
17 class ModuleBase_Operation;
19 class PARTSET_EXPORT PartSet_WidgetSketchCreator : public ModuleBase_ModelWidget
24 /// \param theParent the parent object
25 /// \param theData the widget configuation. The attribute of the model widget is obtained from
26 /// \param theParentId is Id of a parent of the current attribute
27 PartSet_WidgetSketchCreator(QWidget* theParent, PartSet_Module* theModule,
28 const Config_WidgetAPI* theData, const std::string& theParentId);
30 virtual ~PartSet_WidgetSketchCreator();
32 /// Set the given wrapped value to the current widget
33 /// This value should be processed in the widget according to the needs
34 /// The method is called by the current operation to process the operation preselection.
35 /// It is redefined to do nothing if the plane of the sketch has been already set.
36 /// \param theValues the wrapped selection values
37 /// \param thePosition an index in the list of values, the values should be get from the index
38 virtual bool setSelection(const QList<ModuleBase_ViewerPrs>& theValues, int& thePosition);
40 virtual bool restoreValue();
42 /// Returns list of widget controls
43 /// \return a control list
44 virtual QList<QWidget*> getControls() const;
47 /// Creates a backup of the current values of the attribute
48 /// It should be realized in the specific widget because of different
49 /// parameters of the current attribute
50 virtual void storeAttributeValue();
52 /// Creates a backup of the current values of the attribute
53 /// It should be realized in the specific widget because of different
54 /// parameters of the current attribute
55 /// \param theValid a boolean flag, if restore happens for valid parameters
56 virtual void restoreAttributeValue(const bool theValid);
58 /// Fills the attribute with the value of the selected owner
59 /// \param theOwner a selected owner
60 virtual bool setSelectionCustom(const ModuleBase_ViewerPrs& thePrs);
62 /// Saves the internal parameters to the given feature
63 /// \return True in success
64 virtual bool storeValueCustom() const;
66 /// The methiod called when widget is activated
67 virtual void activateCustom();
74 PartSet_Module* myModule;
76 /// Label of the widget
79 /// Input control of the widget
80 QLineEdit* myTextLine;