X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_ResultBody.cpp;h=5fb26d84309209720f6c8689237aa89c7e4aa759;hb=8f2e8789faa06405e900ee2272858a8ca898ba32;hp=8418ba22fa5c63adfe506f5f044f939c64ddc977;hpb=cc171413e851e053de99dee13870d2c1cab0327e;p=modules%2Fshaper.git diff --git a/src/Model/Model_ResultBody.cpp b/src/Model/Model_ResultBody.cpp index 8418ba22f..5fb26d843 100644 --- a/src/Model/Model_ResultBody.cpp +++ b/src/Model/Model_ResultBody.cpp @@ -7,7 +7,9 @@ #include #include #include +#include #include +#include // DEB //#include //#include @@ -16,6 +18,7 @@ Model_ResultBody::Model_ResultBody() { myBuilder = new Model_BodyBuilder(this); + myWasConcealed = false; } void Model_ResultBody::initAttributes() @@ -46,3 +49,35 @@ bool Model_ResultBody::isLatestEqual(const std::shared_ptr& theSh { return myBuilder->isLatestEqual(theShape); } + +bool Model_ResultBody::isConcealed() +{ + bool aResult = false; + if (ModelAPI_ResultBody::isConcealed()) { + aResult = true; + } else { + ResultPtr aThis = std::dynamic_pointer_cast(data()->owner()); + if (aThis.get()) { + ResultCompSolidPtr aParent = ModelAPI_Tools::compSolidOwner(aThis); + if (aParent.get()) { + if (aParent->isConcealed()) + aResult = true; + } + } + } + if (myWasConcealed != aResult) { + myWasConcealed = aResult; + if (aResult) { // hidden unit must be redisplayed (hidden) + ModelAPI_EventCreator::get()->sendDeleted(document(), this->groupName()); + // redisplay for the viewer (it must be disappeared also) + static Events_ID EVENT_DISP = + Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY); + ModelAPI_EventCreator::get()->sendUpdated(data()->owner(), EVENT_DISP); + } else { // was not concealed become concealed => delete event + static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_CREATED); + ModelAPI_EventCreator::get()->sendUpdated(data()->owner(), anEvent); + } + } + + return aResult; +}