]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
setDisplayed has to be called in order to synchronize internal state of the object
authorvsv <vitaly.smetannikov@opencascade.com>
Tue, 26 May 2015 10:02:45 +0000 (13:02 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Tue, 26 May 2015 10:02:45 +0000 (13:02 +0300)
src/PartSet/PartSet_SketcherMgr.cpp
src/XGUI/XGUI_Workshop.cpp

index aa42a16f95481a535ed50dda84a6e568777c6594..015257489767fe0e15f2e320e42e03720c40d58b 100644 (file)
@@ -843,7 +843,9 @@ bool PartSet_SketcherMgr::canDisplayObject(const ObjectPtr& theObject) const
       }
     }
   }
-
+  if (!isObjectFound) 
+    return aCanDisplay;
+  
   // 4. For created nested feature operation do not display the created feature if
   // the mouse curstor leaves the OCC window.
   // The correction cases, which ignores this condition:
@@ -865,7 +867,6 @@ bool PartSet_SketcherMgr::canDisplayObject(const ObjectPtr& theObject) const
     }
   }
   #endif
-  theObject->setDisplayed(aCanDisplay); // If it be set into True - set to False
   return aCanDisplay;
 }
 
index b7f68ebaab0e4f82b918caf0234a44c98e0d32c9..dfa21b5da8fd497137d746a0f453fa2ff352b00c 100644 (file)
@@ -515,16 +515,17 @@ void XGUI_Workshop::onFeatureCreatedMsg(const std::shared_ptr<ModelAPI_ObjectUpd
     // the validity of the data should be checked here in order to avoid display of the objects,
     // which were created, then deleted, but flush for the creation event happens after that
     // we should not display disabled objects
-    if (!anObject->data() || !anObject->data()->isValid() || anObject->isDisabled())
-      continue;
-    //ResultPartPtr aPart = std::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 {
-    isDisplayed = displayObject(*aIt);
-    //}
+    bool aHide = !anObject->data() || !anObject->data()->isValid() || 
+      anObject->isDisabled() || (!anObject->isDisplayed());
+    if (!aHide) {
+      // setDisplayed has to be called in order to synchronize internal state of the object 
+      // with list of displayed objects
+      if (myModule->canDisplayObject(anObject)) {
+        anObject->setDisplayed(true);
+        isDisplayed = displayObject(*aIt);
+      } else 
+        anObject->setDisplayed(false);
+    }
   }
   //if (myObjectBrowser)
   //  myObjectBrowser->processEvent(theMsg);
@@ -847,7 +848,7 @@ void XGUI_Workshop::onOpen()
   aSession->closeAll();
   aSession->load(myCurrentDir.toLatin1().constData());
   myObjectBrowser->rebuildDataTree();
-  displayAllResults();
+  //displayAllResults();
   updateCommandStatus();
   myIsLoadingData = false;
   QApplication::restoreOverrideCursor();