1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: FeaturesAPI_Recover.cpp
4 // Created: 07 June 2016
5 // Author: Dmitry Bobylev
7 #include "FeaturesAPI_Recover.h"
9 #include <ModelHighAPI_Reference.h>
10 #include <ModelHighAPI_Tools.h>
12 FeaturesAPI_Recover::FeaturesAPI_Recover(const std::shared_ptr<ModelAPI_Feature>& theFeature)
13 : ModelHighAPI_Interface(theFeature)
18 FeaturesAPI_Recover::FeaturesAPI_Recover(const std::shared_ptr<ModelAPI_Feature>& theFeature,
19 const ModelHighAPI_Reference& theBaseFeature,
20 const std::list<ModelHighAPI_Selection>& theRecoveredList, const bool thePersistent)
21 : ModelHighAPI_Interface(theFeature)
24 setBaseFeature(theBaseFeature);
25 setRecoveredList(theRecoveredList);
26 setIsPersistent(thePersistent);
30 FeaturesAPI_Recover::~FeaturesAPI_Recover()
33 void FeaturesAPI_Recover::setBaseFeature(const ModelHighAPI_Reference& theBaseFeature)
35 fillAttribute(theBaseFeature, mybaseFeature);
36 // do not need to execute because on attribute changed it does everything anyway
39 void FeaturesAPI_Recover::setRecoveredList(const std::list<ModelHighAPI_Selection>& theRecoverList)
41 fillAttribute(theRecoverList, myrecoveredList);
42 // do not need to execute because on attribute changed it does everything anyway
45 void FeaturesAPI_Recover::setIsPersistent(bool thePersistent)
47 fillAttribute(thePersistent, myisPersistent);
48 // do not need to execute because on attribute changed it does everything anyway
51 RecoverPtr addRecover(const std::shared_ptr<ModelAPI_Document>& thePart,
52 const ModelHighAPI_Reference& theBaseFeature,
53 const std::list<ModelHighAPI_Selection>& theRecoveredList, const bool thePersistent)
55 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Recover::ID());
56 return RecoverPtr(new FeaturesAPI_Recover(
57 aFeature, theBaseFeature, theRecoveredList, thePersistent));