0029781: Samples - Inspector tool - history tree model is not set into external callb...
authornds <nds@opencascade.com>
Thu, 17 May 2018 06:29:04 +0000 (09:29 +0300)
committerabv <abv@opencascade.com>
Wed, 23 May 2018 16:09:34 +0000 (19:09 +0300)
- AIS_InteractiveContex and VInspector_ViewModelHistory are set into VInspector_CallBack
- minor correction of displaySelectedPresentations () to Hide/Show(by popup menu) any AIS_InteractiveObject, not only AIS_Shape (e.g. AIS_Trihedron)

tools/VInspector/VInspector_Window.cxx

index 549be24..6e61cda 100644 (file)
@@ -310,6 +310,10 @@ bool VInspector_Window::Init (const NCollection_List<Handle(Standard_Transient)>
   if (!aCallBack.IsNull() && aCallBack != myCallBack)
   {
     myCallBack = aCallBack;
+    VInspector_ViewModelHistory* aHistoryModel = dynamic_cast<VInspector_ViewModelHistory*>
+      (myHistoryView->model());
+    myCallBack->SetContext(aContext);
+    myCallBack->SetHistoryModel(aHistoryModel);
   }
   return true;
 }
@@ -569,10 +573,9 @@ void VInspector_Window::displaySelectedPresentations(const bool theToDisplay)
 
   for (NCollection_List<Handle(AIS_InteractiveObject)>::Iterator anIOIt(aSelectedPresentations); anIOIt.More(); anIOIt.Next())
   {
-    Handle(AIS_InteractiveObject) aPresentation = Handle(AIS_Shape)::DownCast(anIOIt.Value());
-    if (aPresentation.IsNull())
-      continue;
-    if (theToDisplay) {
+    Handle(AIS_InteractiveObject) aPresentation = anIOIt.Value();
+    if (theToDisplay)
+    {
       aContext->Display(aPresentation, false);
       aContext->Load(aPresentation, -1, true);
     }