mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0028987: Visualization, SelectMgr_SelectableObject - move out iterator from object
Added method SelectMgr_SelectableObject::Selections() and depreacted methods Init(), More(), Next() and CurrentSelection(). Added method SelectMgr_Selection::Entities() and depreacted methods Init(), More(), Next() and Sensitivity(). SelectMgr_SelectableObject::myAssemblyOwner has been moved to AIS_MultipleConnectedInteractive. SelectMgr_SelectableObject::Selection() now returns NULL handle for not found selection. SelectMgr_SelectableObject::HasSelection() is no more virtual and just retuns !Selection().IsNull(). SelectMgr_SelectionManager::mySelectors map is now declared using proper key type Handle(SelectMgr_ViewerSelector) instead of Handle(Standard_Transient).
This commit is contained in:
@@ -52,14 +52,14 @@ void SelectMgr_SensitiveEntitySet::Append (const Handle(SelectMgr_SensitiveEntit
|
||||
//=======================================================================
|
||||
void SelectMgr_SensitiveEntitySet::Append (const Handle(SelectMgr_Selection)& theSelection)
|
||||
{
|
||||
for (theSelection->Init(); theSelection->More(); theSelection->Next())
|
||||
for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator aSelEntIter (theSelection->Entities()); aSelEntIter.More(); aSelEntIter.Next())
|
||||
{
|
||||
if (!theSelection->Sensitive()->BaseSensitive()->IsKind (STANDARD_TYPE(Select3D_SensitiveEntity)))
|
||||
if (!aSelEntIter.Value()->BaseSensitive()->IsKind (STANDARD_TYPE(Select3D_SensitiveEntity)))
|
||||
{
|
||||
theSelection->Sensitive()->ResetSelectionActiveStatus();
|
||||
aSelEntIter.Value()->ResetSelectionActiveStatus();
|
||||
continue;
|
||||
}
|
||||
mySensitives.Add (theSelection->Sensitive());
|
||||
mySensitives.Add (aSelEntIter.Value());
|
||||
}
|
||||
MarkDirty();
|
||||
}
|
||||
@@ -71,11 +71,13 @@ void SelectMgr_SensitiveEntitySet::Append (const Handle(SelectMgr_Selection)& th
|
||||
//=======================================================================
|
||||
void SelectMgr_SensitiveEntitySet::Remove (const Handle(SelectMgr_Selection)& theSelection)
|
||||
{
|
||||
for (theSelection->Init(); theSelection->More(); theSelection->Next())
|
||||
for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator aSelEntIter (theSelection->Entities()); aSelEntIter.More(); aSelEntIter.Next())
|
||||
{
|
||||
Standard_Integer anEntIdx = mySensitives.FindIndex (theSelection->Sensitive());
|
||||
if (!anEntIdx)
|
||||
const Standard_Integer anEntIdx = mySensitives.FindIndex (aSelEntIter.Value());
|
||||
if (anEntIdx == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (anEntIdx != mySensitives.Size())
|
||||
{
|
||||
|
Reference in New Issue
Block a user