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_DataMapIteratorOfDataMapOfIOStatus.hxx>
19 #include <AIS_GlobalStatus.hxx>
20 #include <AIS_InteractiveContext.hxx>
21 #include <AIS_InteractiveObject.hxx>
22 #include <AIS_LocalContext.hxx>
23 #include <AIS_MapIteratorOfMapOfInteractive.hxx>
24 #include <AIS_MapOfInteractive.hxx>
25 #include <AIS_Selection.hxx>
26 #include <AIS_Shape.hxx>
27 #include <AIS_StatusOfDetection.hxx>
28 #include <AIS_StatusOfPick.hxx>
29 #include <Aspect_Grid.hxx>
30 #include <Prs3d_BasicAspect.hxx>
31 #include <Prs3d_LineAspect.hxx>
32 #include <Prs3d_Presentation.hxx>
33 #include <Quantity_Color.hxx>
34 #include <SelectBasics_SensitiveEntity.hxx>
35 #include <SelectMgr_EntityOwner.hxx>
36 #include <SelectMgr_Filter.hxx>
37 #include <SelectMgr_OrFilter.hxx>
38 #include <SelectMgr_Selection.hxx>
39 #include <SelectMgr_SelectionManager.hxx>
40 #include <Standard_Transient.hxx>
41 #include <StdSelect_BRepOwner.hxx>
42 #include <StdSelect_ViewerSelector3d.hxx>
43 #include <TCollection_AsciiString.hxx>
44 #include <TCollection_ExtendedString.hxx>
45 #include <TColStd_ListIteratorOfListOfInteger.hxx>
46 #include <TopLoc_Location.hxx>
47 #include <V3d_AmbientLight.hxx>
48 #include <V3d_DirectionalLight.hxx>
49 #include <V3d_Light.hxx>
50 #include <V3d_PositionalLight.hxx>
51 #include <V3d_SpotLight.hxx>
52 #include <V3d_View.hxx>
53 #include <V3d_Viewer.hxx>
55 typedef NCollection_DataMap<Handle(AIS_InteractiveObject), NCollection_Handle<SelectMgr_SequenceOfOwner> > AIS_MapOfObjSelectedOwners;
59 TopoDS_Shape AIS_myDummyShape;
62 //=======================================================================
63 //function : highlightWithColor
65 //=======================================================================
66 void AIS_InteractiveContext::highlightWithColor (const Handle(SelectMgr_EntityOwner)& theOwner,
67 const Quantity_NameOfColor theColor,
68 const Handle(V3d_Viewer)& theViewer)
70 const Handle(AIS_InteractiveObject) anObj =
71 Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
74 const Standard_Integer aHiMode = anObj->HasHilightMode() ? anObj->HilightMode() : 0;
76 myMainPM->BeginImmediateDraw();
77 theOwner->HilightWithColor (myMainPM, theColor, aHiMode);
78 myMainPM->EndImmediateDraw (theViewer.IsNull() ? myMainVwr : theViewer);
81 //=======================================================================
82 //function : highlightSelected
84 //=======================================================================
85 void AIS_InteractiveContext::highlightSelected (const Handle(SelectMgr_EntityOwner)& theOwner,
86 const Quantity_NameOfColor theSelColor)
88 const Handle(AIS_InteractiveObject) anObj =
89 Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
92 const Standard_Integer aHiMode = anObj->HasHilightMode() ? anObj->HilightMode() : 0;
94 if (!theOwner->IsAutoHilight())
96 SelectMgr_SequenceOfOwner aSeq;
97 for (mySelection->Init(); mySelection->More(); mySelection->Next())
99 const Handle(SelectMgr_EntityOwner) aSelOwnr =
100 Handle(SelectMgr_EntityOwner)::DownCast (mySelection->Value());
101 if (aSelOwnr->Selectable() != anObj)
103 aSeq.Append (aSelOwnr);
105 anObj->HilightSelected (myMainPM, aSeq);
109 theOwner->HilightWithColor (myMainPM, theSelColor, aHiMode);
113 //=======================================================================
114 //function : unhighlightSelected
116 //=======================================================================
117 void AIS_InteractiveContext::unhighlightSelected (const Standard_Boolean theIsToHilightSubIntensity)
119 NCollection_IndexedMap<Handle(AIS_InteractiveObject)> anObjToClear;
120 for (mySelection->Init(); mySelection->More(); mySelection->Next())
122 const Handle(SelectMgr_EntityOwner) anOwner =
123 Handle(SelectMgr_EntityOwner)::DownCast (mySelection->Value());
124 if (anOwner.IsNull() || !anOwner->HasSelectable())
127 const Handle(AIS_InteractiveObject) anInteractive =
128 Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
129 if (anOwner->IsAutoHilight())
131 const Standard_Integer aHiMode = anInteractive->HasHilightMode() ? anInteractive->HilightMode() : 0;
132 anOwner->Unhilight (myMainPM, aHiMode);
133 if (theIsToHilightSubIntensity)
135 if (myObjects.IsBound (anInteractive) && myObjects (anInteractive)->IsSubIntensityOn())
137 anOwner->HilightWithColor (myMainPM, mySubIntensity, aHiMode);
143 if (!anObjToClear.Contains (anInteractive))
144 anObjToClear.Add (anInteractive);
147 if (anOwner == anInteractive->GlobalSelOwner())
149 myObjects.ChangeFind (anInteractive)->SetHilightStatus (Standard_False);
152 for (NCollection_IndexedMap<Handle(AIS_InteractiveObject)>::Iterator anIter (anObjToClear); anIter.More(); anIter.Next())
154 const Handle(AIS_InteractiveObject)& anObj = anIter.Value();
155 const Standard_Integer aHiMode = anObj->HasHilightMode() ? anObj->HilightMode() : 0;
156 myMainPM->Unhighlight (anObj, aHiMode);
157 anObj->ClearSelected();
161 //=======================================================================
164 //=======================================================================
165 AIS_StatusOfDetection AIS_InteractiveContext::MoveTo (const Standard_Integer theXPix,
166 const Standard_Integer theYPix,
167 const Handle(V3d_View)& theView,
168 const Standard_Boolean theToRedrawOnUpdate)
170 if (HasOpenedContext())
172 myWasLastMain = Standard_True;
173 return myLocalContexts (myCurLocalIndex)->MoveTo (theXPix, theYPix, theView, theToRedrawOnUpdate);
176 myAISCurDetected = 0;
177 myAISDetectedSeq.Clear();
179 if (theView->Viewer() != myMainVwr)
181 return AIS_SOD_Error;
185 myLastPicked = myLastinMain;
186 myWasLastMain = Standard_True;
187 AIS_StatusOfDetection aStatus = AIS_SOD_Nothing;
188 Standard_Boolean toUpdateViewer = Standard_False;
190 myFilters->SetDisabledObjects (theView->View()->HiddenObjects());
191 myMainSel->Pick (theXPix, theYPix, theView);
193 // filling of myAISDetectedSeq sequence storing information about detected AIS objects
194 // (the objects must be AIS_Shapes)
195 const Standard_Integer aDetectedNb = myMainSel->NbPicked();
196 Standard_Integer aNewDetected = 0;
197 for (Standard_Integer aDetIter = 1; aDetIter <= aDetectedNb; ++aDetIter)
199 Handle(SelectMgr_EntityOwner) anOwner = myMainSel->Picked (aDetIter);
201 || !myFilters->IsOk (anOwner))
206 if (aNewDetected < 1)
208 aNewDetected = aDetIter;
210 Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
213 myAISDetectedSeq.Append (anObj);
217 if (aNewDetected >= 1)
219 // Does nothing if previously detected object is equal to the current one.
220 // However in advanced selection modes the owners comparison
221 // is not effective because in that case only one owner manage the
222 // selection in current selection mode. It is necessary to check the current detected
223 // entity and hilight it only if the detected entity is not the same as
224 // previous detected (IsForcedHilight call)
225 Handle(SelectMgr_EntityOwner) aNewPickedOwner = myMainSel->Picked (aNewDetected);
226 if (aNewPickedOwner == myLastPicked && !aNewPickedOwner->IsForcedHilight())
228 return myLastPicked->IsSelected()
230 : AIS_SOD_OnlyOneDetected;
233 // Previously detected object is unhilighted if it is not selected or hilighted
234 // with selection color if it is selected. Such highlighting with selection color
235 // is needed only if myToHilightSelected flag is true. In this case previously detected
236 // object has been already highlighted with myHilightColor during previous MoveTo()
237 // method call. As result it is necessary to rehighligt it with mySelectionColor.
238 if (!myLastPicked.IsNull() && myLastPicked->HasSelectable())
240 myMainPM->ClearImmediateDraw();
241 const Handle(AIS_InteractiveObject) aLastPickedAIS = Handle(AIS_InteractiveObject)::DownCast (myLastPicked->Selectable());
242 const Standard_Integer aHiMod = aLastPickedAIS->HasHilightMode() ? aLastPickedAIS->HilightMode() : 0;
243 if (!myLastPicked->IsSelected())
245 myLastPicked->Unhilight (myMainPM, aHiMod);
246 toUpdateViewer = Standard_True;
248 else if (myToHilightSelected)
250 highlightWithColor (aNewPickedOwner, mySelectionColor, theView->Viewer());
251 toUpdateViewer = Standard_True;
255 // initialize myLastPicked field with currently detected object
256 myLastPicked = aNewPickedOwner;
257 myLastinMain = myLastPicked;
259 // highlight detected object if it is not selected or myToHilightSelected flag is true
260 if (myLastPicked->HasSelectable())
262 if (!myLastPicked->IsSelected() || myToHilightSelected)
264 highlightWithColor (myLastPicked, myHilightColor, theView->Viewer());
265 toUpdateViewer = Standard_True;
268 aStatus = myLastPicked->IsSelected()
270 : AIS_SOD_OnlyOneDetected;
275 // previously detected object is unhilighted if it is not selected or hilighted
276 // with selection color if it is selected
277 aStatus = AIS_SOD_Nothing;
278 if (!myLastPicked.IsNull() && myLastPicked->HasSelectable())
280 myMainPM->ClearImmediateDraw();
281 const Handle(AIS_InteractiveObject) aLastPickedAIS = Handle(AIS_InteractiveObject)::DownCast (myLastPicked->Selectable());
282 Standard_Integer aHiMod = aLastPickedAIS->HasHilightMode() ? aLastPickedAIS->HilightMode() : 0;
283 if (!myLastPicked->IsSelected())
285 if (myLastPicked->IsAutoHilight())
287 myLastPicked->Unhilight (myMainPM, aHiMod);
289 toUpdateViewer = Standard_True;
291 else if (myToHilightSelected)
293 highlightSelected (myLastPicked, mySelectionColor);
294 toUpdateViewer = Standard_True;
298 myLastinMain.Nullify();
299 myLastPicked.Nullify();
303 && theToRedrawOnUpdate)
305 theView->Viewer()->Update();
308 mylastmoveview = theView;
312 //=======================================================================
313 //function : AddSelect
315 //=======================================================================
316 AIS_StatusOfPick AIS_InteractiveContext::AddSelect (const Handle(Standard_Transient)& theObject)
318 if (HasOpenedContext())
320 return myLocalContexts(myCurLocalIndex)->AddSelect (theObject);
322 mySelection->AddSelect (theObject);
324 Standard_Integer aSelNum = NbSelected();
325 return (aSelNum == 0) ? AIS_SOP_NothingSelected
326 : (aSelNum == 1) ? AIS_SOP_OneSelected
327 : AIS_SOP_SeveralSelected;
330 //=======================================================================
333 //=======================================================================
334 AIS_StatusOfPick AIS_InteractiveContext::Select (const Standard_Integer theXPMin,
335 const Standard_Integer theYPMin,
336 const Standard_Integer theXPMax,
337 const Standard_Integer theYPMax,
338 const Handle(V3d_View)& theView,
339 const Standard_Boolean toUpdateViewer)
341 // all objects detected by the selector are taken, previous current objects are emptied,
342 // new objects are put...
344 if (HasOpenedContext())
346 return myLocalContexts(myCurLocalIndex)->Select (theXPMin, theYPMin,
348 theView, toUpdateViewer);
351 ClearSelected (Standard_False);
353 Handle(StdSelect_ViewerSelector3d) aSelector;
355 if (theView->Viewer() == myMainVwr)
357 aSelector = myMainSel;
358 myWasLastMain = Standard_True;
361 aSelector->Pick (theXPMin, theYPMin, theXPMax, theYPMax, theView);
363 for (aSelector->Init(); aSelector->More(); aSelector->Next())
365 const Handle(SelectMgr_EntityOwner)& aCurOwner = aSelector->Picked();
366 if (aCurOwner.IsNull() || !aCurOwner->HasSelectable() || !myFilters->IsOk (aCurOwner))
369 mySelection->Select (aCurOwner);
370 aCurOwner->State (1);
373 HilightSelected (toUpdateViewer);
375 Standard_Integer aSelNum = NbSelected();
377 return (aSelNum == 0) ? AIS_SOP_NothingSelected
378 : (aSelNum == 1) ? AIS_SOP_OneSelected
379 : AIS_SOP_SeveralSelected;
383 //=======================================================================
385 //purpose : Selection by polyline
386 //=======================================================================
387 AIS_StatusOfPick AIS_InteractiveContext::Select (const TColgp_Array1OfPnt2d& thePolyline,
388 const Handle(V3d_View)& theView,
389 const Standard_Boolean toUpdateViewer)
391 // all objects detected by the selector are taken, previous current objects are emptied,
392 // new objects are put...
394 if (HasOpenedContext())
396 return myLocalContexts(myCurLocalIndex)->Select (thePolyline, theView, toUpdateViewer);
399 ClearSelected (Standard_False);
401 Handle(StdSelect_ViewerSelector3d) aSelector;
403 if (theView->Viewer() == myMainVwr)
405 aSelector = myMainSel;
406 myWasLastMain = Standard_True;
409 aSelector->Pick (thePolyline, theView);
411 for (aSelector->Init(); aSelector->More(); aSelector->Next())
413 const Handle(SelectMgr_EntityOwner) anOwner = aSelector->Picked();
414 if (anOwner.IsNull() || !anOwner->HasSelectable() || !myFilters->IsOk (anOwner))
417 mySelection->Select (anOwner);
421 HilightSelected (toUpdateViewer);
423 Standard_Integer aSelNum = NbSelected();
425 return (aSelNum == 0) ? AIS_SOP_NothingSelected
426 : (aSelNum == 1) ? AIS_SOP_OneSelected
427 : AIS_SOP_SeveralSelected;
431 //=======================================================================
434 //=======================================================================
435 AIS_StatusOfPick AIS_InteractiveContext::Select (const Standard_Boolean toUpdateViewer)
437 if (HasOpenedContext())
441 return myLocalContexts(myCurLocalIndex)->Select (toUpdateViewer);
445 myLocalContexts(myCurLocalIndex)->SetSelected (Handle(AIS_InteractiveObject)::DownCast (myLastPicked->Selectable()), toUpdateViewer);
446 return AIS_SOP_OneSelected;
450 myMainPM->ClearImmediateDraw();
451 if (myWasLastMain && !myLastinMain.IsNull())
453 if(!myLastinMain->IsSelected())
455 SetSelected (myLastinMain, Standard_False);
458 UpdateCurrentViewer();
464 unhighlightSelected (Standard_True);
466 mySelection->Select();
467 if (toUpdateViewer && myWasLastMain)
469 UpdateCurrentViewer();
473 Standard_Integer aSelNum = NbSelected();
475 return (aSelNum == 0) ? AIS_SOP_NothingSelected
476 : (aSelNum == 1) ? AIS_SOP_OneSelected
477 : AIS_SOP_SeveralSelected;
480 //=======================================================================
481 //function : ShiftSelect
483 //=======================================================================
484 AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect (const Standard_Boolean toUpdateViewer)
486 if (HasOpenedContext())
490 return myLocalContexts (myCurLocalIndex)->ShiftSelect (toUpdateViewer);
494 myLocalContexts (myCurLocalIndex)->AddOrRemoveSelected (myLastPicked, toUpdateViewer);
496 Standard_Integer aSelNum = NbSelected();
497 return (aSelNum == 0) ? AIS_SOP_NothingSelected
498 : (aSelNum == 1) ? AIS_SOP_OneSelected
499 : AIS_SOP_SeveralSelected;
503 myMainPM->ClearImmediateDraw();
504 if (myWasLastMain && !myLastinMain.IsNull())
506 AddOrRemoveSelected (myLastinMain, toUpdateViewer);
509 Standard_Integer aSelNum = NbSelected();
511 return (aSelNum == 0) ? AIS_SOP_NothingSelected
512 : (aSelNum == 1) ? AIS_SOP_OneSelected
513 : AIS_SOP_SeveralSelected;
516 //=======================================================================
517 //function : ShiftSelect
519 //=======================================================================
520 AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect (const Standard_Integer theXPMin,
521 const Standard_Integer theYPMin,
522 const Standard_Integer theXPMax,
523 const Standard_Integer theYPMax,
524 const Handle(V3d_View)& theView,
525 const Standard_Boolean toUpdateViewer)
527 if (HasOpenedContext())
529 return myLocalContexts(myCurLocalIndex)->ShiftSelect (theXPMin, theYPMin, theXPMax, theYPMax,
530 theView, toUpdateViewer);
533 UnhilightSelected (Standard_False);
535 Handle(StdSelect_ViewerSelector3d) aSelector;
536 if (theView->Viewer() == myMainVwr)
538 aSelector = myMainSel;
539 myWasLastMain = Standard_True;
543 return AIS_SOP_NothingSelected;
546 aSelector->Pick (theXPMin, theYPMin, theXPMax, theYPMax, theView);
547 for (aSelector->Init(); aSelector->More(); aSelector->Next())
549 const Handle(SelectMgr_EntityOwner) anOwner = aSelector->Picked();
550 if (anOwner.IsNull() || !anOwner->HasSelectable() || !myFilters->IsOk (anOwner))
553 AIS_SelectStatus aSelStatus = mySelection->Select (anOwner);
554 Standard_Integer aState = (aSelStatus == AIS_SS_Added) ? 1 : 0;
555 anOwner->State (aState);
558 HilightSelected (toUpdateViewer);
560 Standard_Integer aSelNum = NbSelected();
562 return (aSelNum == 0) ? AIS_SOP_NothingSelected
563 : (aSelNum == 1) ? AIS_SOP_OneSelected
564 : AIS_SOP_SeveralSelected;
568 //=======================================================================
569 //function : ShiftSelect
571 //=======================================================================
572 AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect (const TColgp_Array1OfPnt2d& thePolyline,
573 const Handle(V3d_View)& theView,
574 const Standard_Boolean toUpdateViewer)
576 if (HasOpenedContext())
578 return myLocalContexts(myCurLocalIndex)->ShiftSelect (thePolyline, theView, toUpdateViewer);
581 UnhilightSelected (Standard_False);
583 Handle(StdSelect_ViewerSelector3d) aSelector;
585 if (theView->Viewer() == myMainVwr)
587 aSelector= myMainSel;
588 myWasLastMain = Standard_True;
592 return AIS_SOP_NothingSelected;
595 aSelector->Pick (thePolyline, theView);
597 for (aSelector->Init(); aSelector->More(); aSelector->Next())
599 const Handle(SelectMgr_EntityOwner) anOwner = aSelector->Picked();
600 if (anOwner.IsNull() || !anOwner->HasSelectable() || !myFilters->IsOk (anOwner))
603 AIS_SelectStatus aSelStatus = mySelection->Select (anOwner);
604 Standard_Integer aState = (aSelStatus == AIS_SS_Added) ? 1 : 0;
605 anOwner->State (aState);
608 HilightSelected (toUpdateViewer);
610 Standard_Integer aSelNum = NbSelected();
612 return (aSelNum == 0) ? AIS_SOP_NothingSelected
613 : (aSelNum == 1) ? AIS_SOP_OneSelected
614 : AIS_SOP_SeveralSelected;
617 //=======================================================================
618 //function : SetCurrentObject
619 //purpose : OBSOLETE, please use SetSelected() instead
620 //TODO : Remove in process of local context deletion
621 //=======================================================================
622 void AIS_InteractiveContext::SetCurrentObject (const Handle(AIS_InteractiveObject)& theObject,
623 const Standard_Boolean theToUpdateViewer)
625 if (HasOpenedContext())
628 SetSelected (theObject, theToUpdateViewer);
631 //=======================================================================
632 //function : AddOrRemoveCurrentObject
633 //purpose : OBSOLETE, please use AddOrRemoveSelected() instead
634 //TODO : Remove in process of local context deletion
635 //=======================================================================
636 void AIS_InteractiveContext::AddOrRemoveCurrentObject (const Handle(AIS_InteractiveObject)& theObj,
637 const Standard_Boolean theIsToUpdateViewer)
639 if (HasOpenedContext())
642 AddOrRemoveSelected (theObj, theIsToUpdateViewer);
644 //=======================================================================
645 //function : UpdateCurrent
646 //purpose : OBSOLETE, please use UpdateSelected() instead
647 //TODO : Remove in process of local context deletion
648 //=======================================================================
649 void AIS_InteractiveContext::UpdateCurrent()
654 //=======================================================================
655 //function : IsCurrent
656 //purpose : OBSOLETE, please use IsSelected() instead
657 //TODO : Remove in process of local context deletion
658 //=======================================================================
659 Standard_Boolean AIS_InteractiveContext::IsCurrent (const Handle(AIS_InteractiveObject)& theObject) const
661 return IsSelected (theObject);
664 //=======================================================================
665 //function : InitCurrent
666 //purpose : OBSOLETE, please use InitSelected() instead
667 //TODO : Remove in process of local context deletion
668 //=======================================================================
669 void AIS_InteractiveContext::InitCurrent()
671 if (HasOpenedContext())
677 //=======================================================================
678 //function : MoreCurrent
679 //purpose : OBSOLETE, please use MoreSelected() instead
680 //TODO : Remove in process of local context deletion
681 //=======================================================================
682 Standard_Boolean AIS_InteractiveContext::MoreCurrent() const
684 return !HasOpenedContext() && MoreSelected();
687 //=======================================================================
688 //function : NextCurrent
689 //purpose : OBSOLETE, please use NextSelected() instead
690 //TODO : Remove in process of local context deletion
691 //=======================================================================
692 void AIS_InteractiveContext::NextCurrent()
694 if (HasOpenedContext())
700 //=======================================================================
702 //purpose : OBSOLETE, please use SelectedInteractive() instead
703 //TODO : Remove in process of local context deletion
704 //=======================================================================
705 Handle(AIS_InteractiveObject) AIS_InteractiveContext::Current() const
707 return HasOpenedContext() ? NULL : SelectedInteractive();
710 //=======================================================================
711 //function : NbCurrents
712 //purpose : OBSOLETE, please use NbSelected() instead
713 //TODO : Remove in process of local context deletion
714 //=======================================================================
715 Standard_Integer AIS_InteractiveContext::NbCurrents()
717 return HasOpenedContext() ? -1 : NbSelected();
720 //=======================================================================
721 //function : HilightCurrents
722 //purpose : OBSOLETE, please use HilightSelected() instead
723 //TODO : Remove in process of local context deletion
724 //=======================================================================
725 void AIS_InteractiveContext::HilightCurrents (const Standard_Boolean theToUpdateViewer)
727 if (HasOpenedContext())
730 HilightSelected (theToUpdateViewer);
733 //=======================================================================
734 //function : UnhilightCurrents
735 //purpose : OBSOLETE, please use UnhilightSelected() instead
736 //TODO : Remove in process of local context deletion
737 //=======================================================================
738 void AIS_InteractiveContext::UnhilightCurrents (const Standard_Boolean theToUpdateViewer)
740 if (HasOpenedContext())
743 UnhilightSelected (theToUpdateViewer);
746 //=======================================================================
747 //function : ClearCurrents
748 //purpose : OBSOLETE, please use ClearCurrents() instead
749 //TODO : Remove in process of local context deletion
750 //=======================================================================
751 void AIS_InteractiveContext::ClearCurrents(const Standard_Boolean theToUpdateViewer)
753 if (HasOpenedContext())
756 ClearSelected (theToUpdateViewer);
760 //=======================================================================
761 //function : HilightSelected
763 //=======================================================================
764 void AIS_InteractiveContext::HilightSelected (const Standard_Boolean theToUpdateViewer)
766 if (HasOpenedContext())
768 return myLocalContexts (myCurLocalIndex)->HilightPicked (theToUpdateViewer);
771 // In case of selection without using local context
772 myMainPM->ClearImmediateDraw();
773 AIS_MapOfObjSelectedOwners anObjOwnerMap;
774 for (mySelection->Init(); mySelection->More(); mySelection->Next())
776 const Handle(SelectMgr_EntityOwner) anOwner =
777 Handle(SelectMgr_EntityOwner)::DownCast (mySelection->Value());
778 if (!anOwner.IsNull() && anOwner->HasSelectable())
780 const Handle(AIS_InteractiveObject) anObj =
781 Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
782 if (anOwner == anObj->GlobalSelOwner())
784 Handle(AIS_GlobalStatus)& aState = myObjects.ChangeFind (anObj);
785 aState->SetHilightStatus (Standard_True);
786 aState->SetHilightColor (mySelectionColor);
789 if (!anOwner->IsAutoHilight())
791 NCollection_Handle<SelectMgr_SequenceOfOwner> aSeq;
792 if (anObjOwnerMap.Find (anObj, aSeq))
794 aSeq->Append (anOwner);
798 aSeq = new SelectMgr_SequenceOfOwner();
799 aSeq->Append (anOwner);
800 anObjOwnerMap.Bind (anObj, aSeq);
805 const Standard_Integer aHiMode = anObj->HasHilightMode() ? anObj->HilightMode() : 0;
806 anOwner->HilightWithColor (myMainPM, mySelectionColor, aHiMode);
811 if (!anObjOwnerMap.IsEmpty())
813 for (AIS_MapOfObjSelectedOwners::Iterator anIter (anObjOwnerMap); anIter.More(); anIter.Next())
815 anIter.Key()->HilightSelected (myMainPM, *anIter.Value());
817 anObjOwnerMap.Clear();
820 if (theToUpdateViewer)
821 UpdateCurrentViewer();
824 //=======================================================================
825 //function : UnhilightSelected
827 //=======================================================================
828 void AIS_InteractiveContext::UnhilightSelected (const Standard_Boolean theToUpdateViewer)
830 if (HasOpenedContext())
832 return myLocalContexts (myCurLocalIndex)->UnhilightPicked (theToUpdateViewer);
835 for (mySelection->Init(); mySelection->More(); mySelection->Next())
837 const Handle(SelectMgr_EntityOwner) anOwner =
838 Handle(SelectMgr_EntityOwner)::DownCast (mySelection->Value());
839 if (!anOwner.IsNull() && anOwner->HasSelectable())
841 const Handle(AIS_InteractiveObject) anObj =
842 Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
843 if (anOwner == anObj->GlobalSelOwner())
845 myObjects.ChangeFind (anObj)->SetHilightStatus (Standard_False);
848 const Standard_Integer aHiMode = anObj->HasHilightMode() ? anObj->HasHilightMode() : 0;
849 anOwner->Unhilight (myMainPM, aHiMode);
853 if (theToUpdateViewer)
854 UpdateCurrentViewer();
858 //=======================================================================
859 //function : ClearSelected
861 //=======================================================================
862 void AIS_InteractiveContext::ClearSelected (const Standard_Boolean theToUpdateViewer)
864 if (HasOpenedContext())
865 return myLocalContexts (myCurLocalIndex)->ClearSelected (theToUpdateViewer);
867 if (NbSelected() == 0)
870 unhighlightSelected();
872 mySelection->Select();
873 myMainPM->ClearImmediateDraw();
875 if (theToUpdateViewer)
876 UpdateCurrentViewer();
879 //=======================================================================
880 //function : UpdateSelected
882 //=======================================================================
883 void AIS_InteractiveContext::UpdateSelected (const Standard_Boolean theToUpdateViewer)
885 if (HasOpenedContext())
887 return myLocalContexts(myCurLocalIndex)->UpdateSelected (theToUpdateViewer);
890 HilightSelected (theToUpdateViewer);
893 //=======================================================================
894 //function : SetSelected
895 //purpose : Sets the whole object as selected and highlights it with selection color
896 //=======================================================================
897 void AIS_InteractiveContext::SetSelected (const Handle(AIS_InteractiveObject)& theObject,
898 const Standard_Boolean theToUpdateViewer)
900 if(HasOpenedContext())
902 return myLocalContexts (myCurLocalIndex)->SetSelected (theObject, theToUpdateViewer);
905 if (theObject.IsNull())
907 if(!myObjects.IsBound (theObject))
908 Display (theObject, Standard_False);
909 if (theObject->HasSelection (0))
912 if (NbSelected() == 1 && myObjects (theObject)->IsHilighted())
914 Quantity_NameOfColor aHiCol;
915 Standard_Boolean hasHiCol = Standard_False;
916 if (IsHilighted (theObject, hasHiCol, aHiCol))
918 if (hasHiCol && aHiCol!= mySelectionColor)
920 HilightWithColor (theObject, mySelectionColor, theToUpdateViewer);
926 for (mySelection->Init(); mySelection->More(); mySelection->Next())
928 const Handle(SelectMgr_EntityOwner) anOwner =
929 Handle(SelectMgr_EntityOwner)::DownCast (mySelection->Value());
930 if (anOwner.IsNull() || !anOwner->HasSelectable() || !myFilters->IsOk (anOwner))
933 Handle(AIS_InteractiveObject) aSelectable =
934 Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
935 Unhilight (aSelectable, Standard_False);
937 if (anOwner == aSelectable->GlobalSelOwner())
939 myObjects.ChangeFind (aSelectable)->SetHilightStatus (Standard_False);
943 // added to avoid untimely viewer update...
944 const Handle(SelectMgr_Selection)& aSel = theObject->Selection (0);
948 Handle(SelectMgr_EntityOwner) anOwner =
949 Handle(SelectMgr_EntityOwner)::DownCast (aSel->Sensitive()->BaseSensitive()->OwnerId());
950 mySelection->ClearAndSelect (anOwner);
952 if (anOwner == theObject->GlobalSelOwner())
954 Handle(AIS_GlobalStatus)& aState = myObjects.ChangeFind (theObject);
955 aState->SetHilightStatus (Standard_True);
956 aState->SetHilightColor (mySelectionColor);
958 Quantity_NameOfColor aHiCol;
959 Standard_Boolean hasHiCol = Standard_False;
960 if (IsHilighted (theObject, hasHiCol, aHiCol))
962 if (hasHiCol && aHiCol!= mySelectionColor)
964 HilightWithColor (theObject, mySelectionColor, Standard_False);
969 HilightWithColor (theObject, mySelectionColor, Standard_False);
972 if (theToUpdateViewer)
973 UpdateCurrentViewer();
976 //=======================================================================
977 //function : SetSelected
978 //purpose : Sets the whole object as selected and highlights it with selection color
979 //=======================================================================
980 void AIS_InteractiveContext::SetSelected (const Handle(SelectMgr_EntityOwner)& theOwner,
981 const Standard_Boolean theToUpdateViewer)
983 if (theOwner.IsNull() || !theOwner->HasSelectable() || !myFilters->IsOk (theOwner))
986 const Handle(AIS_InteractiveObject) anObject =
987 Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
989 if (NbSelected() == 1 && theOwner->IsSelected())
991 Quantity_NameOfColor aCustomColor;
992 Standard_Boolean isCustomColorSet;
993 if (IsHilighted (theOwner, isCustomColorSet, aCustomColor))
995 if (isCustomColorSet && aCustomColor != mySelectionColor)
997 const Standard_Integer aHiMode = anObject->HasHilightMode() ? anObject->HilightMode() : 0;
998 theOwner->HilightWithColor (myMainPM, mySelectionColor, aHiMode);
1004 if (!myObjects.IsBound (anObject))
1005 Display (anObject, Standard_False);
1007 unhighlightSelected();
1009 mySelection->ClearAndSelect (theOwner);
1010 theOwner->State (1);
1011 Quantity_NameOfColor aCustomColor;
1012 Standard_Boolean isCustomColorSet;
1013 if (!IsHilighted (theOwner, isCustomColorSet, aCustomColor) || (isCustomColorSet && aCustomColor!= mySelectionColor))
1015 highlightSelected (theOwner, mySelectionColor);
1018 if (theOwner == anObject->GlobalSelOwner())
1020 Handle(AIS_GlobalStatus)& aState = myObjects.ChangeFind (anObject);
1021 aState->SetHilightStatus (Standard_True);
1022 aState->SetHilightColor (mySelectionColor);
1025 if (theToUpdateViewer)
1026 UpdateCurrentViewer();
1029 //=======================================================================
1030 //function : AddOrRemoveSelected
1031 //purpose : Adds or removes current object from AIS selection and highlights/unhighlights it.
1032 // Since this method makes sence only for neutral point selection of a whole object,
1033 // if 0 selection of the object is empty this method simply does nothing.
1034 //=======================================================================
1035 void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(AIS_InteractiveObject)& theObject,
1036 const Standard_Boolean theToUpdateViewer)
1038 if (theObject.IsNull())
1041 if (HasOpenedContext())
1042 return myLocalContexts (myCurLocalIndex)->AddOrRemoveSelected (theObject, theToUpdateViewer);
1044 const Standard_Integer aGlobalSelMode = theObject->GlobalSelectionMode();
1045 if (!myObjects.IsBound (theObject) || !theObject->HasSelection (aGlobalSelMode))
1048 if (!theObject->HasInteractiveContext())
1049 theObject->SetContext (this);
1051 const Handle(SelectMgr_EntityOwner) anOwner = theObject->GlobalSelOwner();
1053 if (anOwner.IsNull() || !anOwner->HasSelectable())
1056 AddOrRemoveSelected (anOwner, theToUpdateViewer);
1058 //=======================================================================
1059 //function : AddOrRemoveSelected
1061 //=======================================================================
1063 void AIS_InteractiveContext::AddOrRemoveSelected (const TopoDS_Shape& aShap,
1064 const Standard_Boolean updateviewer)
1066 if(!HasOpenedContext()) {
1068 cout<<" Attempt to remove a selected shape with no opened local context"<<endl;
1073 myLocalContexts(myCurLocalIndex)->AddOrRemoveSelected(aShap,updateviewer);
1074 if(updateviewer) UpdateCurrentViewer();
1078 //=======================================================================
1079 //function : AddOrRemoveSelected
1080 //purpose : Allows to highlight or unhighlight the owner given depending on
1081 // its selection status
1082 //=======================================================================
1083 void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(SelectMgr_EntityOwner)& theOwner,
1084 const Standard_Boolean theToUpdateViewer)
1086 if (HasOpenedContext())
1087 return myLocalContexts(myCurLocalIndex)->AddOrRemoveSelected (theOwner, theToUpdateViewer);
1089 if (theOwner.IsNull() || !theOwner->HasSelectable())
1092 AIS_SelectStatus aSelStat = mySelection->Select (theOwner);
1094 Standard_Integer aState = aSelStat == AIS_SS_Added ? 1 : 0;
1095 theOwner->State (aState);
1096 const Handle(AIS_InteractiveObject) anObj =
1097 Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
1098 const Standard_Boolean isGlobal = anObj->GlobalSelOwner() == theOwner;
1099 Handle(AIS_GlobalStatus)& aStatus = myObjects.ChangeFind (anObj);
1100 const Standard_Integer aHiMode = anObj->HasHilightMode() ? anObj->HilightMode() : 0;
1103 highlightSelected (theOwner, mySelectionColor);
1106 aStatus->SetHilightStatus (Standard_True);
1107 aStatus->SetHilightColor (mySelectionColor);
1112 if (theOwner->IsAutoHilight())
1113 theOwner->Unhilight (myMainPM, aHiMode);
1115 anObj->ClearSelected();
1116 aStatus->SetHilightStatus (Standard_False);
1117 aStatus->SetHilightColor (Quantity_NOC_WHITE);
1120 if (theToUpdateViewer)
1121 UpdateCurrentViewer();
1125 //=======================================================================
1126 //function : IsSelected
1128 //=======================================================================
1129 Standard_Boolean AIS_InteractiveContext::IsSelected (const Handle(AIS_InteractiveObject)& theObj) const
1131 if(HasOpenedContext())
1132 return myLocalContexts(myCurLocalIndex)->IsSelected (theObj);
1134 if (theObj.IsNull() || !myObjects.IsBound (theObj))
1135 return Standard_False;
1137 const Standard_Integer aGlobalSelMode = theObj->GlobalSelectionMode();
1138 const TColStd_ListOfInteger& anActivatedModes = myObjects (theObj)->SelectionModes();
1139 Standard_Boolean isGlobalModeActivated = Standard_False;
1140 for (TColStd_ListIteratorOfListOfInteger aModeIter (anActivatedModes); aModeIter.More(); aModeIter.Next())
1142 if (aModeIter.Value() == aGlobalSelMode)
1144 isGlobalModeActivated = Standard_True;
1148 if (!theObj->HasSelection (aGlobalSelMode) || !isGlobalModeActivated || theObj->GlobalSelOwner().IsNull())
1149 return Standard_False;
1151 return theObj->GlobalSelOwner()->State() == 1;
1154 //=======================================================================
1155 //function : IsSelected
1156 //purpose : Returns true is the owner given is selected
1157 //=======================================================================
1158 Standard_Boolean AIS_InteractiveContext::IsSelected (const Handle(SelectMgr_EntityOwner)& theOwner) const
1160 if (HasOpenedContext())
1161 return myLocalContexts(myCurLocalIndex)->IsSelected (theOwner);
1163 if (theOwner.IsNull())
1164 return Standard_False;
1166 return theOwner->IsSelected();
1169 //=======================================================================
1170 //function : InitSelected
1172 //=======================================================================
1173 void AIS_InteractiveContext::InitSelected()
1175 if (HasOpenedContext())
1177 myLocalContexts (myCurLocalIndex)->InitSelected();
1181 mySelection->Init();
1184 //=======================================================================
1185 //function : MoreSelected
1187 //=======================================================================
1188 Standard_Boolean AIS_InteractiveContext::MoreSelected() const
1190 if (HasOpenedContext())
1191 return myLocalContexts (myCurLocalIndex)->MoreSelected();
1193 return mySelection->More();
1196 //=======================================================================
1197 //function : NextSelected
1199 //=======================================================================
1200 void AIS_InteractiveContext::NextSelected()
1202 if(HasOpenedContext())
1204 return myLocalContexts (myCurLocalIndex)->NextSelected();
1208 mySelection->Next();
1211 //=======================================================================
1212 //function : HasSelectedShape
1214 //=======================================================================
1215 Standard_Boolean AIS_InteractiveContext::HasSelectedShape() const
1217 if(HasOpenedContext())
1219 return myLocalContexts(myCurLocalIndex)->HasSelectedShape();
1222 Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (SelectedInteractive());
1223 return !aShape.IsNull();
1226 //=======================================================================
1227 //function : SelectedShape
1229 //=======================================================================
1230 TopoDS_Shape AIS_InteractiveContext::SelectedShape() const
1232 if (HasOpenedContext())
1234 return myLocalContexts (myCurLocalIndex)->SelectedShape();
1237 if (mySelection->Extent() == 0)
1238 return TopoDS_Shape();
1240 const Handle(StdSelect_BRepOwner) anOwner =
1241 Handle(StdSelect_BRepOwner)::DownCast (mySelection->Value());
1242 if (!anOwner->HasSelectable())
1243 return TopoDS_Shape();
1245 return anOwner->Shape().Located (anOwner->Location() * anOwner->Shape().Location());
1248 //=======================================================================
1249 //function : SelectedInteractive
1251 //=======================================================================
1252 Handle(AIS_InteractiveObject) AIS_InteractiveContext::SelectedInteractive() const
1254 if (HasOpenedContext())
1256 return myLocalContexts(myCurLocalIndex)->SelectedInteractive();
1259 const Handle(SelectMgr_EntityOwner) anOwner =
1260 Handle(SelectMgr_EntityOwner)::DownCast (mySelection->Value());
1261 if (anOwner.IsNull() || !anOwner->HasSelectable())
1264 return Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
1266 //=======================================================================
1267 //function : SelectedOwner
1269 //=======================================================================
1270 Handle(SelectMgr_EntityOwner) AIS_InteractiveContext::SelectedOwner() const
1272 if(HasOpenedContext())
1274 return myLocalContexts(myCurLocalIndex)->SelectedOwner();
1277 return mySelection->Extent() > 0 ?
1278 Handle(SelectMgr_EntityOwner)::DownCast (mySelection->Value()) : NULL;
1281 //=======================================================================
1282 //function : EntityOwners
1284 //=======================================================================
1285 void AIS_InteractiveContext::EntityOwners(Handle(SelectMgr_IndexedMapOfOwner)& theOwners,
1286 const Handle(AIS_InteractiveObject)& theIObj,
1287 const Standard_Integer theMode) const
1289 if ( theIObj.IsNull() )
1292 TColStd_ListOfInteger aModes;
1293 if ( theMode == -1 )
1294 ActivatedModes( theIObj, aModes );
1296 aModes.Append( theMode );
1298 if (theOwners.IsNull())
1299 theOwners = new SelectMgr_IndexedMapOfOwner();
1301 TColStd_ListIteratorOfListOfInteger anItr( aModes );
1302 for (; anItr.More(); anItr.Next() )
1304 int aMode = anItr.Value();
1305 if ( !theIObj->HasSelection( aMode ) )
1308 Handle(SelectMgr_Selection) aSel = theIObj->Selection(aMode);
1310 for ( aSel->Init(); aSel->More(); aSel->Next() )
1312 Handle(SelectBasics_SensitiveEntity) aEntity = aSel->Sensitive()->BaseSensitive();
1313 if ( aEntity.IsNull() )
1316 Handle(SelectMgr_EntityOwner) aOwner =
1317 Handle(SelectMgr_EntityOwner)::DownCast(aEntity->OwnerId());
1318 if ( !aOwner.IsNull() )
1319 theOwners->Add( aOwner );
1324 //=======================================================================
1325 //function : NbSelected
1327 //=======================================================================
1328 Standard_Integer AIS_InteractiveContext::NbSelected()
1330 Standard_Integer aNbSelected = 0;
1331 for (InitSelected(); MoreSelected(); NextSelected())
1339 //=======================================================================
1340 //function : HasApplicative
1342 //=======================================================================
1343 Standard_Boolean AIS_InteractiveContext::HasApplicative() const
1345 return SelectedInteractive()->HasOwner();
1348 //=======================================================================
1349 //function : Applicative
1351 //=======================================================================
1352 Handle(Standard_Transient) AIS_InteractiveContext::Applicative() const
1354 return SelectedInteractive()->GetOwner();
1357 //==================================================
1358 // Function: HasDetected
1360 //==================================================
1361 Standard_Boolean AIS_InteractiveContext::HasDetected() const
1363 if(HasOpenedContext())
1364 return myLocalContexts(myCurLocalIndex)->HasDetected();
1366 return !myLastPicked.IsNull();
1369 //=======================================================================
1370 //function : HasDetectedShape
1372 //=======================================================================
1374 Standard_Boolean AIS_InteractiveContext::HasDetectedShape() const
1376 if(HasOpenedContext())
1377 return myLocalContexts(myCurLocalIndex)->HasDetectedShape();
1378 return Standard_False;
1381 //=======================================================================
1382 //function : DetectedShape
1384 //=======================================================================
1387 AIS_InteractiveContext::DetectedShape() const
1389 return myLocalContexts(myCurLocalIndex)->DetectedShape();
1392 //=======================================================================
1393 //function : DetectedInteractive
1395 //=======================================================================
1396 Handle(AIS_InteractiveObject) AIS_InteractiveContext::DetectedInteractive() const
1398 if (HasOpenedContext())
1399 return myLocalContexts(myCurLocalIndex)->DetectedInteractive();
1401 return Handle(AIS_InteractiveObject)::DownCast (myLastPicked->Selectable());
1405 Standard_Boolean AIS_InteractiveContext::HasNextDetected() const
1407 if(!HasOpenedContext())
1408 return Standard_False; // temporaire
1410 return myLocalContexts(myCurLocalIndex)->HasNextDetected();
1415 //=======================================================================
1416 //function : DetectedOwner
1418 //=======================================================================
1419 Handle(SelectMgr_EntityOwner) AIS_InteractiveContext::DetectedOwner() const
1421 if (HasOpenedContext())
1422 return myLocalContexts(myCurLocalIndex)->DetectedOwner();
1424 return myLastPicked;
1427 //=======================================================================
1428 //function : HilightNextDetected
1430 //=======================================================================
1431 Standard_Integer AIS_InteractiveContext::HilightNextDetected (const Handle(V3d_View)& theView,
1432 const Standard_Boolean theToRedrawImmediate)
1434 return HasOpenedContext()
1435 ? myLocalContexts (myCurLocalIndex)->HilightNextDetected (theView, theToRedrawImmediate)
1440 //=======================================================================
1441 //function : HilightNextDetected
1443 //=======================================================================
1444 Standard_Integer AIS_InteractiveContext::HilightPreviousDetected (const Handle(V3d_View)& theView,
1445 const Standard_Boolean theToRedrawImmediate)
1447 return HasOpenedContext()
1448 ? myLocalContexts (myCurLocalIndex)->HilightPreviousDetected (theView, theToRedrawImmediate)
1453 //=======================================================================
1454 //function : InitDetected
1456 //=======================================================================
1457 void AIS_InteractiveContext::InitDetected()
1459 if (HasOpenedContext())
1461 myLocalContexts(myCurLocalIndex)->InitDetected();
1465 if(myAISDetectedSeq.Length() != 0)
1467 myAISCurDetected = 1;
1471 //=======================================================================
1472 //function : MoreDetected
1474 //=======================================================================
1475 Standard_Boolean AIS_InteractiveContext::MoreDetected() const
1477 if (HasOpenedContext())
1479 return myLocalContexts(myCurLocalIndex)->MoreDetected();
1482 return (myAISCurDetected > 0 && myAISCurDetected <= myAISDetectedSeq.Length()) ?
1483 Standard_True : Standard_False;
1486 //=======================================================================
1487 //function : NextDetected
1489 //=======================================================================
1490 void AIS_InteractiveContext::NextDetected()
1492 if(HasOpenedContext())
1494 myLocalContexts(myCurLocalIndex)->NextDetected();
1501 //=======================================================================
1502 //function : DetectedCurrentShape
1504 //=======================================================================
1505 const TopoDS_Shape& AIS_InteractiveContext::DetectedCurrentShape() const
1507 if (HasOpenedContext())
1509 return myLocalContexts(myCurLocalIndex)->DetectedCurrentShape();
1512 Handle(AIS_Shape) aCurrentShape = Handle(AIS_Shape)::DownCast (DetectedCurrentObject());
1514 if (aCurrentShape.IsNull())
1516 return AIS_myDummyShape;
1519 return aCurrentShape->Shape();
1522 //=======================================================================
1523 //function : DetectedCurrentObject
1525 //=======================================================================
1526 Handle(AIS_InteractiveObject) AIS_InteractiveContext::DetectedCurrentObject() const
1528 if (HasOpenedContext())
1530 return myLocalContexts(myCurLocalIndex)->DetectedCurrentObject();
1533 return MoreDetected() ? myAISDetectedSeq(myAISCurDetected) : NULL;
1536 //=======================================================================
1537 //function : FirstSelectedObject
1539 //=======================================================================
1540 Handle(AIS_InteractiveObject) AIS_InteractiveContext::FirstSelectedObject()
1542 Handle(AIS_InteractiveObject) anObject;
1544 if (HasOpenedContext())
1550 return SelectedInteractive();
1555 //=======================================================================
1556 //function : RedrawImmediate
1557 //purpose : Redisplays immediate strucures of the viewer given according to their visibility
1558 //=======================================================================
1559 void AIS_InteractiveContext::RedrawImmediate (const Handle(V3d_Viewer)& theViewer)
1561 myMainPM->RedrawImmediate (theViewer);