]> OCCT Git - occt-copy.git/commitdiff
0028888: Visualization - AIS_InteractiveContext should not hold V3d_View handle which...
authorkgv <kgv@opencascade.com>
Tue, 4 Jul 2017 11:15:34 +0000 (14:15 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 6 Jul 2017 09:42:02 +0000 (12:42 +0300)
src/AIS/AIS_InteractiveContext.hxx
src/AIS/AIS_InteractiveContext_1.cxx
src/AIS/AIS_InteractiveContext_2.cxx
src/AIS/AIS_LocalContext.hxx
src/AIS/AIS_LocalContext_1.cxx

index d9b070a5a9496116603b4a5ce6d49e3f5e9b622e..59b0524b7da2fc1f4c2d93fce8ad5e0ace33ce10 100644 (file)
@@ -1863,7 +1863,6 @@ protected:
   Handle(Prs3d_Drawer) myStyles[Prs3d_TypeOfHighlight_NB];
   AIS_DataMapOfILC myLocalContexts;
   Standard_Integer myCurLocalIndex;
-  Handle(V3d_View) mylastmoveview;
   TColStd_SequenceOfInteger myDetectedSeq;
   Standard_Integer myCurDetected;
   Standard_Integer myCurHighlighted;
index 778808727f68647278a1c1100f22f247948eeb4c..e83a397efc46c30c5581b91aa1e44cc04e79e730 100644 (file)
@@ -422,7 +422,6 @@ AIS_StatusOfDetection AIS_InteractiveContext::MoveTo (const Standard_Integer  th
     theView->Viewer()->Update();
   }
 
-  mylastmoveview = theView;
   return aStatus;
 }
 
index 48334f47edf331a7d0008da34abe96e9b0f48612..b62d0a5c75758e6db433da67b2463e2b9e35f76f 100644 (file)
@@ -60,12 +60,12 @@ OpenLocalContext(const Standard_Boolean UseDisplayedObjects,
       const Handle(AIS_InteractiveObject) aLastPickedAIS = Handle(AIS_InteractiveObject)::DownCast (myLastPicked->Selectable());
       unhighlightGlobal (aLastPickedAIS);
     }}
-  
-  if(!mylastmoveview.IsNull()){
-    if(myCurLocalIndex>0)
-      myLocalContexts(myCurLocalIndex)->UnhilightLastDetected(mylastmoveview);
+
+  if (myCurLocalIndex > 0)
+  {
+    myLocalContexts (myCurLocalIndex)->UnhilightLastDetected (myMainVwr);
   }
-  
+
   // entities connected to dynamic selection at neutral point are set to 0.
   
   myLastinMain.Nullify();
index 90e6ec60711242a37da6a5dae40fb9c0bbf0962b..3b2a79671cccbb33024950598ca3cb08cb0cd64d 100644 (file)
@@ -164,7 +164,10 @@ public:
   Standard_EXPORT Standard_Integer HilightPreviousDetected (const Handle(V3d_View)& theView, const Standard_Boolean theToRedrawImmediate);
   
   //! returns True if something was done...
-  Standard_EXPORT Standard_Boolean UnhilightLastDetected (const Handle(V3d_View)& aView);
+  Standard_EXPORT Standard_Boolean UnhilightLastDetected (const Handle(V3d_Viewer)& theViewer);
+
+  //! returns True if something was done...
+  Standard_EXPORT Standard_Boolean UnhilightLastDetected (const Handle(V3d_View)& theView);
   
   //! returns the number of selected
   Standard_EXPORT AIS_StatusOfPick AddSelect (const Handle(SelectMgr_EntityOwner)& theObject);
index d2cb07c8452124d89024ac451812e8953775a706..7b83743cfe268e5f019f36f39f8eb5b32f813678 100644 (file)
@@ -1362,6 +1362,15 @@ Standard_Integer AIS_LocalContext::HilightPreviousDetected (const Handle(V3d_Vie
 //purpose  :
 //=======================================================================
 Standard_Boolean AIS_LocalContext::UnhilightLastDetected (const Handle(V3d_View)& theView)
+{
+  return UnhilightLastDetected (theView->Viewer());
+}
+
+//=======================================================================
+//function : UnhilightLastDetected
+//purpose  :
+//=======================================================================
+Standard_Boolean AIS_LocalContext::UnhilightLastDetected (const Handle(V3d_Viewer)& theViewer)
 {
   if (!IsValidIndex (mylastindex))
   {
@@ -1371,7 +1380,7 @@ Standard_Boolean AIS_LocalContext::UnhilightLastDetected (const Handle(V3d_View)
   myMainPM->BeginImmediateDraw();
   const Handle(SelectMgr_EntityOwner)& anOwner = myMapOfOwner->FindKey (mylastindex);
   anOwner->Unhilight (myMainPM);
-  myMainPM->EndImmediateDraw (theView->Viewer());
+  myMainPM->EndImmediateDraw (theViewer);
   mylastindex = 0;
   return Standard_True;
 }