1 // Created on: 1997-01-29
2 // Created by: Robert COUBLANC
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <AIS_DataMapIteratorOfDataMapOfILC.hxx>
19 #include <AIS_DataMapIteratorOfDataMapOfIOStatus.hxx>
20 #include <AIS_GlobalStatus.hxx>
21 #include <AIS_InteractiveContext.hxx>
22 #include <AIS_InteractiveObject.hxx>
23 #include <AIS_LocalContext.hxx>
24 #include <AIS_Selection.hxx>
25 #include <Graphic3d_MapIteratorOfMapOfStructure.hxx>
26 #include <Graphic3d_MapOfStructure.hxx>
27 #include <Graphic3d_Structure.hxx>
28 #include <Graphic3d_StructureManager.hxx>
29 #include <Prs3d_BasicAspect.hxx>
30 #include <Prs3d_LineAspect.hxx>
31 #include <Quantity_Color.hxx>
32 #include <SelectMgr_EntityOwner.hxx>
33 #include <SelectMgr_Filter.hxx>
34 #include <SelectMgr_OrFilter.hxx>
35 #include <SelectMgr_SelectionManager.hxx>
36 #include <Standard_Transient.hxx>
37 #include <StdSelect_ViewerSelector3d.hxx>
38 #include <TCollection_AsciiString.hxx>
39 #include <TCollection_ExtendedString.hxx>
40 #include <TColStd_ListIteratorOfListOfInteger.hxx>
41 #include <TopLoc_Location.hxx>
42 #include <TopoDS_Shape.hxx>
43 #include <V3d_View.hxx>
44 #include <V3d_Viewer.hxx>
46 //=======================================================================
47 //function : OpenLocalContext
49 //=======================================================================
50 Standard_Integer AIS_InteractiveContext::
51 OpenLocalContext(const Standard_Boolean UseDisplayedObjects,
52 const Standard_Boolean AllowShapeDecomposition,
53 const Standard_Boolean AcceptEraseOfTemporary,
54 const Standard_Boolean /*BothViewers*/)
57 // the entities eventually detected just before the context was opened are unhighlighted...
58 if(!IsSelected(myLastPicked)){
59 if(!myLastPicked.IsNull()){
60 const Handle(AIS_InteractiveObject) aLastPickedAIS = Handle(AIS_InteractiveObject)::DownCast (myLastPicked->Selectable());
61 unhighlightGlobal (aLastPickedAIS);
64 if(!mylastmoveview.IsNull()){
66 myLocalContexts(myCurLocalIndex)->UnhilightLastDetected(mylastmoveview);
69 // entities connected to dynamic selection at neutral point are set to 0.
71 myLastinMain.Nullify();
72 myLastPicked.Nullify();
73 myWasLastMain = Standard_True;
75 Standard_DISABLE_DEPRECATION_WARNINGS
76 myCurLocalIndex = HighestIndex() + 1;
77 Standard_ENABLE_DEPRECATION_WARNINGS
79 Handle(AIS_LocalContext) NewLocal= new AIS_LocalContext(this,myCurLocalIndex,
81 AllowShapeDecomposition,
82 AcceptEraseOfTemporary);
83 // the AIS_LocalContext bind itself to myLocalContexts
84 // because procedures performed in AIS_LocalContext constructor
85 // already may access myLocalContexts(myCurLocalIndex) (like methods AIS_LocalContext::IsSelected()).
88 cout<<"\tOpen Local Context No "<<myCurLocalIndex<<endl;
89 if(UseDisplayedObjects){
90 cout<<"\t\tObjects from Neutral Point loaded"<<endl;
91 if(AllowShapeDecomposition)
92 cout<<"\t\tDecomposition Authorized for Loaded Shapes"<<endl;
94 cout<<"\t\tNo Decomposition Authorized for Loaded Shapes"<<endl;
97 cout<<"\t\tNo Objects Were Loaded "<<endl;
99 return myCurLocalIndex;
102 //=======================================================================
103 //function : CloseLocalContext
105 //=======================================================================
107 void AIS_InteractiveContext::CloseLocalContext(const Standard_Integer Index,
108 const Standard_Boolean updateviewer)
111 Standard_Boolean debugmode(Standard_False);
113 debugmode = Standard_True;
116 Standard_Integer GoodIndex = (Index ==-1) ? myCurLocalIndex : Index;
118 if(debugmode) cout<<"Call to CloseLocalContext - Index "<<GoodIndex<<endl;
119 if(!HasOpenedContext()){
120 if(debugmode) cout<<"\t But No Local Context is opened"<<endl;
123 if(!myLocalContexts.IsBound(GoodIndex)) {
124 if(debugmode) cout<<" Attempt to Close a non-existent Local Context"<<endl;
128 // the only open local context is closed...
129 if(myLocalContexts.Extent()==1 && GoodIndex == myCurLocalIndex){
131 myLocalContexts(myCurLocalIndex)->Terminate( updateviewer );
132 myLocalContexts.UnBind(myCurLocalIndex);
135 ResetOriginalState(Standard_False);
137 cout<<"No More Opened Local Context "<<endl;
140 // Otherwise the local context will be still open after the current is closed
142 Handle(StdSelect_ViewerSelector3d) VS = myLocalContexts(GoodIndex)->MainSelector();
143 myLocalContexts(GoodIndex)->Terminate();
144 myLocalContexts.UnBind(GoodIndex);
145 // the current is closed...
146 if(GoodIndex==myCurLocalIndex){
147 Standard_DISABLE_DEPRECATION_WARNINGS
148 myCurLocalIndex = HighestIndex();
149 Standard_ENABLE_DEPRECATION_WARNINGS
152 cout<<"a No Current Local Context WasClosed"<<endl;
154 // restore activated selections of current local context
155 myLocalContexts (myCurLocalIndex)->RestoreActivatedModes();
157 if(debugmode) cout<<"Index Of CurrentLocalContext:"<<myCurLocalIndex<<endl;
162 if(updateviewer) myMainVwr->Update();
165 //=======================================================================
166 //function : CloseAllContexts
168 //=======================================================================
169 Standard_DISABLE_DEPRECATION_WARNINGS
170 void AIS_InteractiveContext::CloseAllContexts(const Standard_Boolean updateviewer)
172 while(!myLocalContexts.IsEmpty()){
173 CloseLocalContext(myCurLocalIndex,Standard_False);
176 ResetOriginalState(Standard_False);
178 if(updateviewer) myMainVwr->Update();
180 Standard_ENABLE_DEPRECATION_WARNINGS
182 //=======================================================================
183 //function : IndexOfCurrentLocal
185 //=======================================================================
187 Standard_Integer AIS_InteractiveContext::IndexOfCurrentLocal() const
189 return myCurLocalIndex;
192 //=======================================================================
193 //function : ClearLocalContext
195 //=======================================================================
197 void AIS_InteractiveContext::ClearLocalContext(const AIS_ClearMode aMode)
199 if (!HasOpenedContext()) return;
200 myLocalContexts(myCurLocalIndex)->Clear(aMode);
204 //=======================================================================
205 //function : HighestIndex
207 //=======================================================================
209 Standard_Integer AIS_InteractiveContext::HighestIndex() const
211 AIS_DataMapIteratorOfDataMapOfILC It(myLocalContexts);
212 Standard_Integer HiInd = 0;
213 for(;It.More();It.Next())
214 HiInd = (It.Key()>HiInd) ? It.Key() : HiInd;
220 //=======================================================================
221 //function : Activate
223 //=======================================================================
225 void AIS_InteractiveContext::
226 Activate(const Handle(AIS_InteractiveObject)& anIObj,
227 const Standard_Integer aMode,
228 const Standard_Boolean theIsForce)
230 if(!HasOpenedContext()){
231 if(!myObjects.IsBound(anIObj)) return;
232 const Handle(AIS_GlobalStatus)& STAT = myObjects(anIObj);
233 if(STAT->GraphicStatus()==AIS_DS_Displayed || theIsForce)
234 mgrSelector->Activate(anIObj,aMode,myMainSel);
235 STAT ->AddSelectionMode(aMode);
238 myLocalContexts(myCurLocalIndex)->ActivateMode(anIObj,aMode);
242 // ============================================================================
243 // function : Activate
245 // ============================================================================
246 void AIS_InteractiveContext::Activate (const Standard_Integer theMode,
247 const Standard_Boolean theIsForce)
249 AIS_ListOfInteractive aDisplayedObjects;
250 DisplayedObjects (aDisplayedObjects);
252 for (AIS_ListIteratorOfListOfInteractive anIter (aDisplayedObjects); anIter.More(); anIter.Next())
254 Load (anIter.Value(), -1, Standard_True);
255 Activate (anIter.Value(), theMode, theIsForce);
260 //=======================================================================
261 //function : LocalSelector
263 //=======================================================================
264 Handle( StdSelect_ViewerSelector3d ) AIS_InteractiveContext::LocalSelector() const
266 if( !HasOpenedContext() )
267 return Handle( StdSelect_ViewerSelector3d )();
269 return myLocalContexts( myCurLocalIndex )->MainSelector();
273 //=======================================================================
274 //function : DeActivate
276 //=======================================================================
277 void AIS_InteractiveContext::
278 Deactivate(const Handle(AIS_InteractiveObject)& anIObj)
280 if(!HasOpenedContext()){
281 if(!myObjects.IsBound(anIObj)) return;
282 TColStd_ListIteratorOfListOfInteger ItL;
283 for(ItL.Initialize(myObjects(anIObj)->SelectionModes());
286 if(myObjects(anIObj)->GraphicStatus() == AIS_DS_Displayed)
287 mgrSelector->Deactivate(anIObj,ItL.Value(),myMainSel);
289 myObjects(anIObj)->ClearSelectionModes();
292 const Handle(AIS_LocalContext)& LC = myLocalContexts(myCurLocalIndex);
293 LC->Deactivate(anIObj);
297 //=======================================================================
298 //function : Deactivate
300 //=======================================================================
302 void AIS_InteractiveContext::Deactivate(const Handle(AIS_InteractiveObject)& anIObj,
303 const Standard_Integer aMode)
305 if(!HasOpenedContext()){
306 if(!myObjects.IsBound(anIObj)) return;
307 const Handle(AIS_GlobalStatus)& STAT = myObjects(anIObj);
309 if(STAT->GraphicStatus() == AIS_DS_Displayed)
310 mgrSelector->Deactivate(anIObj,aMode,myMainSel);
311 STAT->RemoveSelectionMode(aMode);
314 myLocalContexts(myCurLocalIndex)->DeactivateMode(anIObj,aMode);
318 // ============================================================================
319 // function : Deactivate
321 // ============================================================================
322 void AIS_InteractiveContext::Deactivate (const Standard_Integer theMode)
324 AIS_ListOfInteractive aDisplayedObjects;
325 DisplayedObjects (aDisplayedObjects);
327 for (AIS_ListIteratorOfListOfInteractive anIter (aDisplayedObjects); anIter.More(); anIter.Next())
329 Deactivate (anIter.Value(), theMode);
333 // ============================================================================
334 // function : Deactivate
336 // ============================================================================
337 void AIS_InteractiveContext::Deactivate()
339 AIS_ListOfInteractive aDisplayedObjects;
340 DisplayedObjects (aDisplayedObjects);
342 for (AIS_ListIteratorOfListOfInteractive anIter (aDisplayedObjects); anIter.More(); anIter.Next())
344 Deactivate (anIter.Value());
348 //=======================================================================
349 //function : ActivatedModes
351 //=======================================================================
353 void AIS_InteractiveContext::
354 ActivatedModes(const Handle(AIS_InteractiveObject)& anIObj,
355 TColStd_ListOfInteger& theList) const
357 TColStd_ListIteratorOfListOfInteger ItL;
358 if(!HasOpenedContext()){
359 if(myObjects.IsBound(anIObj)){
360 for(ItL.Initialize(myObjects(anIObj)->SelectionModes());
363 theList.Append(ItL.Value());
368 if(myLocalContexts(myCurLocalIndex)->IsIn(anIObj)){
369 for(ItL.Initialize(myLocalContexts(myCurLocalIndex)->SelectionModes(anIObj));
372 theList.Append(ItL.Value());
377 //=======================================================================
378 //function : SetShapeDecomposition
380 //=======================================================================
382 void AIS_InteractiveContext::SetShapeDecomposition(const Handle(AIS_InteractiveObject)& anIObj,
383 const Standard_Boolean StdModeSensitive)
385 if(!HasOpenedContext()) return;
386 myLocalContexts(myCurLocalIndex)->SetShapeDecomposition(anIObj,StdModeSensitive);
389 //=======================================================================
390 //function : SetTemporaryAttributes
392 //=======================================================================
394 void AIS_InteractiveContext::
395 SetTemporaryAttributes(const Handle(AIS_InteractiveObject)& /*anObj*/,
396 const Handle(Prs3d_Drawer)& /*aDrawer*/,
397 const Standard_Boolean /*updateviewer*/)
401 //=======================================================================
402 //function : SubIntensityOn
404 //=======================================================================
405 void AIS_InteractiveContext::
406 SubIntensityOn(const Handle(AIS_InteractiveObject)& anIObj,
407 const Standard_Boolean updateviewer)
409 if(!HasOpenedContext())
411 turnOnSubintensity (anIObj);
415 turnOnSubintensity (anIObj, -1, Standard_False);
416 myLocalContexts(myCurLocalIndex)->SubIntensityOn (anIObj);
422 //=======================================================================
423 //function : SubIntensityOff
425 //=======================================================================
427 void AIS_InteractiveContext::
428 SubIntensityOff(const Handle(AIS_InteractiveObject)& anIObj,
429 const Standard_Boolean updateviewer)
431 if(!HasOpenedContext()){
432 if(!myObjects.IsBound(anIObj))
434 const Handle(AIS_GlobalStatus)& GB=myObjects(anIObj);
435 if(!GB->IsSubIntensityOn())
437 GB->SubIntensityOff();
438 Standard_Boolean UpdMain(Standard_False);
440 if(GB->GraphicStatus() == AIS_DS_Displayed)
442 myMainPM->Unhighlight (anIObj);
443 UpdMain = Standard_True;
446 if(IsSelected(anIObj))
447 highlightSelected (anIObj->GlobalSelOwner());
455 const Handle(Prs3d_Drawer)& anObjSelStyle = getSelStyle (anIObj, anIObj->GlobalSelOwner());
456 if(myObjects.IsBound(anIObj)){
457 const Handle(AIS_GlobalStatus)& STAT = myObjects(anIObj);
458 STAT->SubIntensityOff();
459 myMainPM->Unhighlight (anIObj);
460 if (STAT->IsHilighted())
461 HilightWithColor (anIObj, anObjSelStyle, Standard_False);
464 myLocalContexts(myCurLocalIndex)->SubIntensityOff(anIObj);
465 if (IsSelected(anIObj))
466 HilightWithColor (anIObj, anObjSelStyle, Standard_False);
468 if(updateviewer) myMainVwr->Update();
472 //=======================================================================
473 //function : SubIntensityOn
474 //purpose : ALL THE DISPLAYED OBJECTS HAVE SUBINTENSITY...
475 //=======================================================================
476 void AIS_InteractiveContext::SubIntensityOn (const Standard_Boolean theIsToUpdateViewer)
478 if (!HasOpenedContext())
481 turnOnSubintensity();
483 if (theIsToUpdateViewer)
487 //=======================================================================
488 //function : SubIntensityOff
490 //=======================================================================
491 void AIS_InteractiveContext::SubIntensityOff(const Standard_Boolean updateviewer)
493 if(!HasOpenedContext()) return;
495 AIS_DataMapIteratorOfDataMapOfIOStatus It (myObjects);
496 for(;It.More();It.Next()){
497 const Handle(AIS_GlobalStatus)& STAT = It.Value();
498 if(STAT->IsSubIntensityOn())
499 STAT->SubIntensityOff();
500 myMainPM->Unhighlight (It.Key());
503 if(updateviewer) myMainVwr->Update();
506 //=======================================================================
507 //function : AddFilter
509 //=======================================================================
510 void AIS_InteractiveContext::AddFilter(const Handle(SelectMgr_Filter)& aFilter)
512 if(HasOpenedContext())
513 myLocalContexts(myCurLocalIndex)->AddFilter(aFilter);
515 myFilters->Add(aFilter);
518 //=======================================================================
519 //function : ActivateStandardMode
521 //=======================================================================
522 void AIS_InteractiveContext::ActivateStandardMode(const TopAbs_ShapeEnum aStandardActivation)
524 if(!HasOpenedContext()) return;
525 myLocalContexts(myCurLocalIndex)->ActivateStandardMode (aStandardActivation);
528 //=======================================================================
529 //function : DeActivateStandardMode
531 //=======================================================================
532 void AIS_InteractiveContext::DeactivateStandardMode(const TopAbs_ShapeEnum aStandardActivation)
534 if(!HasOpenedContext()) return;
535 myLocalContexts(myCurLocalIndex)->DeactivateStandardMode (aStandardActivation);
538 //=======================================================================
539 //function : RemoveFilter
541 //=======================================================================
542 void AIS_InteractiveContext::RemoveFilter(const Handle(SelectMgr_Filter)& aFilter)
544 if(HasOpenedContext())
545 myLocalContexts(myCurLocalIndex)->RemoveFilter (aFilter);
547 myFilters->Remove(aFilter);
550 //=======================================================================
551 //function : RemoveFilters
553 //=======================================================================
555 void AIS_InteractiveContext::RemoveFilters()
557 if(!HasOpenedContext())
560 myLocalContexts(myCurLocalIndex)->Clear(AIS_CM_Filters);
563 //=======================================================================
564 //function : ActivatedStandardModes
566 //=======================================================================
567 const TColStd_ListOfInteger& AIS_InteractiveContext::ActivatedStandardModes() const
569 return myLocalContexts(myCurLocalIndex)->StandardModes();
572 //=======================================================================
575 //=======================================================================
576 const SelectMgr_ListOfFilter& AIS_InteractiveContext::Filters() const
578 if(HasOpenedContext())
579 return myLocalContexts(myCurLocalIndex)->ListOfFilter();
580 return myFilters->StoredFilters();
583 //=======================================================================
584 //function : DisplayActiveSensitive
586 //=======================================================================
587 void AIS_InteractiveContext::DisplayActiveSensitive(const Handle(V3d_View)& aviou)
589 if(HasOpenedContext())
590 myLocalContexts(myCurLocalIndex)->DisplaySensitive(aviou);
592 myMainSel->DisplaySensitive(aviou);
594 //=======================================================================
595 //function : DisplayActiveSensitive
597 //=======================================================================
599 void AIS_InteractiveContext::DisplayActiveSensitive(const Handle(AIS_InteractiveObject)& anIObj,
600 const Handle(V3d_View)& aviou)
602 TColStd_ListIteratorOfListOfInteger It;
603 Handle(StdSelect_ViewerSelector3d) VS;
604 if(HasOpenedContext()){
605 const Handle(AIS_LocalContext)& LC = myLocalContexts(myCurLocalIndex);
606 if(!LC->IsIn(anIObj)) return;
607 It.Initialize(LC->SelectionModes(anIObj));
608 VS = LC->MainSelector();
611 if(!myObjects.IsBound(anIObj)) return;
612 It.Initialize(myObjects(anIObj)->SelectionModes());
617 for(;It.More();It.Next()){
618 const Handle(SelectMgr_Selection)& Sel = anIObj->Selection(It.Value());
619 VS->DisplaySensitive(Sel,anIObj->Transformation(), aviou,Standard_False);
624 //=======================================================================
625 //function : ClearActiveSensitive
627 //=======================================================================
628 void AIS_InteractiveContext::ClearActiveSensitive(const Handle(V3d_View)& aviou)
631 if(HasOpenedContext())
632 myLocalContexts(myCurLocalIndex)->ClearSensitive(aviou);
634 myMainSel->ClearSensitive(aviou);
637 //=======================================================================
638 //function : SetAutomaticHilight
640 //=======================================================================
641 void AIS_InteractiveContext::SetAutomaticHilight(const Standard_Boolean aStatus)
644 if(HasOpenedContext())
645 myLocalContexts(myCurLocalIndex)->SetAutomaticHilight(aStatus);
648 //=======================================================================
649 //function : AutomaticHilight
651 //=======================================================================
652 Standard_Boolean AIS_InteractiveContext::AutomaticHilight() const
654 if(HasOpenedContext())
655 return myLocalContexts(myCurLocalIndex)->AutomaticHilight();
656 return Standard_True;
659 //=======================================================================
660 //function : UseDisplayedObjects
662 //=======================================================================
664 void AIS_InteractiveContext::UseDisplayedObjects()
666 if(HasOpenedContext())
667 myLocalContexts(myCurLocalIndex)->LoadContextObjects();
670 //=======================================================================
671 //function : NotUseDisplayedObjects
673 //=======================================================================
675 void AIS_InteractiveContext::NotUseDisplayedObjects()
677 if(HasOpenedContext())
678 myLocalContexts(myCurLocalIndex)->UnloadContextObjects();
684 //=======================================================================
685 //function : PurgeDisplay
687 //=======================================================================
689 Standard_Integer AIS_InteractiveContext::PurgeDisplay()
691 if(HasOpenedContext()) return 0;
693 Standard_Integer NbStr = PurgeViewer(myMainVwr);
700 //=======================================================================
701 //function : PurgeViewer
703 //=======================================================================
704 Standard_Integer AIS_InteractiveContext::PurgeViewer(const Handle(V3d_Viewer)& Vwr)
706 Handle(Graphic3d_StructureManager) GSM = Vwr->StructureManager();
707 Standard_Integer NbCleared(0);
708 Graphic3d_MapOfStructure SOS;
709 GSM->DisplayedStructures(SOS);
711 Handle(Graphic3d_Structure) G;
712 for(Graphic3d_MapIteratorOfMapOfStructure It(SOS); It.More();It.Next()){
714 Standard_Address Add = G->Owner();
717 G->Clear();// it means that it is not referenced as a presentation of InterfactiveObject...
720 Handle(AIS_InteractiveObject) IO = (AIS_InteractiveObject*)Add;
721 if(!myObjects.IsBound(IO)){
729 //=======================================================================
730 //function : IsImmediateModeOn
732 //=======================================================================
734 Standard_Boolean AIS_InteractiveContext::IsImmediateModeOn() const
736 if(!HasOpenedContext()) return Standard_False;
737 return myLocalContexts(myCurLocalIndex)->IsImmediateModeOn();
740 //=======================================================================
741 //function : BeginImmediateDraw
743 //=======================================================================
745 Standard_Boolean AIS_InteractiveContext::BeginImmediateDraw()
747 return HasOpenedContext()
748 && myLocalContexts (myCurLocalIndex)->BeginImmediateDraw();
751 //=======================================================================
752 //function : ImmediateAdd
754 //=======================================================================
756 Standard_Boolean AIS_InteractiveContext::ImmediateAdd (const Handle(AIS_InteractiveObject)& theObj,
757 const Standard_Integer theMode)
759 return HasOpenedContext()
760 && myLocalContexts (myCurLocalIndex)->ImmediateAdd (theObj, theMode);
763 //=======================================================================
764 //function : EndImmediateDraw
766 //=======================================================================
768 Standard_Boolean AIS_InteractiveContext::EndImmediateDraw (const Handle(V3d_View)& theView)
770 return HasOpenedContext()
771 && myLocalContexts (myCurLocalIndex)->EndImmediateDraw (theView->Viewer());
774 //=======================================================================
775 //function : EndImmediateDraw
777 //=======================================================================
779 Standard_Boolean AIS_InteractiveContext::EndImmediateDraw()
781 if (!HasOpenedContext())
783 return Standard_False;
786 return myLocalContexts (myCurLocalIndex)->EndImmediateDraw (myMainVwr);
790 //=======================================================================
791 //function : ResetOriginalState
793 //=======================================================================
795 void AIS_InteractiveContext::ResetOriginalState(const Standard_Boolean updateviewer)
797 Standard_Boolean upd_main(Standard_False);
798 TColStd_ListIteratorOfListOfInteger itl;
799 myMainSel->ResetSelectionActivationStatus();
801 for (AIS_DataMapIteratorOfDataMapOfIOStatus it(myObjects);it.More();it.Next()){
802 const Handle(AIS_InteractiveObject)& iobj = it.Key();
803 const Handle(AIS_GlobalStatus)& STAT = it.Value();
804 switch(STAT->GraphicStatus()){
805 case AIS_DS_Displayed:{
806 upd_main = Standard_True;
809 myMainPM->Display (iobj, STAT->DisplayMode());
810 if(STAT->IsHilighted())
812 const Handle(Prs3d_Drawer)& aStyle = STAT->HilightStyle();
813 if (!aStyle.IsNull() && getSelStyle (iobj, iobj->GlobalSelOwner()) != aStyle)
814 HilightWithColor(iobj,aStyle,Standard_False);
817 for(itl.Initialize(STAT->SelectionModes());itl.More();itl.Next()){
819 mgrSelector->Activate(iobj,itl.Value(),myMainSel);
824 EraseGlobal(iobj,Standard_False);