]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #391 Selection restore problem for sketch constraints
authornds <natalia.donis@opencascade.com>
Thu, 26 Feb 2015 08:05:47 +0000 (11:05 +0300)
committernds <natalia.donis@opencascade.com>
Thu, 26 Feb 2015 08:05:47 +0000 (11:05 +0300)
src/PartSet/PartSet_SketcherMgr.cpp

index db967f651434316543cb3d3d0c9b82471acb18b6..30f1523b975c0a7b427234c22bf4dedde442742f 100644 (file)
@@ -795,6 +795,21 @@ void PartSet_SketcherMgr::getSelectionOwners(const FeaturePtr& theFeature,
   XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(theWorkshop);
   XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
 
+  // 1. found the feature's owners. Check the AIS objects of the constructions
+  AISObjectPtr aAISObj = aDisplayer->getAISObject(theFeature);
+  if (aAISObj.get() != NULL && aSelectedAttributes.empty() && aSelectedResults.empty()) {
+    Handle(AIS_InteractiveObject) anAISIO = aAISObj->impl<Handle(AIS_InteractiveObject)>();
+
+    SelectMgr_IndexedMapOfOwner aSelectedOwners;  
+    aConnector->workshop()->selector()->selection()->entityOwners(anAISIO, aSelectedOwners);
+    for  (Standard_Integer i = 1, n = aSelectedOwners.Extent(); i <= n; i++) {
+      Handle(SelectMgr_EntityOwner) anOwner = aSelectedOwners(i);
+      if (!anOwner.IsNull())
+        anOwnersToSelect.Add(anOwner);
+    }
+  }
+
+  // 2. found the feature results's owners
   std::list<ResultPtr> aResults = theFeature->results();
   std::list<ResultPtr>::const_iterator aIt;
   for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt)