0028987: Visualization, SelectMgr_SelectableObject - move out iterator from object
[occt.git] / src / IVtkOCC / IVtkOCC_ViewerSelector.cxx
index 76f1159..94804ac 100644 (file)
@@ -188,9 +188,9 @@ void IVtkOCC_ViewerSelector::Pick (double**                  thePoly,
 //============================================================================
 void IVtkOCC_ViewerSelector::Activate (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())
   {
-    theSelection->Sensitive()->SetActiveForSelection();
+    aSelEntIter.Value()->SetActiveForSelection();
   }
 
   theSelection->SetSelectionState (SelectMgr_SOS_Activated);
@@ -205,9 +205,9 @@ void IVtkOCC_ViewerSelector::Activate (const Handle(SelectMgr_Selection)& theSel
 //============================================================================
 void IVtkOCC_ViewerSelector::Deactivate (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())
   {
-    theSelection->Sensitive()->ResetSelectionActiveStatus();
+    aSelEntIter.Value()->ResetSelectionActiveStatus();
   }
 
   theSelection->SetSelectionState (SelectMgr_SOS_Deactivated);