- if(anIObj.IsNull()) return;
-
- Standard_Integer DispMode,HiMod,SelMode;
-
- GetDefModes(anIObj,DispMode,HiMod,SelMode);
-
- Handle (AIS_InteractiveContext) aThis = this;
- if(!anIObj->HasInteractiveContext())
- anIObj->SetContext(aThis);
-
- //NO LOCAL CONTEXT OPEN
- if(!HasOpenedContext()) {
-#ifndef OCC4373
- // SAN : Do not return here. Perform advanced display mode analysis a bit later...
- if(IsDisplayed(anIObj)) return;
-#endif
-
- // it did not yet exist
- if(!myObjects.IsBound(anIObj)){
-
- Handle(AIS_GlobalStatus) STATUS=
-#ifdef OCC166
- new AIS_GlobalStatus(AIS_DS_Displayed,DispMode,SelMode);
-#else
- new AIS_GlobalStatus(AIS_DS_Displayed,DispMode,0);
-#endif
- myObjects.Bind (anIObj,STATUS);
- myMainPM->Display(anIObj,DispMode);
- if( myIsAutoActivateSelMode )
- {
- if(!mgrSelector->Contains(anIObj))
- mgrSelector->Load(anIObj);
- mgrSelector->Activate(anIObj,SelMode,myMainSel);
- }
-
- if(updateviewer) myMainVwr->Update();
- }
- // it is somewhere else...
- else {
- // CLE
- // const Handle(AIS_GlobalStatus)& STATUS = myObjects(anIObj);
- Handle(AIS_GlobalStatus) STATUS = myObjects(anIObj);
- // ENDCLE
- if (STATUS->GraphicStatus() == AIS_DS_Displayed || STATUS->GraphicStatus() == AIS_DS_Erased)
- {
- // SAN : erase presentations for all display modes different from <DispMode>;
- // then make sure <DispMode> is displayed and maybe highlighted;
- // Finally, activate selection mode <SelMode> if not yet activated.
- TColStd_ListOfInteger aModesToRemove;
- TColStd_ListIteratorOfListOfInteger ItL (STATUS->DisplayedModes());
- for(;ItL.More();ItL.Next()){
-
- Standard_Integer OldMode = ItL.Value();
-
- if(OldMode!=DispMode){
- aModesToRemove.Append(OldMode);
- if(myMainPM->IsHighlighted(anIObj,OldMode))
- myMainPM->Unhighlight(anIObj,OldMode);
- myMainPM->Erase(anIObj,OldMode);
- }
- }