+//******************************************************
+void XGUI_Workshop::onStartWaiting()
+{
+ if (Events_LongOp::isPerformed()) {
+ QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+ }
+}
+
+//******************************************************
+void XGUI_Workshop::onFeatureUpdatedMsg(const ModelAPI_ObjectUpdatedMessage* theMsg)
+{
+ std::set<ObjectPtr> aFeatures = theMsg->objects();
+ if (myOperationMgr->hasOperation())
+ {
+ FeaturePtr aCurrentFeature = myOperationMgr->currentOperation()->feature();
+ std::set<ObjectPtr>::const_iterator aIt;
+ for (aIt = aFeatures.begin(); aIt != aFeatures.end(); ++aIt) {
+ ObjectPtr aNewFeature = (*aIt);
+ if(aNewFeature == aCurrentFeature) {
+ myPropertyPanel->updateContentWidget(aCurrentFeature);
+ break;
+ }
+ }
+ }
+ myOperationMgr->validateCurrentOperation();
+}
+
+//******************************************************
+void XGUI_Workshop::onFeatureRedisplayMsg(const ModelAPI_ObjectUpdatedMessage* theMsg)
+{
+ std::set<ObjectPtr> aObjects = theMsg->objects();
+ std::set<ObjectPtr>::const_iterator aIt;
+ for (aIt = aObjects.begin(); aIt != aObjects.end(); ++aIt) {
+ ObjectPtr aObj = (*aIt);
+ if (!aObj->data() || !aObj->data()->isValid())
+ myDisplayer->erase(aObj, false);
+ else {
+ if (myDisplayer->isVisible(aObj)) // TODO VSV: Correction sketch drawing
+ myDisplayer->display(aObj, false); // In order to update presentation
+ else {
+ if(myOperationMgr->hasOperation()) {
+ ModuleBase_Operation* aOperation = myOperationMgr->currentOperation();
+ if (aOperation->hasObject(aObj)) { // Display only current operation results
+ myDisplayer->display(aObj, false);
+ }
+ }
+ }
+ }
+ }
+ myDisplayer->updateViewer();
+}
+
+//******************************************************
+void XGUI_Workshop::onFeatureCreatedMsg(const ModelAPI_ObjectUpdatedMessage* theMsg)
+{
+ std::set<ObjectPtr> aObjects = theMsg->objects();
+
+ std::set<ObjectPtr>::const_iterator aIt;
+ bool aHasPart = false;
+ bool isDisplayed = false;
+ for (aIt = aObjects.begin(); aIt != aObjects.end(); ++aIt) {
+ ResultPartPtr aPart = boost::dynamic_pointer_cast<ModelAPI_ResultPart>(*aIt);
+ if (aPart) {
+ aHasPart = true;
+ // If a feature is created from the aplication's python console
+ // it doesn't stored in the operation mgr and doesn't displayed
+ } else if(myOperationMgr->hasOperation()) {
+ ModuleBase_Operation* aOperation = myOperationMgr->currentOperation();
+ if (aOperation->hasObject(*aIt)) { // Display only current operation results
+ myDisplayer->display(*aIt, false);
+ isDisplayed = true;
+ }
+ }
+ }
+ if (isDisplayed)
+ myDisplayer->updateViewer();
+ if (aHasPart) {
+ //The created part will be created in Object Browser later and we have to activate it
+ // only when it is created everywere
+ QTimer::singleShot(50, this, SLOT(activateLastPart()));
+ }
+}
+
+//******************************************************
+void XGUI_Workshop::onObjectDeletedMsg(const ModelAPI_ObjectDeletedMessage* theMsg)
+{
+ //std::set<ObjectPtr> aFeatures = theMsg->objects();