Salome HOME
Merge remote-tracking branch 'origin/cgt/devCEA'
[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_Dumper;
18 class ModelHighAPI_Reference;
19
20 /// \class FeaturesAPI_Recover
21 /// \ingroup CPPHighAPI
22 /// \brief Interface for Recover feature.
23 class FeaturesAPI_Recover: public ModelHighAPI_Interface
24 {
25 public:
26   /// Constructor without values.
27   FEATURESAPI_EXPORT
28   explicit FeaturesAPI_Recover(const std::shared_ptr<ModelAPI_Feature>& theFeature);
29
30   /// Constructor with values.
31   FEATURESAPI_EXPORT
32   FeaturesAPI_Recover(const std::shared_ptr<ModelAPI_Feature>& theFeature,
33                       const ModelHighAPI_Reference& theBaseFeature,
34                       const std::list<ModelHighAPI_Selection>& theRecoveredList,
35                       const bool thePersistent = false);
36
37   /// Destructor.
38   FEATURESAPI_EXPORT
39   virtual ~FeaturesAPI_Recover();
40
41   INTERFACE_2(FeaturesPlugin_Recover::ID(),
42               baseFeature, FeaturesPlugin_Recover::BASE_FEATURE(),
43               ModelAPI_AttributeReference, /** Concealed feature */,
44               recoveredList, FeaturesPlugin_Recover::RECOVERED_ENTITIES(),
45               ModelAPI_AttributeRefList, /** Recover list*/)
46
47   /// Set base feature.
48   FEATURESAPI_EXPORT
49   void setBaseFeature(const ModelHighAPI_Reference& theBaseFeature);
50
51   /// Set recovered list of the base feature
52   FEATURESAPI_EXPORT
53   void setRecoveredList(const std::list<ModelHighAPI_Selection>& theRecoverList);
54
55   /// Dump wrapped feature
56   FEATURESAPI_EXPORT
57   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
58 };
59
60 /// Pointer on Recover object.
61 typedef std::shared_ptr<FeaturesAPI_Recover> RecoverPtr;
62
63 /// \ingroup CPPHighAPI
64 /// \brief Create Recover feature.
65 FEATURESAPI_EXPORT
66 RecoverPtr addRecover(const std::shared_ptr<ModelAPI_Document>& thePart,
67                       const ModelHighAPI_Reference& theBaseFeature,
68                       const std::list<ModelHighAPI_Selection>& theRecoveredList,
69                       const bool thePersistent = false);
70
71 #endif // FeaturesAPI_Recover_H_