Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
unhighlightOwners (theIObj);
- for (TColStd_ListIteratorOfListOfInteger aDispModeIter (aStatus->DisplayedModes()); aDispModeIter.More(); aDispModeIter.Next())
- {
- myMainPM->Erase (theIObj, aDispModeIter.Value());
- myMainPM->Clear (theIObj, aDispModeIter.Value());
- }
- if (aStatus->IsHilighted()
- && theIObj->HasHilightMode())
- {
- myMainPM->Unhighlight (theIObj, theIObj->HilightMode());
- }
+ myMainPM->Erase (theIObj, -1);
// Object removes from Detected sequence
for(Standard_Integer aDetIter = 1; aDetIter < myAISDetectedSeq.Length(); ++aDetIter)
}
myMainPM->Erase (theIObj, theMode);
- myMainPM->Clear (theIObj, theMode);
}
if (aStatus->GraphicStatus() == AIS_DS_Displayed
}
myMainPM->Erase (aSelectable, Att->DisplayMode());
- myMainPM->Clear (aSelectable, Att->DisplayMode());
if (myMainPM->IsDisplayed (aSelectable, Att->HilightMode()))
{
myMainPM->Erase (aSelectable, Att->HilightMode());
}
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())
+ {
+ anIt.Next();
+ continue;
+ }
+
+ const Handle(PrsMgr_PresentationManager)& aPrsMgr = aModedPrs.Presentation()->PresentationManager();
+ if ((theMode == aModedPrs.Mode() || theMode == -1)
+ && (this == aPrsMgr))
{
- if (!aModedPrs.Presentation().IsNull())
+ aModedPrs.Presentation()->Erase();
+
+ aPrsList.Remove (anIt);
+
+ if (theMode != -1)
{
- aModedPrs.Presentation()->Erase();
+ return;
}
- aPrsList.Remove (aPrsIter);
- return;
+ }
+ else
+ {
+ anIt.Next();
}
}
}
//! 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);