std::shared_ptr<ModelAPI_DocumentCreatedMessage> aMessage = std::dynamic_pointer_cast<
ModelAPI_DocumentCreatedMessage>(theMessage);
DocumentPtr aDoc = aMessage->document();
+
+ /// Issue 431: for the current moment create planes only in the module document,
+ /// Later if it is needed we may create special initial planes in Parts (may be different)
+ if (aDoc != ModelAPI_Session::get()->moduleDocument())
+ return;
+
std::list<FeaturePtr> aFeatures;
// the viewer update should be blocked in order to avoid the features blinking before they are
// hides the created features, the precondition is that the feature's results have been
// already built, so the createPlane/Points method calls the execute function for the planes
- static Events_ID HIDE_DISP = Events_Loop::loop()->eventByName(EVENT_OBJECT_TOHIDE);
std::list<FeaturePtr >::const_iterator aFIter = aFeatures.begin();
for (; aFIter != aFeatures.cend(); aFIter++) {
FeaturePtr aPlane = *aFIter;
const std::list<std::shared_ptr<ModelAPI_Result> >& aResults = aPlane->results();
std::list<ResultPtr >::const_iterator aRIter = aResults.begin();
for (; aRIter != aResults.cend(); aRIter++) {
- ModelAPI_EventCreator::get()->sendUpdated(*aRIter, HIDE_DISP);
+ (*aRIter)->setDisplayed(false);
}
}
- Events_Loop::loop()->flush(HIDE_DISP);
+ Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
// the viewer update should be unblocked in order to avoid the features blinking before they are
// hidden
// the plane should be executed in order to build the feature result immediatelly
// the results are to be hidden in the plugin
aPlane->execute();
+ // this flag is needed here to avoid setting it inside of the next transaction
+ // (may cause crash on redo of the first transaction in OCAF)
+ aPlane->data()->execState(ModelAPI_StateDone);
+ aPlane->firstResult()->data()->execState(ModelAPI_StateDone);
return aPlane;
}
// the point should be executed in order to build the feature result immediatelly
// the results are to be hidden in the plugin
aPoint->execute();
+ aPoint->data()->execState(ModelAPI_StateDone);
+ aPoint->firstResult()->data()->execState(ModelAPI_StateDone);
return aPoint;
}