1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-18 14:27:39 +03:00

0027680: Visualization - AIS_InteractiveContext::Remove() should remove all presentation of the object

This commit is contained in:
isk
2016-08-01 15:30:40 +03:00
committed by bugmaster
parent 6d0e6be5a2
commit e2d7642f14
4 changed files with 23 additions and 21 deletions

View File

@@ -89,19 +89,31 @@ void PrsMgr_PresentationManager::Erase (const Handle(PrsMgr_PresentableObject)&
}
PrsMgr_Presentations& aPrsList = thePrsObj->Presentations();
for (Standard_Integer aPrsIter = 1; aPrsIter <= aPrsList.Length(); ++aPrsIter)
for (PrsMgr_Presentations::Iterator anIt (aPrsList); anIt.More();)
{
const PrsMgr_ModedPresentation& aModedPrs = aPrsList.Value (aPrsIter);
const Handle(PrsMgr_PresentationManager)& aPrsMgr = aModedPrs.Presentation()->PresentationManager();
if (theMode == aPrsList (aPrsIter).Mode()
&& this == aPrsMgr)
const PrsMgr_ModedPresentation& aModedPrs = anIt.Value();
if (aModedPrs.Presentation().IsNull())
{
if (!aModedPrs.Presentation().IsNull())
anIt.Next();
continue;
}
const Handle(PrsMgr_PresentationManager)& aPrsMgr = aModedPrs.Presentation()->PresentationManager();
if ((theMode == aModedPrs.Mode() || theMode == -1)
&& (this == aPrsMgr))
{
aModedPrs.Presentation()->Erase();
aPrsList.Remove (anIt);
if (theMode != -1)
{
aModedPrs.Presentation()->Erase();
return;
}
aPrsList.Remove (aPrsIter);
return;
}
else
{
anIt.Next();
}
}
}

View File

@@ -59,6 +59,7 @@ public:
//! erases the presentation of the object in the given
//! Presentation manager with the given mode.
//! If @theMode is -1, then erases all presentations of the object.
Standard_EXPORT void Erase (const Handle(PrsMgr_PresentableObject)& thePrsObject, const Standard_Integer theMode = 0);