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 if(debugmode) cout<<"Index Of CurrentLocalContext:"<<myCurLocalIndex<<endl;
157 if(updateviewer) myMainVwr->Update();
160 //=======================================================================
161 //function : CloseAllContexts
163 //=======================================================================
165 void AIS_InteractiveContext::CloseAllContexts(const Standard_Boolean updateviewer)
168 while(!myLocalContexts.IsEmpty()){
169 CloseLocalContext(myCurLocalIndex,Standard_False);
172 ResetOriginalState(Standard_False);
174 if(updateviewer) myMainVwr->Update();
177 //=======================================================================
178 //function : IndexOfCurrentLocal
180 //=======================================================================
182 Standard_Integer AIS_InteractiveContext::IndexOfCurrentLocal() const
184 return myCurLocalIndex;
187 //=======================================================================
188 //function : ClearLocalContext
190 //=======================================================================
192 void AIS_InteractiveContext::ClearLocalContext(const AIS_ClearMode aMode)
194 if (!HasOpenedContext()) return;
195 myLocalContexts(myCurLocalIndex)->Clear(aMode);
199 //=======================================================================
200 //function : HighestIndex
202 //=======================================================================
204 Standard_Integer AIS_InteractiveContext::HighestIndex() const
206 AIS_DataMapIteratorOfDataMapOfILC It(myLocalContexts);
207 Standard_Integer HiInd = 0;
208 for(;It.More();It.Next())
209 HiInd = (It.Key()>HiInd) ? It.Key() : HiInd;
215 //=======================================================================
216 //function : Activate
218 //=======================================================================
220 void AIS_InteractiveContext::
221 Activate(const Handle(AIS_InteractiveObject)& anIObj,
222 const Standard_Integer aMode,
223 const Standard_Boolean theIsForce)
225 if(!HasOpenedContext()){
226 if(!myObjects.IsBound(anIObj)) return;
227 const Handle(AIS_GlobalStatus)& STAT = myObjects(anIObj);
228 if(STAT->GraphicStatus()==AIS_DS_Displayed || theIsForce)
229 mgrSelector->Activate(anIObj,aMode,myMainSel);
230 STAT ->AddSelectionMode(aMode);
233 myLocalContexts(myCurLocalIndex)->ActivateMode(anIObj,aMode);
237 //=======================================================================
238 //function : LocalSelector
240 //=======================================================================
241 Handle( StdSelect_ViewerSelector3d ) AIS_InteractiveContext::LocalSelector() const
243 if( !HasOpenedContext() )
244 return Handle( StdSelect_ViewerSelector3d )();
246 return myLocalContexts( myCurLocalIndex )->MainSelector();
250 //=======================================================================
251 //function : DeActivate
253 //=======================================================================
254 void AIS_InteractiveContext::
255 Deactivate(const Handle(AIS_InteractiveObject)& anIObj)
257 if(!HasOpenedContext()){
258 if(!myObjects.IsBound(anIObj)) return;
259 TColStd_ListIteratorOfListOfInteger ItL;
260 for(ItL.Initialize(myObjects(anIObj)->SelectionModes());
263 if(myObjects(anIObj)->GraphicStatus() == AIS_DS_Displayed)
264 mgrSelector->Deactivate(anIObj,ItL.Value(),myMainSel);
266 myObjects(anIObj)->ClearSelectionModes();
269 const Handle(AIS_LocalContext)& LC = myLocalContexts(myCurLocalIndex);
270 LC->Deactivate(anIObj);
274 //=======================================================================
275 //function : Deactivate
277 //=======================================================================
279 void AIS_InteractiveContext::Deactivate(const Handle(AIS_InteractiveObject)& anIObj,
280 const Standard_Integer aMode)
282 if(!HasOpenedContext()){
283 if(!myObjects.IsBound(anIObj)) return;
284 const Handle(AIS_GlobalStatus)& STAT = myObjects(anIObj);
286 if(STAT->GraphicStatus() == AIS_DS_Displayed)
287 mgrSelector->Deactivate(anIObj,aMode,myMainSel);
288 STAT->RemoveSelectionMode(aMode);
291 myLocalContexts(myCurLocalIndex)->DeactivateMode(anIObj,aMode);
295 //=======================================================================
296 //function : ActivatedModes
298 //=======================================================================
300 void AIS_InteractiveContext::
301 ActivatedModes(const Handle(AIS_InteractiveObject)& anIObj,
302 TColStd_ListOfInteger& theList) const
304 TColStd_ListIteratorOfListOfInteger ItL;
305 if(!HasOpenedContext()){
306 if(myObjects.IsBound(anIObj)){
307 for(ItL.Initialize(myObjects(anIObj)->SelectionModes());
310 theList.Append(ItL.Value());
315 if(myLocalContexts(myCurLocalIndex)->IsIn(anIObj)){
316 for(ItL.Initialize(myLocalContexts(myCurLocalIndex)->SelectionModes(anIObj));
319 theList.Append(ItL.Value());
324 //=======================================================================
325 //function : SetShapeDecomposition
327 //=======================================================================
329 void AIS_InteractiveContext::SetShapeDecomposition(const Handle(AIS_InteractiveObject)& anIObj,
330 const Standard_Boolean StdModeSensitive)
332 if(!HasOpenedContext()) return;
333 myLocalContexts(myCurLocalIndex)->SetShapeDecomposition(anIObj,StdModeSensitive);
336 //=======================================================================
337 //function : SetTemporaryAttributes
339 //=======================================================================
341 void AIS_InteractiveContext::
342 SetTemporaryAttributes(const Handle(AIS_InteractiveObject)& /*anObj*/,
343 const Handle(Prs3d_Drawer)& /*aDrawer*/,
344 const Standard_Boolean /*updateviewer*/)
348 //=======================================================================
349 //function : SubIntensityOn
351 //=======================================================================
352 void AIS_InteractiveContext::
353 SubIntensityOn(const Handle(AIS_InteractiveObject)& anIObj,
354 const Standard_Boolean updateviewer)
356 if(!HasOpenedContext()){
357 if(!myObjects.IsBound(anIObj))
359 const Handle(AIS_GlobalStatus)& GB=myObjects(anIObj);
360 if(GB->IsSubIntensityOn())
362 GB->SubIntensityOn();
363 Standard_Boolean UpdMain(Standard_False);
365 for(TColStd_ListIteratorOfListOfInteger It(GB->DisplayedModes());It.More();It.Next()){
366 if (GB->GraphicStatus()==AIS_DS_Displayed)
368 myMainPM->Color(anIObj,mySubIntensity,It.Value());
369 UpdMain = Standard_True;
378 if(myObjects.IsBound(anIObj)){
379 const Handle(AIS_GlobalStatus)& STAT = myObjects(anIObj);
380 STAT->SubIntensityOn();
381 TColStd_ListIteratorOfListOfInteger ItL;
382 for (ItL.Initialize(STAT->DisplayedModes());ItL.More();ItL.Next())
383 myMainPM->Color(anIObj,mySubIntensity,ItL.Value());
386 myLocalContexts(myCurLocalIndex)->SubIntensityOn(anIObj);
388 if(updateviewer) myMainVwr->Update();
391 //=======================================================================
392 //function : SubIntensityOff
394 //=======================================================================
396 void AIS_InteractiveContext::
397 SubIntensityOff(const Handle(AIS_InteractiveObject)& anIObj,
398 const Standard_Boolean updateviewer)
400 if(!HasOpenedContext()){
401 if(!myObjects.IsBound(anIObj))
403 const Handle(AIS_GlobalStatus)& GB=myObjects(anIObj);
404 if(!GB->IsSubIntensityOn())
406 GB->SubIntensityOff();
407 Standard_Boolean UpdMain(Standard_False);
409 for(TColStd_ListIteratorOfListOfInteger It(GB->DisplayedModes());It.More();It.Next()){
410 if(GB->GraphicStatus()==AIS_DS_Displayed)
412 myMainPM->Unhighlight(anIObj,It.Value());
413 UpdMain = Standard_True;
417 Standard_Integer DM,HM,SM;
418 GetDefModes(anIObj,DM,HM,SM);
419 if(AIS_Selection::IsSelected(anIObj))
420 myMainPM->Highlight(anIObj,HM);
428 if(myObjects.IsBound(anIObj)){
429 const Handle(AIS_GlobalStatus)& STAT = myObjects(anIObj);
430 STAT->SubIntensityOff();
431 TColStd_ListIteratorOfListOfInteger ItL;
432 for (ItL.Initialize(STAT->DisplayedModes());ItL.More();ItL.Next())
433 myMainPM->Unhighlight(anIObj,ItL.Value());
434 if(STAT->IsHilighted())
438 myLocalContexts(myCurLocalIndex)->SubIntensityOff(anIObj);
439 if(IsSelected(anIObj))
442 if(updateviewer) myMainVwr->Update();
446 //=======================================================================
447 //function : SubIntensityOn
448 //purpose : ALL THE DISPLAYED OBJECTS HAVE SUBINTENSITY...
449 //=======================================================================
451 void AIS_InteractiveContext::SubIntensityOn(const Standard_Boolean updateviewer)
453 if(!HasOpenedContext()) return;
455 AIS_DataMapIteratorOfDataMapOfIOStatus It (myObjects);
456 TColStd_ListIteratorOfListOfInteger ItM;
457 for(;It.More();It.Next()){
458 const Handle(AIS_GlobalStatus)& STAT = It.Value();
459 if(STAT->GraphicStatus()==AIS_DS_Displayed)
461 STAT->SubIntensityOn();
462 for(ItM.Initialize(STAT->DisplayedModes());ItM.More();ItM.Next())
463 {myMainPM->Color(It.Key(),mySubIntensity,ItM.Value());}
466 if(updateviewer) myMainVwr->Update();
469 //=======================================================================
470 //function : SubIntensityOff
472 //=======================================================================
473 void AIS_InteractiveContext::SubIntensityOff(const Standard_Boolean updateviewer)
475 if(!HasOpenedContext()) return;
477 AIS_DataMapIteratorOfDataMapOfIOStatus It (myObjects);
478 TColStd_ListIteratorOfListOfInteger ItL;
479 for(;It.More();It.Next()){
480 const Handle(AIS_GlobalStatus)& STAT = It.Value();
481 if(STAT->IsSubIntensityOn())
482 STAT->SubIntensityOff();
483 for(ItL.Initialize(STAT->DisplayedModes());ItL.More();ItL.Next())
484 myMainPM->Unhighlight(It.Key());
487 if(updateviewer) myMainVwr->Update();
490 //=======================================================================
491 //function : AddFilter
493 //=======================================================================
494 void AIS_InteractiveContext::AddFilter(const Handle(SelectMgr_Filter)& aFilter)
496 if(HasOpenedContext())
497 myLocalContexts(myCurLocalIndex)->AddFilter(aFilter);
499 myFilters->Add(aFilter);
502 //=======================================================================
503 //function : ActivateStandardMode
505 //=======================================================================
506 void AIS_InteractiveContext::ActivateStandardMode(const TopAbs_ShapeEnum aStandardActivation)
508 if(!HasOpenedContext()) return;
509 myLocalContexts(myCurLocalIndex)->ActivateStandardMode (aStandardActivation);
512 //=======================================================================
513 //function : DeActivateStandardMode
515 //=======================================================================
516 void AIS_InteractiveContext::DeactivateStandardMode(const TopAbs_ShapeEnum aStandardActivation)
518 if(!HasOpenedContext()) return;
519 myLocalContexts(myCurLocalIndex)->DeactivateStandardMode (aStandardActivation);
522 //=======================================================================
523 //function : RemoveFilter
525 //=======================================================================
526 void AIS_InteractiveContext::RemoveFilter(const Handle(SelectMgr_Filter)& aFilter)
528 if(HasOpenedContext())
529 myLocalContexts(myCurLocalIndex)->RemoveFilter (aFilter);
531 myFilters->Remove(aFilter);
534 //=======================================================================
535 //function : RemoveFilters
537 //=======================================================================
539 void AIS_InteractiveContext::RemoveFilters()
541 if(!HasOpenedContext())
544 myLocalContexts(myCurLocalIndex)->Clear(AIS_CM_Filters);
547 //=======================================================================
548 //function : ActivatedStandardModes
550 //=======================================================================
551 const TColStd_ListOfInteger& AIS_InteractiveContext::ActivatedStandardModes() const
553 return myLocalContexts(myCurLocalIndex)->StandardModes();
556 //=======================================================================
559 //=======================================================================
560 const SelectMgr_ListOfFilter& AIS_InteractiveContext::Filters() const
562 if(HasOpenedContext())
563 return myLocalContexts(myCurLocalIndex)->ListOfFilter();
564 return myFilters->StoredFilters();
567 //=======================================================================
568 //function : DisplayActiveSensitive
570 //=======================================================================
571 void AIS_InteractiveContext::DisplayActiveSensitive(const Handle(V3d_View)& aviou)
573 if(HasOpenedContext())
574 myLocalContexts(myCurLocalIndex)->DisplaySensitive(aviou);
576 myMainSel->DisplaySensitive(aviou);
578 //=======================================================================
579 //function : DisplayActiveSensitive
581 //=======================================================================
583 void AIS_InteractiveContext::DisplayActiveSensitive(const Handle(AIS_InteractiveObject)& anIObj,
584 const Handle(V3d_View)& aviou)
586 TColStd_ListIteratorOfListOfInteger It;
587 Handle(StdSelect_ViewerSelector3d) VS;
588 if(HasOpenedContext()){
589 const Handle(AIS_LocalContext)& LC = myLocalContexts(myCurLocalIndex);
590 if(!LC->IsIn(anIObj)) return;
591 It.Initialize(LC->SelectionModes(anIObj));
592 VS = LC->MainSelector();
595 if(!myObjects.IsBound(anIObj)) return;
596 It.Initialize(myObjects(anIObj)->SelectionModes());
601 for(;It.More();It.Next()){
602 const Handle(SelectMgr_Selection)& Sel = anIObj->Selection(It.Value());
603 VS->DisplaySensitive(Sel,anIObj->Transformation(), aviou,Standard_False);
608 //=======================================================================
609 //function : ClearActiveSensitive
611 //=======================================================================
612 void AIS_InteractiveContext::ClearActiveSensitive(const Handle(V3d_View)& aviou)
615 if(HasOpenedContext())
616 myLocalContexts(myCurLocalIndex)->ClearSensitive(aviou);
618 myMainSel->ClearSensitive(aviou);
621 //=======================================================================
622 //function : SetAutomaticHilight
624 //=======================================================================
625 void AIS_InteractiveContext::SetAutomaticHilight(const Standard_Boolean aStatus)
628 if(HasOpenedContext())
629 myLocalContexts(myCurLocalIndex)->SetAutomaticHilight(aStatus);
632 //=======================================================================
633 //function : AutomaticHilight
635 //=======================================================================
636 Standard_Boolean AIS_InteractiveContext::AutomaticHilight() const
638 if(HasOpenedContext())
639 return myLocalContexts(myCurLocalIndex)->AutomaticHilight();
640 return Standard_True;
643 //=======================================================================
644 //function : UseDisplayedObjects
646 //=======================================================================
648 void AIS_InteractiveContext::UseDisplayedObjects()
650 if(HasOpenedContext())
651 myLocalContexts(myCurLocalIndex)->LoadContextObjects();
654 //=======================================================================
655 //function : NotUseDisplayedObjects
657 //=======================================================================
659 void AIS_InteractiveContext::NotUseDisplayedObjects()
661 if(HasOpenedContext())
662 myLocalContexts(myCurLocalIndex)->UnloadContextObjects();
668 //=======================================================================
669 //function : PurgeDisplay
671 //=======================================================================
673 Standard_Integer AIS_InteractiveContext::PurgeDisplay()
675 if(HasOpenedContext()) return 0;
677 Standard_Integer NbStr = PurgeViewer(myMainVwr);
684 //=======================================================================
685 //function : PurgeViewer
687 //=======================================================================
688 Standard_Integer AIS_InteractiveContext::PurgeViewer(const Handle(V3d_Viewer)& Vwr)
690 Handle(Graphic3d_StructureManager) GSM = Vwr->Viewer();
691 Standard_Integer NbCleared(0);
692 Graphic3d_MapOfStructure SOS;
693 GSM->DisplayedStructures(SOS);
695 Handle(Graphic3d_Structure) G;
696 for(Graphic3d_MapIteratorOfMapOfStructure It(SOS); It.More();It.Next()){
698 Standard_Address Add = G->Owner();
701 G->Clear();// it means that it is not referenced as a presentation of InterfactiveObject...
704 Handle(AIS_InteractiveObject) IO = (AIS_InteractiveObject*)Add;
705 if(!myObjects.IsBound(IO)){
713 //=======================================================================
714 //function : IsImmediateModeOn
716 //=======================================================================
718 Standard_Boolean AIS_InteractiveContext::IsImmediateModeOn() const
720 if(!HasOpenedContext()) return Standard_False;
721 return myLocalContexts(myCurLocalIndex)->IsImmediateModeOn();
724 //=======================================================================
725 //function : BeginImmediateDraw
727 //=======================================================================
729 Standard_Boolean AIS_InteractiveContext::BeginImmediateDraw()
731 return HasOpenedContext()
732 && myLocalContexts (myCurLocalIndex)->BeginImmediateDraw();
735 //=======================================================================
736 //function : ImmediateAdd
738 //=======================================================================
740 Standard_Boolean AIS_InteractiveContext::ImmediateAdd (const Handle(AIS_InteractiveObject)& theObj,
741 const Standard_Integer theMode)
743 return HasOpenedContext()
744 && myLocalContexts (myCurLocalIndex)->ImmediateAdd (theObj, theMode);
747 //=======================================================================
748 //function : EndImmediateDraw
750 //=======================================================================
752 Standard_Boolean AIS_InteractiveContext::EndImmediateDraw (const Handle(V3d_View)& theView)
754 return HasOpenedContext()
755 && myLocalContexts (myCurLocalIndex)->EndImmediateDraw (theView->Viewer());
758 //=======================================================================
759 //function : EndImmediateDraw
761 //=======================================================================
763 Standard_Boolean AIS_InteractiveContext::EndImmediateDraw()
765 if (!HasOpenedContext())
767 return Standard_False;
770 myMainVwr->InitActiveViews();
771 if (!myMainVwr->MoreActiveViews())
773 return Standard_False;
776 Handle(V3d_View) aView = myMainVwr->ActiveView();
777 return myLocalContexts (myCurLocalIndex)->EndImmediateDraw (aView->Viewer());
781 //=======================================================================
782 //function : ResetOriginalState
784 //=======================================================================
786 void AIS_InteractiveContext::ResetOriginalState(const Standard_Boolean updateviewer)
788 Standard_Boolean upd_main(Standard_False);
789 TColStd_ListIteratorOfListOfInteger itl;
790 myMainSel->ResetSelectionActivationStatus();
792 for (AIS_DataMapIteratorOfDataMapOfIOStatus it(myObjects);it.More();it.Next()){
793 const Handle(AIS_InteractiveObject)& iobj = it.Key();
794 const Handle(AIS_GlobalStatus)& STAT = it.Value();
795 switch(STAT->GraphicStatus()){
796 case AIS_DS_Displayed:{
797 upd_main = Standard_True;
800 for(itl.Initialize(STAT->DisplayedModes());itl.More();itl.Next())
801 myMainPM->Display(iobj,itl.Value());
802 if(STAT->IsHilighted()){
803 if(STAT->HilightColor()!=Quantity_NOC_WHITE)
804 HilightWithColor(iobj,STAT->HilightColor(),Standard_False);
806 Hilight(iobj,Standard_False);
809 for(itl.Initialize(STAT->SelectionModes());itl.More();itl.Next()){
811 mgrSelector->Activate(iobj,itl.Value(),myMainSel);
816 EraseGlobal(iobj,Standard_False);
829 //=======================================================================
830 //function : SetZDetection
832 //=======================================================================
833 void AIS_InteractiveContext::SetZDetection(const Standard_Boolean aStatus)
835 myZDetectionFlag = aStatus;
838 //=======================================================================
839 //function : ZDetection
841 //=======================================================================
842 Standard_Boolean AIS_InteractiveContext::ZDetection() const
844 return myZDetectionFlag;