Salome HOME
Merge branch 'master' into cgt/devCEA
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Recover.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        FeaturesPlugin_Recover.h
4 // Created:     29 Jul 2016
5 // Author:      Natalia ERMOLAEVA
6
7 #ifndef FEATURESPLUGIN_RECOVER_H_
8 #define FEATURESPLUGIN_RECOVER_H_
9
10 #include "FeaturesPlugin.h"
11 #include <ModelAPI_Feature.h>
12 #include <GeomAPI_Shape.h>
13
14 /**\class FeaturesPlugin_Recover
15  * \ingroup Plugins
16  * \brief Feature for display of concealed attributes of some feature.
17  */
18 class FeaturesPlugin_Recover : public ModelAPI_Feature
19 {
20   /// List of already registered unconcealed pairs of unconcealed result and feature that caused
21   /// concealment. If attributes of this feature were changed, this list helps to synchronise
22   /// the current state with validators.
23   std::set<std::shared_ptr<ModelAPI_Object> > myRegistered;
24   /// The last stored Base to unregister Unconcealed when even attributes are already erased.
25   FeaturePtr myCurrentBase;
26   /// previous state of persistent flag
27   bool myPersistent;
28  public:
29   /// Extrusion kind
30   inline static const std::string& ID()
31   {
32     static const std::string MY_RECOVER_ID("Recover");
33     return MY_RECOVER_ID;
34   }
35   /// Attribute name of base feature.
36   inline static const std::string& BASE_FEATURE()
37   {
38     static const std::string MY_BASE_FEATURE("base_feature");
39     return MY_BASE_FEATURE;
40   }
41
42   /// Attribute name of recovered results list.
43   inline static const std::string& RECOVERED_ENTITIES()
44   {
45     static const std::string MY_RECOVERED_ENTITIES_ID("recovered");
46     return MY_RECOVERED_ENTITIES_ID;
47   }
48
49   /// Returns the kind of a feature
50   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
51   {
52     static std::string MY_KIND = FeaturesPlugin_Recover::ID();
53     return MY_KIND;
54   }
55
56   /// Creates a new part document if needed
57   FEATURESPLUGIN_EXPORT virtual void execute();
58
59   /// Request for initialization of data model of the feature: adding all attributes
60   FEATURESPLUGIN_EXPORT virtual void initAttributes();
61
62   /// Use plugin manager for features creation
63   FeaturesPlugin_Recover();
64
65 };
66
67 #endif