emit selectionChanged();
}
+//**************************************************************
+void XGUI_SelectionMgr::deselectPresentation(const Handle(AIS_InteractiveObject) theObject)
+{
+ NCollection_List<Handle(SelectBasics_EntityOwner)> aResultOwners;
+
+ Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
+ for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) {
+ Handle(SelectMgr_EntityOwner) anOwner = aContext->SelectedOwner();
+ if (anOwner.IsNull()) // TODO: check why it is possible
+ continue;
+ if (anOwner->Selectable() == theObject && anOwner->IsSelected())
+ aResultOwners.Append(anOwner);
+ }
+ NCollection_List<Handle(SelectBasics_EntityOwner)>::Iterator anOwnersIt (aResultOwners);
+ Handle(SelectMgr_EntityOwner) anOwner;
+ for (; anOwnersIt.More(); anOwnersIt.Next()) {
+ anOwner = Handle(SelectMgr_EntityOwner)::DownCast(anOwnersIt.Value());
+ if (!anOwner.IsNull())
+ aContext->AddOrRemoveSelected(anOwner, false);
+ }
+}
+
//**************************************************************
void XGUI_SelectionMgr::updateSelectionBy(const ModuleBase_ISelection::SelectionPlace& thePlace)
{
if (aObjects.isEmpty())
return aFeatures;
+ bool isPart = false;
foreach(ObjectPtr aObj, aObjects) {
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aObj);
- if (aFeature.get())
- aFeatures.push_back(aFeature);
+ if (aFeature.get()) {
+ ResultPtr aRes = aFeature->firstResult();
+ isPart = (aRes.get() && (aRes->groupName() == ModelAPI_ResultPart::group()));
+ if (!isPart)
+ aFeatures.push_back(aFeature);
+ }
}
return aFeatures;
}
\ No newline at end of file