X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_Feature.cpp;h=5b9d7e3d4e0f3da971bd37d24dd6347179928f9f;hb=f5c7bb3100ed321392da42f61c2ab505833ec61a;hp=f677d5c52e2a542bc87226141944c271e7909692;hpb=857b1f72d9703c46c6c8c9bb239821d314344c86;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_Feature.cpp b/src/ModelAPI/ModelAPI_Feature.cpp index f677d5c52..5b9d7e3d4 100644 --- a/src/ModelAPI/ModelAPI_Feature.cpp +++ b/src/ModelAPI/ModelAPI_Feature.cpp @@ -199,7 +199,32 @@ bool ModelAPI_Feature::isDisabled() return myIsDisabled; } +bool ModelAPI_Feature::setStable(const bool theFlag) +{ + if (myIsStable != theFlag) { + myIsStable = theFlag; + // send an event about the stability change (editing is started/finished) + static Events_Loop* aLoop = Events_Loop::loop(); + static Events_ID EVENT_STAB = aLoop->eventByName(EVENT_STABILITY_CHANGED); + std::shared_ptr aMessage(new Events_Message(EVENT_STAB, this)); + aLoop->send(aMessage, false); + return true; + } + return false; +} + +bool ModelAPI_Feature::isStable() +{ + return myIsStable; +} + bool ModelAPI_Feature::isPreviewNeeded() const { return true; } + +void ModelAPI_Feature::init() +{ + myIsDisabled = false; + myIsStable = true; +}