Salome HOME
Issue #1662: implementation of Recover feature.
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Recover.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        FeaturesAPI_Recover.h
4 // Created:     04 August 2016
5 // Author:      Mikhail Ponikarov
6
7 #ifndef FeaturesAPI_Recover_H_
8 #define FeaturesAPI_Recover_H_
9
10 #include "FeaturesAPI.h"
11
12 #include <FeaturesPlugin_Recover.h>
13
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
16
17 class ModelHighAPI_Reference;
18
19 /// \class FeaturesAPI_Recover
20 /// \ingroup CPPHighAPI
21 /// \brief Interface for Recover feature.
22 class FeaturesAPI_Recover: public ModelHighAPI_Interface
23 {
24 public:
25   /// Constructor without values.
26   FEATURESAPI_EXPORT
27   explicit FeaturesAPI_Recover(const std::shared_ptr<ModelAPI_Feature>& theFeature);
28
29   /// Constructor with values.
30   FEATURESAPI_EXPORT
31   FeaturesAPI_Recover(const std::shared_ptr<ModelAPI_Feature>& theFeature,
32                       const ModelHighAPI_Reference& theBaseFeature,
33                       const std::list<ModelHighAPI_Selection>& theRecoveredList,
34                       const bool thePersistent = false);
35
36   /// Destructor.
37   FEATURESAPI_EXPORT
38   virtual ~FeaturesAPI_Recover();
39
40   INTERFACE_3(FeaturesPlugin_Recover::ID(),
41               baseFeature, FeaturesPlugin_Recover::BASE_FEATURE(), ModelAPI_AttributeReference, /** Concealed feature */,
42               recoveredList, FeaturesPlugin_Recover::RECOVERED_ENTITIES(), ModelAPI_AttributeRefList, /** Recover list*/,
43               isPersistent, FeaturesPlugin_Recover::PERSISTENT(), ModelAPI_AttributeBoolean, /** Is persistent flag */)
44
45   /// Set base feature.
46   FEATURESAPI_EXPORT
47   void setBaseFeature(const ModelHighAPI_Reference& theBaseFeature);
48
49   /// Set recovered list of the base feature
50   FEATURESAPI_EXPORT
51   void setRecoveredList(const std::list<ModelHighAPI_Selection>& theRecoverList);
52
53   /// Set auxiliary
54   FEATURESAPI_EXPORT
55   void setIsPersistent(bool thePersistent);
56
57 };
58
59 /// Pointer on Recover object.
60 typedef std::shared_ptr<FeaturesAPI_Recover> RecoverPtr;
61
62 /// \ingroup CPPHighAPI
63 /// \brief Create Recover feature.
64 FEATURESAPI_EXPORT
65 RecoverPtr addRecover(const std::shared_ptr<ModelAPI_Document>& thePart,
66                       const ModelHighAPI_Reference& theBaseFeature,
67                       const std::list<ModelHighAPI_Selection>& theRecoveredList,
68                       const bool thePersistent = false);
69
70 #endif // FeaturesAPI_Recover_H_