From: nds Date: Thu, 26 Feb 2015 08:05:47 +0000 (+0300) Subject: Issue #391 Selection restore problem for sketch constraints X-Git-Tag: V_1.1.0~168 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=12385f8af09b5ffbdf68bb42124ef76f1d034957;p=modules%2Fshaper.git Issue #391 Selection restore problem for sketch constraints --- diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index db967f651..30f1523b9 100644 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -795,6 +795,21 @@ void PartSet_SketcherMgr::getSelectionOwners(const FeaturePtr& theFeature, XGUI_ModuleConnector* aConnector = dynamic_cast(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(); + + 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 aResults = theFeature->results(); std::list::const_iterator aIt; for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt)