0028463: OCAF loses an interactive object after copying
authorvro <vro@opencascade.com>
Thu, 16 Feb 2017 13:03:56 +0000 (16:03 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 2 Mar 2017 09:31:51 +0000 (12:31 +0300)
src/TPrsStd/TPrsStd_AISPresentation.cxx

index 5745080..f64a36a 100644 (file)
@@ -640,6 +640,18 @@ void TPrsStd_AISPresentation::Paste (const Handle(TDF_Attribute)& theInto,
     Handle(TPrsStd_AISPresentation)::DownCast(theInto);
 
   anInto->Backup();
+  if (!anInto->myAIS.IsNull())
+  {
+    // Save displayed flag.
+    Standard_Boolean displayed = anInto->IsDisplayed();
+    // Erase the interactive object.
+    anInto->AISErase(Standard_True);
+    // Restore the displayed flag.
+    if (displayed)
+      anInto->SetDisplayed(displayed);
+  }
+  // Nullify the interactive object.
+  // It will be restored on the next call to AISUpdate().
   anInto->myAIS.Nullify();
 }