X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FModelAPI%2FModelAPI_Result.cpp;h=c16732d99a9d9d0ad8ce117e7f5eede5ef277df0;hb=96912644cf6607688466ac69f1f098fd2fff37b7;hp=d435920149f5dc4e44a33c7421caae8750c59771;hpb=7e8c3851e31686f25919a9c9f2a21e2787826b0f;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_Result.cpp b/src/ModelAPI/ModelAPI_Result.cpp index d43592014..c16732d99 100644 --- a/src/ModelAPI/ModelAPI_Result.cpp +++ b/src/ModelAPI/ModelAPI_Result.cpp @@ -12,9 +12,45 @@ ModelAPI_Result::~ModelAPI_Result() { +} +bool ModelAPI_Result::setDisabled(std::shared_ptr theThis, const bool theFlag) +{ + if (myIsDisabled != theFlag) { + myIsDisabled = theFlag; + // this must be before "updated" message send to have history updated for OB update + document()->updateHistory(groupName()); // to update the history cash data in the document + // generate related events + static Events_Loop* aLoop = Events_Loop::loop(); + static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get(); + if (myIsDisabled) { // disabled result looks like removed + aECreator->sendDeleted(document(), groupName()); + } else { // un-disabled equals to created + static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_CREATED); + aECreator->sendUpdated(theThis, anEvent, false); // do not group: creation must be immediate + } + static Events_ID EVENT_DISP = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY); + aECreator->sendUpdated(theThis, EVENT_DISP, false); + return true; + } + return false; +} + +bool ModelAPI_Result::isDisabled() const +{ + return myIsDisabled; } +void ModelAPI_Result::setIsConcealed(const bool theValue) +{ + if (myIsConcealed != theValue) { + myIsConcealed = theValue; + if (document().get()) // can be on creation of result + document()->updateHistory(groupName()); // to update the history cash data in the document + } +} + + std::shared_ptr ModelAPI_Result::shape() { return std::shared_ptr();