#include <GeomAlgoAPI_Tools.h>
FeaturesPlugin_Recover::FeaturesPlugin_Recover()
+ : myClearListOnTypeChange(true)
{
}
data()->addAttribute(RECOVERED_ENTITIES(), ModelAPI_AttributeRefList::typeId());
data()->addAttribute(METHOD(), ModelAPI_AttributeString::typeId());
+ if (!string(METHOD())->isInitialized()) {
+ myClearListOnTypeChange = false;
+ string(METHOD())->setValue(METHOD_DEFAULT());
+ myClearListOnTypeChange = true;
+ }
ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), METHOD());
// set default method for recovering
string(METHOD())->setValue(METHOD_DEFAULT());
void FeaturesPlugin_Recover::attributeChanged(const std::string& theID)
{
- if (theID == METHOD())
+ if (theID == METHOD() && myClearListOnTypeChange)
reflist(RECOVERED_ENTITIES())->clear();
}
FeaturePtr myCurrentBase;
/// previous state of persistent flag
bool myPersistent;
+ /// necessity to clean recovered list while changing the type of recover
+ bool myClearListOnTypeChange;
public:
/// Extrusion kind
inline static const std::string& ID()