0023649: Visualization, AIS_LocalContext - make highlighting of already selected...
[occt.git] / src / AIS / AIS_InteractiveContext.cxx
index dd649e4..46a3262 100644 (file)
@@ -5,8 +5,8 @@
 //
 // This file is part of Open CASCADE Technology software library.
 //
-// This library is free software; you can redistribute it and / or modify it
-// under the terms of the GNU Lesser General Public version 2.1 as published
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
 // by the Free Software Foundation, with special exception defined in the file
 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
 // distribution for complete text of the license and disclaimer of any warranty.
@@ -121,7 +121,7 @@ mgrSelector(new SelectMgr_SelectionManager()),
 myMainPM(new PrsMgr_PresentationManager3d(MainViewer->Viewer())),
 myMainVwr(MainViewer),
 myMainSel(new StdSelect_ViewerSelector3d()),
-myToHilightSelected( Standard_False ),
+myToHilightSelected( Standard_True ),
 myFilters(new SelectMgr_OrFilter()),
 myDefaultDrawer(new Prs3d_Drawer()),
 myDefaultColor(Quantity_NOC_GOLDENROD),
@@ -1270,42 +1270,44 @@ void AIS_InteractiveContext::RecomputeSelectionOnly(const Handle(AIS_Interactive
 //function : Update
 //purpose  : 
 //=======================================================================
-
-void AIS_InteractiveContext::Update(const Handle(AIS_InteractiveObject)& anIObj,
-                                    const Standard_Boolean updateviewer)
+void AIS_InteractiveContext::Update (const Handle(AIS_InteractiveObject)& theIObj,
+                                     const Standard_Boolean theUpdateViewer)
 {
-  if(anIObj.IsNull()) return;
+  if (theIObj.IsNull())
+  {
+    return;
+  }
 
-  
+  TColStd_ListOfInteger aListOfFlaggedPrsModes;
+  theIObj->ToBeUpdated (aListOfFlaggedPrsModes);
 
-  TColStd_ListOfInteger LL;
-  anIObj->ToBeUpdated(LL);
-  TColStd_ListIteratorOfListOfInteger ITI(LL);
-  Standard_Boolean wasupdated(Standard_False);
-  
-  for (;ITI.More();ITI.Next()){
-    anIObj->Update(ITI.Value(),Standard_False);
-    wasupdated = Standard_True;
+  TColStd_ListIteratorOfListOfInteger aPrsModesIt (aListOfFlaggedPrsModes);
+  for ( ; aPrsModesIt.More(); aPrsModesIt.Next())
+  {
+    theIObj->Update (aPrsModesIt.Value(), Standard_False);
   }
-  
-  if(wasupdated)
-    mgrSelector->Update(anIObj);
-  
-  if(updateviewer){
-    if(!myObjects.IsBound(anIObj)) return;
-    switch(myObjects(anIObj)->GraphicStatus()){
-    case AIS_DS_Displayed:
-    case AIS_DS_Temporary:
-      myMainVwr->Update();
-      break;
-    default:
-      break;
+
+  mgrSelector->Update(theIObj);
+
+  if (theUpdateViewer)
+  {
+    if (!myObjects.IsBound (theIObj))
+    {
+      return;
+    }
+
+    switch (myObjects (theIObj)->GraphicStatus())
+    {
+      case AIS_DS_Displayed:
+      case AIS_DS_Temporary:
+        myMainVwr->Update();
+        break;
+      default:
+        break;
     }
   }
 }
 
-
-
 //=======================================================================
 //function : SetLocation
 //purpose  : 
@@ -2578,7 +2580,7 @@ Standard_Boolean AIS_InteractiveContext::IsoOnPlane() const
 //purpose  : 
 //=======================================================================
 
-void AIS_InteractiveContext::SetSelectionMode(const Handle_AIS_InteractiveObject&, const Standard_Integer )
+void AIS_InteractiveContext::SetSelectionMode(const Handle(AIS_InteractiveObject)&, const Standard_Integer )
 {
 }
 
@@ -2587,7 +2589,7 @@ void AIS_InteractiveContext::SetSelectionMode(const Handle_AIS_InteractiveObject
 //purpose  : 
 //=======================================================================
 
-void AIS_InteractiveContext::UnsetSelectionMode(const Handle_AIS_InteractiveObject&)
+void AIS_InteractiveContext::UnsetSelectionMode(const Handle(AIS_InteractiveObject)&)
 {
 }
 
@@ -2674,7 +2676,7 @@ Standard_Integer AIS_InteractiveContext::PixelTolerance() const {
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean AIS_InteractiveContext::IsInLocal(const Handle_AIS_InteractiveObject& anIObj,
+Standard_Boolean AIS_InteractiveContext::IsInLocal(const Handle(AIS_InteractiveObject)& anIObj,
                                                    Standard_Integer& TheIndex) const 
 {
   if(anIObj.IsNull()) return Standard_False;