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 =
61 Handle(AIS_InteractiveObject)::DownCast (myLastPicked->Selectable());
62 Standard_Integer HiMod = aLastPickedAIS->HasHilightMode()?aLastPickedAIS->HilightMode():0;
63 myMainPM->Unhighlight (aLastPickedAIS, HiMod);
66 if(!mylastmoveview.IsNull()){
68 myLocalContexts(myCurLocalIndex)->UnhilightLastDetected(mylastmoveview);
71 // entities connected to dynamic selection at neutral point are set to 0.
73 myLastinMain.Nullify();
74 myLastPicked.Nullify();
75 myWasLastMain = Standard_True;
77 myCurLocalIndex = HighestIndex() + 1;
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 myCurLocalIndex = HighestIndex();
150 cout<<"a No Current Local Context WasClosed"<<endl;
152 // restore activated selections of current local context
153 myLocalContexts (myCurLocalIndex)->RestoreActivatedModes();
155 if(debugmode) cout<<"Index Of CurrentLocalContext:"<<myCurLocalIndex<<endl;
160 if(updateviewer) myMainVwr->Update();
163 //=======================================================================
164 //function : CloseAllContexts
166 //=======================================================================
168 void AIS_InteractiveContext::CloseAllContexts(const Standard_Boolean updateviewer)
171 while(!myLocalContexts.IsEmpty()){
172 CloseLocalContext(myCurLocalIndex,Standard_False);
175 ResetOriginalState(Standard_False);
177 if(updateviewer) myMainVwr->Update();
180 //=======================================================================
181 //function : IndexOfCurrentLocal
183 //=======================================================================
185 Standard_Integer AIS_InteractiveContext::IndexOfCurrentLocal() const
187 return myCurLocalIndex;
190 //=======================================================================
191 //function : ClearLocalContext
193 //=======================================================================
195 void AIS_InteractiveContext::ClearLocalContext(const AIS_ClearMode aMode)
197 if (!HasOpenedContext()) return;
198 myLocalContexts(myCurLocalIndex)->Clear(aMode);
202 //=======================================================================
203 //function : HighestIndex
205 //=======================================================================
207 Standard_Integer AIS_InteractiveContext::HighestIndex() const
209 AIS_DataMapIteratorOfDataMapOfILC It(myLocalContexts);
210 Standard_Integer HiInd = 0;
211 for(;It.More();It.Next())
212 HiInd = (It.Key()>HiInd) ? It.Key() : HiInd;
218 //=======================================================================
219 //function : Activate
221 //=======================================================================
223 void AIS_InteractiveContext::
224 Activate(const Handle(AIS_InteractiveObject)& anIObj,
225 const Standard_Integer aMode,
226 const Standard_Boolean theIsForce)
228 if(!HasOpenedContext()){
229 if(!myObjects.IsBound(anIObj)) return;
230 const Handle(AIS_GlobalStatus)& STAT = myObjects(anIObj);
231 if(STAT->GraphicStatus()==AIS_DS_Displayed || theIsForce)
232 mgrSelector->Activate(anIObj,aMode,myMainSel);
233 STAT ->AddSelectionMode(aMode);
236 myLocalContexts(myCurLocalIndex)->ActivateMode(anIObj,aMode);
240 //=======================================================================
241 //function : LocalSelector
243 //=======================================================================
244 Handle( StdSelect_ViewerSelector3d ) AIS_InteractiveContext::LocalSelector() const
246 if( !HasOpenedContext() )
247 return Handle( StdSelect_ViewerSelector3d )();
249 return myLocalContexts( myCurLocalIndex )->MainSelector();
253 //=======================================================================
254 //function : DeActivate
256 //=======================================================================
257 void AIS_InteractiveContext::
258 Deactivate(const Handle(AIS_InteractiveObject)& anIObj)
260 if(!HasOpenedContext()){
261 if(!myObjects.IsBound(anIObj)) return;
262 TColStd_ListIteratorOfListOfInteger ItL;
263 for(ItL.Initialize(myObjects(anIObj)->SelectionModes());
266 if(myObjects(anIObj)->GraphicStatus() == AIS_DS_Displayed)
267 mgrSelector->Deactivate(anIObj,ItL.Value(),myMainSel);
269 myObjects(anIObj)->ClearSelectionModes();
272 const Handle(AIS_LocalContext)& LC = myLocalContexts(myCurLocalIndex);
273 LC->Deactivate(anIObj);
277 //=======================================================================
278 //function : Deactivate
280 //=======================================================================
282 void AIS_InteractiveContext::Deactivate(const Handle(AIS_InteractiveObject)& anIObj,
283 const Standard_Integer aMode)
285 if(!HasOpenedContext()){
286 if(!myObjects.IsBound(anIObj)) return;
287 const Handle(AIS_GlobalStatus)& STAT = myObjects(anIObj);
289 if(STAT->GraphicStatus() == AIS_DS_Displayed)
290 mgrSelector->Deactivate(anIObj,aMode,myMainSel);
291 STAT->RemoveSelectionMode(aMode);
294 myLocalContexts(myCurLocalIndex)->DeactivateMode(anIObj,aMode);
298 //=======================================================================
299 //function : ActivatedModes
301 //=======================================================================
303 void AIS_InteractiveContext::
304 ActivatedModes(const Handle(AIS_InteractiveObject)& anIObj,
305 TColStd_ListOfInteger& theList) const
307 TColStd_ListIteratorOfListOfInteger ItL;
308 if(!HasOpenedContext()){
309 if(myObjects.IsBound(anIObj)){
310 for(ItL.Initialize(myObjects(anIObj)->SelectionModes());
313 theList.Append(ItL.Value());
318 if(myLocalContexts(myCurLocalIndex)->IsIn(anIObj)){
319 for(ItL.Initialize(myLocalContexts(myCurLocalIndex)->SelectionModes(anIObj));
322 theList.Append(ItL.Value());
327 //=======================================================================
328 //function : SetShapeDecomposition
330 //=======================================================================
332 void AIS_InteractiveContext::SetShapeDecomposition(const Handle(AIS_InteractiveObject)& anIObj,
333 const Standard_Boolean StdModeSensitive)
335 if(!HasOpenedContext()) return;
336 myLocalContexts(myCurLocalIndex)->SetShapeDecomposition(anIObj,StdModeSensitive);
339 //=======================================================================
340 //function : SetTemporaryAttributes
342 //=======================================================================
344 void AIS_InteractiveContext::
345 SetTemporaryAttributes(const Handle(AIS_InteractiveObject)& /*anObj*/,
346 const Handle(Prs3d_Drawer)& /*aDrawer*/,
347 const Standard_Boolean /*updateviewer*/)
351 //=======================================================================
352 //function : SubIntensityOn
354 //=======================================================================
355 void AIS_InteractiveContext::
356 SubIntensityOn(const Handle(AIS_InteractiveObject)& anIObj,
357 const Standard_Boolean updateviewer)
359 if(!HasOpenedContext()){
360 if(!myObjects.IsBound(anIObj))
362 const Handle(AIS_GlobalStatus)& GB=myObjects(anIObj);
363 if(GB->IsSubIntensityOn())
365 GB->SubIntensityOn();
366 Standard_Boolean UpdMain(Standard_False);
368 for(TColStd_ListIteratorOfListOfInteger It(GB->DisplayedModes());It.More();It.Next()){
369 if (GB->GraphicStatus()==AIS_DS_Displayed)
371 myMainPM->Color(anIObj,mySubIntensity,It.Value());
372 UpdMain = Standard_True;
381 if(myObjects.IsBound(anIObj)){
382 const Handle(AIS_GlobalStatus)& STAT = myObjects(anIObj);
383 STAT->SubIntensityOn();
384 TColStd_ListIteratorOfListOfInteger ItL;
385 for (ItL.Initialize(STAT->DisplayedModes());ItL.More();ItL.Next())
386 myMainPM->Color(anIObj,mySubIntensity,ItL.Value());
389 myLocalContexts(myCurLocalIndex)->SubIntensityOn(anIObj);
391 if(updateviewer) myMainVwr->Update();
394 //=======================================================================
395 //function : SubIntensityOff
397 //=======================================================================
399 void AIS_InteractiveContext::
400 SubIntensityOff(const Handle(AIS_InteractiveObject)& anIObj,
401 const Standard_Boolean updateviewer)
403 if(!HasOpenedContext()){
404 if(!myObjects.IsBound(anIObj))
406 const Handle(AIS_GlobalStatus)& GB=myObjects(anIObj);
407 if(!GB->IsSubIntensityOn())
409 GB->SubIntensityOff();
410 Standard_Boolean UpdMain(Standard_False);
412 for(TColStd_ListIteratorOfListOfInteger It(GB->DisplayedModes());It.More();It.Next()){
413 if(GB->GraphicStatus()==AIS_DS_Displayed)
415 myMainPM->Unhighlight(anIObj,It.Value());
416 UpdMain = Standard_True;
420 Standard_Integer DM,HM,SM;
421 GetDefModes(anIObj,DM,HM,SM);
422 if(AIS_Selection::IsSelected(anIObj))
423 myMainPM->Highlight(anIObj,HM);
431 if(myObjects.IsBound(anIObj)){
432 const Handle(AIS_GlobalStatus)& STAT = myObjects(anIObj);
433 STAT->SubIntensityOff();
434 TColStd_ListIteratorOfListOfInteger ItL;
435 for (ItL.Initialize(STAT->DisplayedModes());ItL.More();ItL.Next())
436 myMainPM->Unhighlight(anIObj,ItL.Value());
437 if(STAT->IsHilighted())
441 myLocalContexts(myCurLocalIndex)->SubIntensityOff(anIObj);
442 if(IsSelected(anIObj))
445 if(updateviewer) myMainVwr->Update();
449 //=======================================================================
450 //function : SubIntensityOn
451 //purpose : ALL THE DISPLAYED OBJECTS HAVE SUBINTENSITY...
452 //=======================================================================
454 void AIS_InteractiveContext::SubIntensityOn(const Standard_Boolean updateviewer)
456 if(!HasOpenedContext()) return;
458 AIS_DataMapIteratorOfDataMapOfIOStatus It (myObjects);
459 TColStd_ListIteratorOfListOfInteger ItM;
460 for(;It.More();It.Next()){
461 const Handle(AIS_GlobalStatus)& STAT = It.Value();
462 if(STAT->GraphicStatus()==AIS_DS_Displayed)
464 STAT->SubIntensityOn();
465 for(ItM.Initialize(STAT->DisplayedModes());ItM.More();ItM.Next())
466 {myMainPM->Color(It.Key(),mySubIntensity,ItM.Value());}
469 if(updateviewer) myMainVwr->Update();
472 //=======================================================================
473 //function : SubIntensityOff
475 //=======================================================================
476 void AIS_InteractiveContext::SubIntensityOff(const Standard_Boolean updateviewer)
478 if(!HasOpenedContext()) return;
480 AIS_DataMapIteratorOfDataMapOfIOStatus It (myObjects);
481 TColStd_ListIteratorOfListOfInteger ItL;
482 for(;It.More();It.Next()){
483 const Handle(AIS_GlobalStatus)& STAT = It.Value();
484 if(STAT->IsSubIntensityOn())
485 STAT->SubIntensityOff();
486 for(ItL.Initialize(STAT->DisplayedModes());ItL.More();ItL.Next())
487 myMainPM->Unhighlight(It.Key());
490 if(updateviewer) myMainVwr->Update();
493 //=======================================================================
494 //function : AddFilter
496 //=======================================================================
497 void AIS_InteractiveContext::AddFilter(const Handle(SelectMgr_Filter)& aFilter)
499 if(HasOpenedContext())
500 myLocalContexts(myCurLocalIndex)->AddFilter(aFilter);
502 myFilters->Add(aFilter);
505 //=======================================================================
506 //function : ActivateStandardMode
508 //=======================================================================
509 void AIS_InteractiveContext::ActivateStandardMode(const TopAbs_ShapeEnum aStandardActivation)
511 if(!HasOpenedContext()) return;
512 myLocalContexts(myCurLocalIndex)->ActivateStandardMode (aStandardActivation);
515 //=======================================================================
516 //function : DeActivateStandardMode
518 //=======================================================================
519 void AIS_InteractiveContext::DeactivateStandardMode(const TopAbs_ShapeEnum aStandardActivation)
521 if(!HasOpenedContext()) return;
522 myLocalContexts(myCurLocalIndex)->DeactivateStandardMode (aStandardActivation);
525 //=======================================================================
526 //function : RemoveFilter
528 //=======================================================================
529 void AIS_InteractiveContext::RemoveFilter(const Handle(SelectMgr_Filter)& aFilter)
531 if(HasOpenedContext())
532 myLocalContexts(myCurLocalIndex)->RemoveFilter (aFilter);
534 myFilters->Remove(aFilter);
537 //=======================================================================
538 //function : RemoveFilters
540 //=======================================================================
542 void AIS_InteractiveContext::RemoveFilters()
544 if(!HasOpenedContext())
547 myLocalContexts(myCurLocalIndex)->Clear(AIS_CM_Filters);
550 //=======================================================================
551 //function : ActivatedStandardModes
553 //=======================================================================
554 const TColStd_ListOfInteger& AIS_InteractiveContext::ActivatedStandardModes() const
556 return myLocalContexts(myCurLocalIndex)->StandardModes();
559 //=======================================================================
562 //=======================================================================
563 const SelectMgr_ListOfFilter& AIS_InteractiveContext::Filters() const
565 if(HasOpenedContext())
566 return myLocalContexts(myCurLocalIndex)->ListOfFilter();
567 return myFilters->StoredFilters();
570 //=======================================================================
571 //function : DisplayActiveSensitive
573 //=======================================================================
574 void AIS_InteractiveContext::DisplayActiveSensitive(const Handle(V3d_View)& aviou)
576 if(HasOpenedContext())
577 myLocalContexts(myCurLocalIndex)->DisplaySensitive(aviou);
579 myMainSel->DisplaySensitive(aviou);
581 //=======================================================================
582 //function : DisplayActiveSensitive
584 //=======================================================================
586 void AIS_InteractiveContext::DisplayActiveSensitive(const Handle(AIS_InteractiveObject)& anIObj,
587 const Handle(V3d_View)& aviou)
589 TColStd_ListIteratorOfListOfInteger It;
590 Handle(StdSelect_ViewerSelector3d) VS;
591 if(HasOpenedContext()){
592 const Handle(AIS_LocalContext)& LC = myLocalContexts(myCurLocalIndex);
593 if(!LC->IsIn(anIObj)) return;
594 It.Initialize(LC->SelectionModes(anIObj));
595 VS = LC->MainSelector();
598 if(!myObjects.IsBound(anIObj)) return;
599 It.Initialize(myObjects(anIObj)->SelectionModes());
604 for(;It.More();It.Next()){
605 const Handle(SelectMgr_Selection)& Sel = anIObj->Selection(It.Value());
606 VS->DisplaySensitive(Sel,anIObj->Transformation(), aviou,Standard_False);
611 //=======================================================================
612 //function : ClearActiveSensitive
614 //=======================================================================
615 void AIS_InteractiveContext::ClearActiveSensitive(const Handle(V3d_View)& aviou)
618 if(HasOpenedContext())
619 myLocalContexts(myCurLocalIndex)->ClearSensitive(aviou);
621 myMainSel->ClearSensitive(aviou);
624 //=======================================================================
625 //function : SetAutomaticHilight
627 //=======================================================================
628 void AIS_InteractiveContext::SetAutomaticHilight(const Standard_Boolean aStatus)
631 if(HasOpenedContext())
632 myLocalContexts(myCurLocalIndex)->SetAutomaticHilight(aStatus);
635 //=======================================================================
636 //function : AutomaticHilight
638 //=======================================================================
639 Standard_Boolean AIS_InteractiveContext::AutomaticHilight() const
641 if(HasOpenedContext())
642 return myLocalContexts(myCurLocalIndex)->AutomaticHilight();
643 return Standard_True;
646 //=======================================================================
647 //function : UseDisplayedObjects
649 //=======================================================================
651 void AIS_InteractiveContext::UseDisplayedObjects()
653 if(HasOpenedContext())
654 myLocalContexts(myCurLocalIndex)->LoadContextObjects();
657 //=======================================================================
658 //function : NotUseDisplayedObjects
660 //=======================================================================
662 void AIS_InteractiveContext::NotUseDisplayedObjects()
664 if(HasOpenedContext())
665 myLocalContexts(myCurLocalIndex)->UnloadContextObjects();
671 //=======================================================================
672 //function : PurgeDisplay
674 //=======================================================================
676 Standard_Integer AIS_InteractiveContext::PurgeDisplay()
678 if(HasOpenedContext()) return 0;
680 Standard_Integer NbStr = PurgeViewer(myMainVwr);
687 //=======================================================================
688 //function : PurgeViewer
690 //=======================================================================
691 Standard_Integer AIS_InteractiveContext::PurgeViewer(const Handle(V3d_Viewer)& Vwr)
693 Handle(Graphic3d_StructureManager) GSM = Vwr->StructureManager();
694 Standard_Integer NbCleared(0);
695 Graphic3d_MapOfStructure SOS;
696 GSM->DisplayedStructures(SOS);
698 Handle(Graphic3d_Structure) G;
699 for(Graphic3d_MapIteratorOfMapOfStructure It(SOS); It.More();It.Next()){
701 Standard_Address Add = G->Owner();
704 G->Clear();// it means that it is not referenced as a presentation of InterfactiveObject...
707 Handle(AIS_InteractiveObject) IO = (AIS_InteractiveObject*)Add;
708 if(!myObjects.IsBound(IO)){
716 //=======================================================================
717 //function : IsImmediateModeOn
719 //=======================================================================
721 Standard_Boolean AIS_InteractiveContext::IsImmediateModeOn() const
723 if(!HasOpenedContext()) return Standard_False;
724 return myLocalContexts(myCurLocalIndex)->IsImmediateModeOn();
727 //=======================================================================
728 //function : BeginImmediateDraw
730 //=======================================================================
732 Standard_Boolean AIS_InteractiveContext::BeginImmediateDraw()
734 return HasOpenedContext()
735 && myLocalContexts (myCurLocalIndex)->BeginImmediateDraw();
738 //=======================================================================
739 //function : ImmediateAdd
741 //=======================================================================
743 Standard_Boolean AIS_InteractiveContext::ImmediateAdd (const Handle(AIS_InteractiveObject)& theObj,
744 const Standard_Integer theMode)
746 return HasOpenedContext()
747 && myLocalContexts (myCurLocalIndex)->ImmediateAdd (theObj, theMode);
750 //=======================================================================
751 //function : EndImmediateDraw
753 //=======================================================================
755 Standard_Boolean AIS_InteractiveContext::EndImmediateDraw (const Handle(V3d_View)& theView)
757 return HasOpenedContext()
758 && myLocalContexts (myCurLocalIndex)->EndImmediateDraw (theView->Viewer());
761 //=======================================================================
762 //function : EndImmediateDraw
764 //=======================================================================
766 Standard_Boolean AIS_InteractiveContext::EndImmediateDraw()
768 if (!HasOpenedContext())
770 return Standard_False;
773 myMainVwr->InitActiveViews();
774 if (!myMainVwr->MoreActiveViews())
776 return Standard_False;
779 Handle(V3d_View) aView = myMainVwr->ActiveView();
780 return myLocalContexts (myCurLocalIndex)->EndImmediateDraw (aView->Viewer());
784 //=======================================================================
785 //function : ResetOriginalState
787 //=======================================================================
789 void AIS_InteractiveContext::ResetOriginalState(const Standard_Boolean updateviewer)
791 Standard_Boolean upd_main(Standard_False);
792 TColStd_ListIteratorOfListOfInteger itl;
793 myMainSel->ResetSelectionActivationStatus();
795 for (AIS_DataMapIteratorOfDataMapOfIOStatus it(myObjects);it.More();it.Next()){
796 const Handle(AIS_InteractiveObject)& iobj = it.Key();
797 const Handle(AIS_GlobalStatus)& STAT = it.Value();
798 switch(STAT->GraphicStatus()){
799 case AIS_DS_Displayed:{
800 upd_main = Standard_True;
803 for(itl.Initialize(STAT->DisplayedModes());itl.More();itl.Next())
804 myMainPM->Display(iobj,itl.Value());
805 if(STAT->IsHilighted()){
806 if(STAT->HilightColor()!=Quantity_NOC_WHITE)
807 HilightWithColor(iobj,STAT->HilightColor(),Standard_False);
809 Hilight(iobj,Standard_False);
812 for(itl.Initialize(STAT->SelectionModes());itl.More();itl.Next()){
814 mgrSelector->Activate(iobj,itl.Value(),myMainSel);
819 EraseGlobal(iobj,Standard_False);
832 //=======================================================================
833 //function : SetZDetection
835 //=======================================================================
836 void AIS_InteractiveContext::SetZDetection(const Standard_Boolean aStatus)
838 myZDetectionFlag = aStatus;
841 //=======================================================================
842 //function : ZDetection
844 //=======================================================================
845 Standard_Boolean AIS_InteractiveContext::ZDetection() const
847 return myZDetectionFlag;