0030687: Visualization - remove redundant interfaces SelectBasics_EntityOwner and...
[occt.git] / tools / VInspector / VInspector_Tools.cxx
index b64359f..eeb52fe 100644 (file)
@@ -115,10 +115,10 @@ int VInspector_Tools::SelectedOwners (const Handle(AIS_InteractiveContext)& theC
 // purpose :
 // =======================================================================
 bool VInspector_Tools::IsOwnerSelected (const Handle(AIS_InteractiveContext)& theContext,
-                                        const Handle(SelectBasics_EntityOwner)& theOwner)
+                                        const Handle(SelectMgr_EntityOwner)& theOwner)
 {
   bool anIsSelected = false;
-  Handle(SelectMgr_EntityOwner) anOwner = Handle(SelectMgr_EntityOwner)::DownCast (theOwner);
+  Handle(SelectMgr_EntityOwner) anOwner = theOwner;
   for (theContext->InitSelected(); theContext->MoreSelected() && !anIsSelected; theContext->NextSelected())
     anIsSelected = theContext->SelectedOwner() == anOwner;
   return anIsSelected;
@@ -128,10 +128,10 @@ bool VInspector_Tools::IsOwnerSelected (const Handle(AIS_InteractiveContext)& th
 // function : ContextOwners
 // purpose :
 // =======================================================================
-NCollection_List<Handle(SelectBasics_EntityOwner)> VInspector_Tools::ContextOwners (
+NCollection_List<Handle(SelectMgr_EntityOwner)> VInspector_Tools::ContextOwners (
                                                const Handle(AIS_InteractiveContext)& theContext)
 {
-  NCollection_List<Handle(SelectBasics_EntityOwner)> aResultOwners;
+  NCollection_List<Handle(SelectMgr_EntityOwner)> aResultOwners;
   if (theContext.IsNull())
     return aResultOwners;
 
@@ -164,8 +164,8 @@ NCollection_List<Handle(SelectBasics_EntityOwner)> VInspector_Tools::ContextOwne
 #endif
         if (anEntity.IsNull())
           continue;
-        const Handle(SelectBasics_SensitiveEntity)& aBase = anEntity->BaseSensitive();
-        Handle(SelectBasics_EntityOwner) anOwner = aBase->OwnerId();
+        const Handle(Select3D_SensitiveEntity)& aBase = anEntity->BaseSensitive();
+        Handle(SelectMgr_EntityOwner) anOwner = aBase->OwnerId();
         Standard_Transient* anOwnerPtr = anOwner.operator->();
         if (aSelectedIds.contains ((size_t)anOwnerPtr))
           continue;
@@ -181,17 +181,17 @@ NCollection_List<Handle(SelectBasics_EntityOwner)> VInspector_Tools::ContextOwne
 // function : ActiveOwners
 // purpose :
 // =======================================================================
-NCollection_List<Handle(SelectBasics_EntityOwner)> VInspector_Tools::ActiveOwners (
+NCollection_List<Handle(SelectMgr_EntityOwner)> VInspector_Tools::ActiveOwners (
                                 const Handle(AIS_InteractiveContext)& theContext,
-                                NCollection_List<Handle(SelectBasics_EntityOwner)>& theEmptySelectableOwners)
+                                NCollection_List<Handle(SelectMgr_EntityOwner)>& theEmptySelectableOwners)
 {
-  NCollection_List<Handle(SelectBasics_EntityOwner)> aResultOwners;
+  NCollection_List<Handle(SelectMgr_EntityOwner)> aResultOwners;
 
   // only local context is processed: TODO for global context
   Handle(AIS_InteractiveContext) aContext = theContext;
   if (aContext.IsNull())
     return aResultOwners;
-  NCollection_List<Handle(SelectBasics_EntityOwner)> anActiveOwners;
+  NCollection_List<Handle(SelectMgr_EntityOwner)> anActiveOwners;
   // OCCT BUG:1 - equal pointer owners are appears in the list
 #if OCC_VERSION_HEX > 0x060901
   aContext->MainSelector()->ActiveOwners (anActiveOwners);
@@ -199,11 +199,10 @@ NCollection_List<Handle(SelectBasics_EntityOwner)> VInspector_Tools::ActiveOwner
   anActiveOwners = aContext->MainSelector()->ActiveOwners();
 #endif
   QList<size_t> aSelectedIds; // Remember of selected address in order to avoid duplicates
-  Handle(SelectMgr_EntityOwner) anOwner;
-  for (NCollection_List<Handle(SelectBasics_EntityOwner)>::Iterator anOwnersIt (anActiveOwners);
+  for (NCollection_List<Handle(SelectMgr_EntityOwner)>::Iterator anOwnersIt (anActiveOwners);
        anOwnersIt.More(); anOwnersIt.Next())
   {
-    anOwner = Handle(SelectMgr_EntityOwner)::DownCast (anOwnersIt.Value());
+    const Handle(SelectMgr_EntityOwner)& anOwner = anOwnersIt.Value();
     if (anOwner.IsNull())
       continue;
 
@@ -226,7 +225,7 @@ NCollection_List<Handle(SelectBasics_EntityOwner)> VInspector_Tools::ActiveOwner
 // purpose :
 // =======================================================================
 void VInspector_Tools::AddOrRemoveSelectedShapes (const Handle(AIS_InteractiveContext)& theContext,
-                                                  const NCollection_List<Handle(SelectBasics_EntityOwner)>& theOwners)
+                                                  const NCollection_List<Handle(SelectMgr_EntityOwner)>& theOwners)
 {
   // TODO: the next two rows are to be removed later
   theContext->UnhilightSelected(false);
@@ -234,10 +233,10 @@ void VInspector_Tools::AddOrRemoveSelectedShapes (const Handle(AIS_InteractiveCo
 
   theContext->UnhilightSelected(Standard_False);
 
-  for (NCollection_List<Handle(SelectBasics_EntityOwner)>::Iterator anOwnersIt(theOwners);
+  for (NCollection_List<Handle(SelectMgr_EntityOwner)>::Iterator anOwnersIt(theOwners);
        anOwnersIt.More(); anOwnersIt.Next())
   {
-    Handle(SelectMgr_EntityOwner) anOwner = Handle(SelectMgr_EntityOwner)::DownCast (anOwnersIt.Value());
+    Handle(SelectMgr_EntityOwner) anOwner = anOwnersIt.Value();
     theContext->AddOrRemoveSelected (anOwner, Standard_False);
   }
   theContext->UpdateCurrentViewer();