diff --git a/src/AIS/AIS_LocalContext_1.cxx b/src/AIS/AIS_LocalContext_1.cxx index 7a405b6039..5b5cb97686 100644 --- a/src/AIS/AIS_LocalContext_1.cxx +++ b/src/AIS/AIS_LocalContext_1.cxx @@ -1454,8 +1454,10 @@ Handle(SelectMgr_EntityOwner) AIS_LocalContext::FindSelectedOwnerFromShape(const Standard_Boolean found(Standard_False); if (!found) { - NCollection_List::Iterator anOwnersIt (myMainVS->ActiveOwners()); - for (; anOwnersIt.More(); anOwnersIt.Next()) { + NCollection_List anActiveOwners; + myMainVS->ActiveOwners (anActiveOwners); + for (NCollection_List::Iterator anOwnersIt (anActiveOwners); anOwnersIt.More(); anOwnersIt.Next()) + { EO = Handle(SelectMgr_EntityOwner)::DownCast (anOwnersIt.Value()); Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast(EO); if (!BROwnr.IsNull() && BROwnr->HasShape() && BROwnr->Shape() == sh) { diff --git a/src/SelectMgr/SelectMgr_ViewerSelector.cxx b/src/SelectMgr/SelectMgr_ViewerSelector.cxx index 28a12000fc..8a5190f7f7 100644 --- a/src/SelectMgr/SelectMgr_ViewerSelector.cxx +++ b/src/SelectMgr/SelectMgr_ViewerSelector.cxx @@ -839,9 +839,8 @@ const Handle(SelectBasics_SensitiveEntity)& SelectMgr_ViewerSelector::DetectedEn // function : ActiveOwners // purpose : Returns the list of active entity owners //======================================================================= -NCollection_List SelectMgr_ViewerSelector::ActiveOwners() const +void SelectMgr_ViewerSelector::ActiveOwners (NCollection_List& theOwners) const { - NCollection_List anActiveOwners; for (SelectMgr_MapOfObjectSensitivesIterator anIter (myMapOfObjectSensitives); anIter.More(); anIter.Next()) { const NCollection_Handle& anEntitySet = anIter.Value(); @@ -850,10 +849,8 @@ NCollection_List SelectMgr_ViewerSelector::Act { if (anEntitySet->GetSensitiveById (anIdx)->IsActiveForSelection()) { - anActiveOwners.Append (anEntitySet->GetSensitiveById (anIdx)->BaseSensitive()->OwnerId()); + theOwners.Append (anEntitySet->GetSensitiveById (anIdx)->BaseSensitive()->OwnerId()); } } } - - return anActiveOwners; } diff --git a/src/SelectMgr/SelectMgr_ViewerSelector.hxx b/src/SelectMgr/SelectMgr_ViewerSelector.hxx index 3f9def378b..0d95e77fd3 100644 --- a/src/SelectMgr/SelectMgr_ViewerSelector.hxx +++ b/src/SelectMgr/SelectMgr_ViewerSelector.hxx @@ -203,7 +203,7 @@ public: Standard_EXPORT TCollection_AsciiString Status (const Handle(SelectMgr_SelectableObject)& theSelectableObject) const; //! Returns the list of active entity owners - Standard_EXPORT NCollection_List ActiveOwners() const; + Standard_EXPORT void ActiveOwners (NCollection_List& theOwners) const; //! Adds new object to the map of selectable objects Standard_EXPORT void AddSelectableObject (const Handle(SelectMgr_SelectableObject)& theObject);