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 //=================================================================================================
13 FeaturesAPI_Recover::FeaturesAPI_Recover(const std::shared_ptr<ModelAPI_Feature>& theFeature)
14 : ModelHighAPI_Interface(theFeature)
19 //=================================================================================================
20 FeaturesAPI_Recover::FeaturesAPI_Recover(const std::shared_ptr<ModelAPI_Feature>& theFeature,
21 const ModelHighAPI_Reference& theBaseFeature,
22 const std::list<ModelHighAPI_Selection>& theRecoveredList, const bool thePersistent)
23 : ModelHighAPI_Interface(theFeature)
26 setBaseFeature(theBaseFeature);
27 setRecoveredList(theRecoveredList);
28 setIsPersistent(thePersistent);
32 //=================================================================================================
33 FeaturesAPI_Recover::~FeaturesAPI_Recover()
36 //=================================================================================================
37 void FeaturesAPI_Recover::setBaseFeature(const ModelHighAPI_Reference& theBaseFeature)
39 fillAttribute(theBaseFeature, mybaseFeature);
40 // do not need to execute because on attribute changed it does everything anyway
43 //=================================================================================================
44 void FeaturesAPI_Recover::setRecoveredList(const std::list<ModelHighAPI_Selection>& theRecoverList)
46 fillAttribute(theRecoverList, myrecoveredList);
47 // do not need to execute because on attribute changed it does everything anyway
50 //=================================================================================================
51 void FeaturesAPI_Recover::setIsPersistent(bool thePersistent)
53 fillAttribute(thePersistent, myisPersistent);
54 // do not need to execute because on attribute changed it does everything anyway
57 //=================================================================================================
58 RecoverPtr addRecover(const std::shared_ptr<ModelAPI_Document>& thePart,
59 const ModelHighAPI_Reference& theBaseFeature,
60 const std::list<ModelHighAPI_Selection>& theRecoveredList, const bool thePersistent)
62 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Recover::ID());
63 return RecoverPtr(new FeaturesAPI_Recover(
64 aFeature, theBaseFeature, theRecoveredList, thePersistent));