1 // Created on: 1998-09-30
2 // Created by: Sergey RUIN
3 // Copyright (c) 1998-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_InteractiveContext.hxx>
19 #include <AIS_InteractiveObject.hxx>
20 #include <Standard_GUID.hxx>
21 #include <Standard_NullObject.hxx>
22 #include <Standard_NoMoreObject.hxx>
23 #include <TCollection_ExtendedString.hxx>
24 #include <TDF_Attribute.hxx>
25 #include <TDF_AttributeDelta.hxx>
26 #include <TDF_DefaultDeltaOnModification.hxx>
27 #include <TDF_DefaultDeltaOnRemoval.hxx>
28 #include <TDF_DeltaOnAddition.hxx>
29 #include <TDF_Label.hxx>
30 #include <TDF_RelocationTable.hxx>
31 #include <TDF_Tool.hxx>
32 #include <TPrsStd_AISPresentation.hxx>
33 #include <TColStd_ListOfInteger.hxx>
34 #include <TColStd_ListIteratorOfListOfInteger.hxx>
35 #include <TDataXtd_Presentation.hxx>
36 #include <TPrsStd_AISViewer.hxx>
37 #include <TPrsStd_Driver.hxx>
38 #include <TPrsStd_DriverTable.hxx>
40 IMPLEMENT_STANDARD_RTTIEXT(TPrsStd_AISPresentation,TDF_Attribute)
42 #define NO_MORE_OBJECT "TPrsStd_AISPresentation has no associated TDataXtd_PresentationData"
44 //=======================================================================
45 //function : TPrsStd_AISPresentation
46 //purpose : Constructor
47 //=======================================================================
48 TPrsStd_AISPresentation::TPrsStd_AISPresentation ()
53 //=======================================================================
56 //=======================================================================
57 Handle(TPrsStd_AISPresentation) TPrsStd_AISPresentation::Set
58 ( const TDF_Label& theLabel, const Standard_GUID& theDriver )
60 Handle(TPrsStd_AISPresentation) aPresentation;
61 // create associated data (unless already there)
62 Handle(TDataXtd_Presentation) aData = TDataXtd_Presentation::Set (theLabel, theDriver);
64 throw Standard_NoMoreObject(NO_MORE_OBJECT);
65 if ( !theLabel.FindAttribute(TPrsStd_AISPresentation::GetID(), aPresentation) )
67 aPresentation = new TPrsStd_AISPresentation();
68 theLabel.AddAttribute(aPresentation);
74 //=======================================================================
77 //=======================================================================
78 Handle(TPrsStd_AISPresentation) TPrsStd_AISPresentation::Set(const Handle(TDF_Attribute)& theMaster)
80 return TPrsStd_AISPresentation::Set(theMaster->Label(), theMaster->ID());
83 //=======================================================================
86 //=======================================================================
87 void TPrsStd_AISPresentation::Unset (const TDF_Label& theLabel)
89 Handle(TPrsStd_AISPresentation) aPresentation;
90 if ( theLabel.FindAttribute(TPrsStd_AISPresentation::GetID(), aPresentation) )
91 theLabel.ForgetAttribute(aPresentation);
93 // remove associated data
94 TDataXtd_Presentation::Unset (theLabel);
97 //=======================================================================
100 //=======================================================================
101 Handle(TDataXtd_Presentation) TPrsStd_AISPresentation::getData () const
103 Handle(TDataXtd_Presentation) aData;
104 if (!Label().FindAttribute(TDataXtd_Presentation::GetID(), aData))
105 throw Standard_NoMoreObject(NO_MORE_OBJECT);
109 //=======================================================================
112 //=======================================================================
113 const Standard_GUID& TPrsStd_AISPresentation::GetID()
115 static Standard_GUID TPrsStd_AISPresentationID("3680ac6c-47ae-4366-bb94-26abb6e07341");
116 return TPrsStd_AISPresentationID;
119 //=======================================================================
122 //=======================================================================
123 void TPrsStd_AISPresentation::Display(const Standard_Boolean theIsUpdate)
125 if ( theIsUpdate || myAIS.IsNull() )
131 //=======================================================================
134 //=======================================================================
135 void TPrsStd_AISPresentation::Erase(const Standard_Boolean theIsRemove)
139 AISErase(theIsRemove);
143 //=======================================================================
146 //=======================================================================
147 void TPrsStd_AISPresentation::Update()
152 //=======================================================================
153 //function : IsDisplayed
155 //=======================================================================
156 Standard_Boolean TPrsStd_AISPresentation::IsDisplayed() const
158 return getData()->IsDisplayed();
161 //=======================================================================
162 //function : SetDisplayed
164 //=======================================================================
165 void TPrsStd_AISPresentation::SetDisplayed(const Standard_Boolean theIsDisplayed)
167 // this method can be called by AISUpdate() in the process of removal,
168 // while data attribute may be already removed
170 getData()->SetDisplayed(theIsDisplayed);
173 //=======================================================================
174 //function :SetDriverGUID
176 //=======================================================================
177 void TPrsStd_AISPresentation::SetDriverGUID(const Standard_GUID& theGUID)
180 getData()->SetDriverGUID (theGUID);
183 //=======================================================================
184 //function :GetDriverGUID
186 //=======================================================================
187 Standard_GUID TPrsStd_AISPresentation::GetDriverGUID() const
189 return getData()->GetDriverGUID();
192 //=======================================================================
195 //=======================================================================
196 Graphic3d_NameOfMaterial TPrsStd_AISPresentation::Material() const
198 return (Graphic3d_NameOfMaterial)getData()->MaterialIndex();
201 //=======================================================================
202 //function :HasMaterial
204 //=======================================================================
205 Standard_Boolean TPrsStd_AISPresentation::HasOwnMaterial() const
207 return getData()->HasOwnMaterial();
210 //=======================================================================
211 //function : UnsetMaterial
213 //=======================================================================
214 void TPrsStd_AISPresentation::UnsetMaterial()
216 if ( !getData()->HasOwnMaterial() && !myAIS.IsNull() && !myAIS->HasMaterial() )
219 getData()->UnsetMaterial();
221 if ( myAIS.IsNull() )
224 if ( !myAIS.IsNull() && myAIS->HasMaterial() )
226 Handle(AIS_InteractiveContext) aContext = getAISContext();
228 if ( !aContext.IsNull() )
229 aContext->UnsetMaterial(myAIS, Standard_False);
231 myAIS->UnsetMaterial();
236 //=======================================================================
237 //function : SetMaterial
239 //=======================================================================
240 void TPrsStd_AISPresentation::SetMaterial(const Graphic3d_NameOfMaterial theName)
243 if ( getData()->HasOwnMode() && getData()->MaterialIndex() == theName )
244 if ( !myAIS.IsNull() && myAIS->HasMaterial() && myAIS->Material() == theName )
247 getData()->SetMaterialIndex(theName);
249 if ( myAIS.IsNull() )
252 if ( !myAIS.IsNull() )
254 if ( myAIS->HasMaterial() && myAIS->Material() == theName )
255 return; // AIS has already had that material
257 Handle(AIS_InteractiveContext) aContext = getAISContext();
259 if ( !aContext.IsNull() )
260 aContext->SetMaterial(myAIS, theName, Standard_False);
262 myAIS->SetMaterial(theName);
266 //=======================================================================
267 //function :Transparency
269 //=======================================================================
270 Standard_Real TPrsStd_AISPresentation::Transparency() const
272 return getData()->Transparency();
275 //=======================================================================
276 //function :SetTransparency
278 //=======================================================================
279 void TPrsStd_AISPresentation::SetTransparency(const Standard_Real theValue)
282 if (getData()->HasOwnTransparency() && getData()->Transparency() == theValue)
283 if ( !myAIS.IsNull() && myAIS->Transparency() == theValue )
286 getData()->SetTransparency(theValue);
288 if ( myAIS.IsNull() )
291 if ( !myAIS.IsNull() )
293 if ( myAIS->Transparency() == theValue )
294 return; // AIS has already had that transparency
296 Handle(AIS_InteractiveContext) aContext = getAISContext();
298 if ( !aContext.IsNull() )
299 aContext->SetTransparency(myAIS, theValue, Standard_False);
301 myAIS->SetTransparency(theValue);
305 //=======================================================================
306 //function :UnsetTransparency
308 //=======================================================================
309 void TPrsStd_AISPresentation::UnsetTransparency()
311 if (!getData()->HasOwnTransparency())
314 getData()->UnsetTransparency();
316 if ( myAIS.IsNull() )
319 if ( !myAIS.IsNull() )
321 Handle(AIS_InteractiveContext) aContext = getAISContext();
323 if( !aContext.IsNull() )
324 aContext->UnsetTransparency(myAIS, Standard_False);
326 myAIS->UnsetTransparency();
330 //=======================================================================
331 //function : HasTransparency
333 //=======================================================================
334 Standard_Boolean TPrsStd_AISPresentation::HasOwnTransparency() const
336 return getData()->HasOwnTransparency();
339 //=======================================================================
342 //=======================================================================
343 Quantity_NameOfColor TPrsStd_AISPresentation::Color() const
345 return getData()->Color();
348 //=======================================================================
349 //function : HasOwnColor
351 //=======================================================================
352 Standard_Boolean TPrsStd_AISPresentation::HasOwnColor() const
354 return getData()->HasOwnColor();
357 //=======================================================================
358 //function : UnsetColor
360 //=======================================================================
361 void TPrsStd_AISPresentation::UnsetColor()
363 if (!getData()->HasOwnColor() && ! myAIS.IsNull() && !myAIS->HasColor())
365 getData()->UnsetColor();
367 if ( myAIS.IsNull() )
370 if ( !myAIS.IsNull() && myAIS->HasColor() )
372 Handle(AIS_InteractiveContext) aContext = getAISContext();
374 if ( !aContext.IsNull() )
375 aContext->UnsetColor(myAIS, Standard_False);
381 //=======================================================================
382 //function : SetColor
384 //=======================================================================
385 void TPrsStd_AISPresentation::SetColor(const Quantity_NameOfColor theColor)
388 if ( getData()->HasOwnColor() && getData()->Color() == theColor )
389 if ( !myAIS.IsNull() && myAIS->HasColor() && myAIS->Color() == theColor )
392 getData()->SetColor(theColor);
394 if ( myAIS.IsNull() )
397 if ( !myAIS.IsNull() )
399 if ( myAIS->HasColor() && myAIS->Color() == theColor )
400 return; // AIS has already had that color
402 Handle(AIS_InteractiveContext) aContext = getAISContext();
404 if( !aContext.IsNull() )
405 aContext->SetColor(myAIS, theColor, Standard_False);
407 myAIS->SetColor(theColor);
411 //=======================================================================
414 //=======================================================================
415 Standard_Real TPrsStd_AISPresentation::Width() const
417 return getData()->Width();
420 //=======================================================================
421 //function : HasWidth
423 //=======================================================================
424 Standard_Boolean TPrsStd_AISPresentation::HasOwnWidth() const
426 return getData()->HasOwnWidth();
429 //=======================================================================
430 //function : SetWidth
432 //=======================================================================
433 void TPrsStd_AISPresentation::SetWidth(const Standard_Real theWidth)
436 if ( getData()->HasOwnWidth() && getData()->Width() == theWidth )
437 if ( !myAIS.IsNull() && myAIS->HasWidth() && myAIS->Width() == theWidth )
440 getData()->SetWidth(theWidth);
442 if( !myAIS.IsNull() )
444 if ( myAIS->HasWidth() && myAIS->Width() == theWidth )
445 return; // AIS has already had that width
447 Handle(AIS_InteractiveContext) aContext = getAISContext();
449 if( !aContext.IsNull() )
450 aContext->SetWidth(myAIS, theWidth, Standard_False);
452 myAIS->SetWidth(theWidth);
456 //=======================================================================
457 //function : UnsetWidth
459 //=======================================================================
460 void TPrsStd_AISPresentation::UnsetWidth()
462 if ( !getData()->HasOwnWidth() )
463 if ( !myAIS.IsNull() && !myAIS->HasWidth() )
466 getData()->UnsetWidth();
471 if ( !myAIS.IsNull() && myAIS->HasWidth() )
473 Handle(AIS_InteractiveContext) aContext = getAISContext();
475 if ( !aContext.IsNull() )
476 aContext->UnsetWidth(myAIS, Standard_False);
482 //=======================================================================
485 //=======================================================================
486 Standard_Integer TPrsStd_AISPresentation::Mode() const
488 return getData()->Mode();
491 //=======================================================================
492 //function : HasOwnMode
494 //=======================================================================
495 Standard_Boolean TPrsStd_AISPresentation::HasOwnMode() const
497 return getData()->HasOwnMode();
500 //=======================================================================
503 //=======================================================================
504 void TPrsStd_AISPresentation::SetMode(const Standard_Integer theMode)
507 if ( getData()->HasOwnMode() && getData()->Mode() == theMode )
508 if ( !myAIS.IsNull() && myAIS->DisplayMode() == theMode )
511 getData()->SetMode(theMode);
513 if ( myAIS.IsNull() )
516 if ( !myAIS.IsNull() )
518 if ( myAIS->DisplayMode() == theMode )
519 return; // AIS has already had that mode
521 Handle(AIS_InteractiveContext) aContext = getAISContext();
523 if( !aContext.IsNull() )
524 aContext->SetDisplayMode(myAIS, theMode, Standard_False);
526 myAIS->SetDisplayMode(theMode);
530 //=======================================================================
531 //function : UnsetMode
533 //=======================================================================
534 void TPrsStd_AISPresentation::UnsetMode()
536 if ( !getData()->HasOwnMode() )
537 if ( !myAIS.IsNull() && !myAIS->HasDisplayMode() )
540 getData()->UnsetMode();
542 if ( myAIS.IsNull() )
545 if( !myAIS.IsNull() && myAIS->HasDisplayMode() )
547 Handle(AIS_InteractiveContext) aContext = getAISContext();
549 if ( !aContext.IsNull() )
550 aContext->UnsetDisplayMode(myAIS, Standard_False);
552 myAIS->UnsetDisplayMode();
556 //=======================================================================
557 //function : SelectionMode
559 //=======================================================================
560 Standard_Integer TPrsStd_AISPresentation::SelectionMode() const
562 return getData()->SelectionMode();
565 //=======================================================================
566 //function : HasOwnSelectionMode
568 //=======================================================================
569 Standard_Boolean TPrsStd_AISPresentation::HasOwnSelectionMode() const
571 return getData()->HasOwnSelectionMode();
574 //=======================================================================
575 //function : SetSelectionMode
577 //=======================================================================
578 void TPrsStd_AISPresentation::SetSelectionMode(const Standard_Integer theSelectionMode)
581 getData()->SetSelectionMode (theSelectionMode);
585 //=======================================================================
586 //function : UnsetSelectionMode
588 //=======================================================================
589 void TPrsStd_AISPresentation::UnsetSelectionMode()
591 getData()->UnsetSelectionMode ();
595 //=======================================================================
598 //=======================================================================
599 const Standard_GUID& TPrsStd_AISPresentation::ID() const
604 //=======================================================================
605 //function : BackupCopy
607 //=======================================================================
608 Handle(TDF_Attribute) TPrsStd_AISPresentation::BackupCopy() const
610 return new TPrsStd_AISPresentation;
614 //=======================================================================
615 //function : NewEmpty
617 //=======================================================================
618 Handle(TDF_Attribute) TPrsStd_AISPresentation::NewEmpty() const
620 return new TPrsStd_AISPresentation();
623 //=======================================================================
626 //=======================================================================
627 void TPrsStd_AISPresentation::Restore(const Handle(TDF_Attribute)& /*theWith*/)
632 //=======================================================================
635 //=======================================================================
636 void TPrsStd_AISPresentation::Paste (const Handle(TDF_Attribute)& theInto,
637 const Handle(TDF_RelocationTable)& ) const
639 Handle(TPrsStd_AISPresentation) anInto =
640 Handle(TPrsStd_AISPresentation)::DownCast(theInto);
643 if (!anInto->myAIS.IsNull())
645 // Save displayed flag.
646 Standard_Boolean displayed = anInto->IsDisplayed();
647 // Erase the interactive object.
648 anInto->AISErase(Standard_True);
649 // Restore the displayed flag.
651 anInto->SetDisplayed(displayed);
653 // Nullify the interactive object.
654 // It will be restored on the next call to AISUpdate().
655 anInto->myAIS.Nullify();
658 //=======================================================================
659 //function : AfterAddition
660 //purpose : erase if displayed
661 //=======================================================================
662 void TPrsStd_AISPresentation::AfterAddition()
667 //=======================================================================
668 //function : BeforeRemoval
669 //purpose : erase if displayed
670 //=======================================================================
671 void TPrsStd_AISPresentation::BeforeRemoval()
676 //=======================================================================
677 //function : BeforeForget
678 //purpose : erase if displayed
679 //=======================================================================
680 void TPrsStd_AISPresentation::BeforeForget()
682 if ( !myAIS.IsNull() )
683 { // Remove AISObject from context.
684 AISErase(Standard_True);
689 //=======================================================================
690 //function : AfterResume
691 //purpose : display if displayed
692 //=======================================================================
693 void TPrsStd_AISPresentation::AfterResume()
702 //=======================================================================
703 //function : BeforeUndo
704 //purpose : le NamedShape associe doit etre present
705 //=======================================================================
706 Standard_Boolean TPrsStd_AISPresentation::BeforeUndo (const Handle(TDF_AttributeDelta)& AD,
707 const Standard_Boolean )
709 Handle(TPrsStd_AISPresentation) P;
710 AD->Label().FindAttribute(TPrsStd_AISPresentation::GetID(), P);
712 if (AD->IsKind(STANDARD_TYPE(TDF_DeltaOnAddition)))
717 else if (AD->IsKind(STANDARD_TYPE(TDF_DefaultDeltaOnRemoval))) {
719 else if (AD->IsKind(STANDARD_TYPE(TDF_DefaultDeltaOnModification)))
725 return Standard_True;
728 //=======================================================================
729 //function : AfterUndo
730 //purpose : le NamedShape associe doit etre present
731 //=======================================================================
732 Standard_Boolean TPrsStd_AISPresentation::AfterUndo (const Handle(TDF_AttributeDelta)& AD,
733 const Standard_Boolean )
735 Handle(TPrsStd_AISPresentation) P;
736 AD->Label().FindAttribute(TPrsStd_AISPresentation::GetID(), P);
738 if (AD->IsKind(STANDARD_TYPE(TDF_DeltaOnAddition)))
740 else if (AD->IsKind(STANDARD_TYPE(TDF_DefaultDeltaOnRemoval)))
745 else if (AD->IsKind(STANDARD_TYPE(TDF_DefaultDeltaOnModification)))
751 return Standard_True;
754 //=======================================================================
755 //function : AISUpdate
757 //=======================================================================
758 void TPrsStd_AISPresentation::AISUpdate()
762 Handle(AIS_InteractiveContext) aContext;
763 if ( !Label().IsNull() )
765 aContext = getAISContext();
767 Handle(TPrsStd_Driver) aDriver;
768 if ( TPrsStd_DriverTable::Get()->FindDriver(GetDriverGUID(), aDriver) )
771 if ( myAIS.IsNull() )
773 Handle(AIS_InteractiveObject) aNewObj;
774 if ( aDriver->Update(Label(), aNewObj) )
777 aNewObj->SetOwner(this);
782 Handle(AIS_InteractiveObject) anObj = myAIS;
783 if ( aDriver->Update(Label(), anObj) )
784 if ( !(anObj == myAIS) )
786 if ( !aContext.IsNull() )
787 aContext->Remove (myAIS, Standard_True);
789 // Driver has built new AIS.
791 anObj->SetOwner(this);
798 // Apply the visualization settings.
799 if ( !myAIS.IsNull() )
803 Quantity_NameOfColor aColor = Color();
804 if ( !(myAIS->HasColor()) || (myAIS->HasColor() && myAIS->Color() != aColor) )
806 if ( !aContext.IsNull() )
807 aContext->SetColor(myAIS, aColor, Standard_False);
809 myAIS->SetColor(aColor);
813 if ( HasOwnMaterial() )
815 Graphic3d_NameOfMaterial aMaterial = Material();
816 if ( !(myAIS->HasMaterial()) || (myAIS->HasMaterial() && myAIS->Material() != aMaterial) )
818 if ( !aContext.IsNull() )
819 aContext->SetMaterial(myAIS, aMaterial, Standard_False );
821 myAIS->SetMaterial(aMaterial);
825 if ( HasOwnTransparency() )
827 const Standard_Real aTransparency = Transparency();
828 if ( myAIS->Transparency() != aTransparency )
830 if( !aContext.IsNull() )
831 aContext->SetTransparency(myAIS, aTransparency, Standard_False);
833 myAIS->SetTransparency(aTransparency);
839 const Standard_Real aWidth = Width();
840 if ( !(myAIS->HasWidth()) || (myAIS->HasWidth() && myAIS->Width() != aWidth) )
842 if ( !aContext.IsNull() )
843 aContext->SetWidth(myAIS, aWidth, Standard_False);
845 myAIS->SetWidth(aWidth);
851 const Standard_Integer aMode = Mode();
852 if ( myAIS->DisplayMode() != aMode )
853 myAIS->SetDisplayMode(aMode);
856 if ( !aContext.IsNull() && IsDisplayed() )
857 aContext->Redisplay(myAIS, Standard_False);
859 if (HasOwnSelectionMode()) {
860 if (!aContext.IsNull())
862 TColStd_ListOfInteger anActivatedModes;
863 aContext->ActivatedModes (myAIS, anActivatedModes);
864 Standard_Boolean isActivated = Standard_False;
865 Standard_Integer aSelectionMode = SelectionMode();
866 if (aSelectionMode == -1)
868 aContext->Deactivate(myAIS);
872 for (TColStd_ListIteratorOfListOfInteger aModeIter (anActivatedModes); aModeIter.More(); aModeIter.Next())
874 if (aModeIter.Value() == aSelectionMode)
876 isActivated = Standard_True;
881 aContext->Activate (myAIS, aSelectionMode, Standard_False);
888 if (IsDisplayed() && !aContext.IsNull())
889 aContext->Redisplay(myAIS, Standard_False);
892 //=======================================================================
893 //function : AISDisplay
895 //=======================================================================
896 void TPrsStd_AISPresentation::AISDisplay()
898 if ( !Label().IsNull() )
900 Handle(AIS_InteractiveContext) aContext = getAISContext();
902 if ( aContext.IsNull() )
905 if ( !myAIS.IsNull() )
907 if ( !(myAIS->GetContext()).IsNull() && (myAIS->GetContext()) != aContext )
908 myAIS->GetContext()->Remove (myAIS, Standard_False);
910 if ( IsDisplayed() && aContext->IsDisplayed(myAIS) )
913 aContext->Display(myAIS, Standard_False);
915 if ( aContext->IsDisplayed(myAIS) )
916 SetDisplayed(Standard_True);
921 //=======================================================================
922 //function : AISErase
924 //=======================================================================
925 void TPrsStd_AISPresentation::AISErase(const Standard_Boolean theIsRemove)
927 Handle(AIS_InteractiveContext) aContext, anOwnContext;
929 if ( !myAIS.IsNull() )
932 if ( !Label().IsNull() )
934 if (IsAttribute(TDataXtd_Presentation::GetID()))
935 SetDisplayed(Standard_False);
937 Handle(TPrsStd_AISViewer) viewer;
938 if( !TPrsStd_AISViewer::Find(Label(), viewer) )
940 anOwnContext = myAIS->GetContext();
941 aContext = viewer->GetInteractiveContext();
945 if ( !aContext.IsNull() )
946 aContext->Remove(myAIS, Standard_False);
947 if ( !anOwnContext.IsNull() && anOwnContext != aContext )
948 anOwnContext->Remove(myAIS, Standard_False);
950 myAIS->SetToUpdate();
954 if ( !aContext.IsNull() )
955 aContext->Erase(myAIS, Standard_False);
956 if ( !anOwnContext.IsNull() && anOwnContext != aContext )
957 anOwnContext->Erase(myAIS, Standard_False);
964 if ( !anOwnContext.IsNull() )
966 anOwnContext->Remove(myAIS, Standard_False);
967 myAIS->SetToUpdate();
971 if( !anOwnContext.IsNull() )
972 anOwnContext->Erase(myAIS, Standard_False);
977 //=======================================================================
980 //=======================================================================
981 Handle(AIS_InteractiveObject) TPrsStd_AISPresentation::GetAIS() const
986 //=======================================================================
987 //function : getAISContext
989 //=======================================================================
990 Handle(AIS_InteractiveContext) TPrsStd_AISPresentation::getAISContext() const
992 Handle(TPrsStd_AISViewer) aViewer;
993 if ( TPrsStd_AISViewer::Find(Label(), aViewer) )
994 return aViewer->GetInteractiveContext();
996 return Handle_AIS_InteractiveContext();