From: vro Date: Thu, 16 Feb 2017 13:03:56 +0000 (+0300) Subject: 0028463: OCAF loses an interactive object after copying X-Git-Tag: V7_2_0_beta~245 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=b66f3758694198628c482e5a6c76fa632e6146cb;p=occt-copy.git 0028463: OCAF loses an interactive object after copying --- 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(); }