+
+bool Model_ResultBody::isConcealed()
+{
+ bool aResult = false;
+ if (ModelAPI_ResultBody::isConcealed()) {
+ aResult = true;
+ } else {
+ ResultPtr aThis = std::dynamic_pointer_cast<ModelAPI_Result>(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;
+}