1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModuleBase_WidgetSelectorStore.h
4 // Created: 2 June 2014
5 // Author: Vitaly Smetannikov
7 #ifndef ModuleBase_WidgetSelectorStore_H
8 #define ModuleBase_WidgetSelectorStore_H
10 #include "ModuleBase.h"
12 #include <ModelAPI_Object.h>
13 #include <ModelAPI_Attribute.h>
14 #include <GeomAPI_Shape.h>
16 class ModuleBase_IWorkshop;
20 Provides for an attribute backup of values.
21 It is possible to store/ restore the attribute values.
23 class ModuleBase_WidgetSelectorStore
28 MODULEBASE_EXPORT ModuleBase_WidgetSelectorStore();
30 MODULEBASE_EXPORT virtual ~ModuleBase_WidgetSelectorStore() {}
32 /// Creates a backup of the current values of the attribute
33 /// \param theAttribute a model attribute which parameters are to be stored
34 /// \param theWorkshop a current workshop
35 MODULEBASE_EXPORT void storeAttributeValue(const AttributePtr& theAttribute,
36 ModuleBase_IWorkshop* theWorkshop);
38 /// Creates a backup of the current values of the attribute
39 /// \param theAttribute a model attribute which parameters are to be restored
40 /// \param theWorkshop a current workshop
41 MODULEBASE_EXPORT void restoreAttributeValue(const AttributePtr& theAttribute,
42 ModuleBase_IWorkshop* theWorkshop);
45 /// backup parameters of the model attribute. The class processes three types of attribute:
46 /// Reference, RefAttr and Selection.
47 /// Depending on the attribute type, only the attribute parameter
48 /// values are reserved in the backup
49 /// An attribute object
51 /// An attribute shape
53 /// A reference of the attribute
54 AttributePtr myRefAttribute;
55 /// A boolean value whether refAttr uses reference of object
58 /// Variable of selection type
59 std::string mySelectionType;
60 /// Variable of GeomSelection
61 int mySelectionCount; // number of elements in the attribute selection list when store