From b66f3758694198628c482e5a6c76fa632e6146cb Mon Sep 17 00:00:00 2001 From: vro Date: Thu, 16 Feb 2017 16:03:56 +0300 Subject: [PATCH] 0028463: OCAF loses an interactive object after copying --- src/TPrsStd/TPrsStd_AISPresentation.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/TPrsStd/TPrsStd_AISPresentation.cxx b/src/TPrsStd/TPrsStd_AISPresentation.cxx index 5745080b08..f64a36a7ae 100644 --- a/src/TPrsStd/TPrsStd_AISPresentation.cxx +++ b/src/TPrsStd/TPrsStd_AISPresentation.cxx @@ -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(); }