1 // Created on: 1996-12-18
2 // Created by: Robert COUBLANC
3 // Copyright (c) 1996-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
22 // Modified : 22/03/04 ; SAN : OCC4895 High-level interface for controlling polygon offsets
24 #define BUC60577 //GG_101099 Enable to compute correctly
25 // transparency with more than one object in the view.
27 #define GER61351 //GG_171199 Enable to set an object RGB color
28 // instead a restricted object NameOfColor.
29 // Add SetCurrentFacingModel() method
31 #define G003 //EUG/GG 260100 DEgenerate mode support
32 // Add SetDegenerateModel() methods
34 #define IMP020200 //GG Add SetTransformation() method
36 #define IMP140200 //GG Add HasPresentation() and Presentation() methods
37 // Add SetAspect() method.
39 #define BUC60632 //GG 15/03/00 Add protection on SetDisplayMode()
40 // method, compute only authorized presentation.
42 #define IMP220501 //GG CADPAK_V2 Update selection properly
44 #define OCC708 //SAV unsetting transformation correctly
46 #include <AIS_InteractiveObject.ixx>
48 #include <Aspect_PolygonOffsetMode.hxx>
49 #include <Prs3d_ShadingAspect.hxx>
50 #include <Prs3d_LineAspect.hxx>
51 #include <Prs3d_PointAspect.hxx>
52 #include <Prs3d_TextAspect.hxx>
53 #include <Prs3d_Presentation.hxx>
54 #include <Prs3d_Root.hxx>
55 #include <PrsMgr_ModedPresentation.hxx>
56 #include <PrsMgr_PresentationManager3d.hxx>
57 #include <TColStd_ListIteratorOfListOfInteger.hxx>
58 #include <AIS_GraphicTool.hxx>
59 #include <Graphic3d_AspectFillArea3d.hxx>
60 #include <Graphic3d_AspectLine3d.hxx>
61 #include <Graphic3d_AspectMarker3d.hxx>
62 #include <Graphic3d_AspectText3d.hxx>
63 #include <Graphic3d_Group.hxx>
64 #include <Graphic3d_Structure.hxx>
67 //=======================================================================
68 //function : AIS_InteractiveObject
70 //=======================================================================
72 AIS_InteractiveObject::
73 AIS_InteractiveObject(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d):
74 SelectMgr_SelectableObject(aTypeOfPresentation3d),
75 myDrawer(new AIS_Drawer()),
77 myOwnColor(Quantity_NOC_WHITE),
78 myOwnMaterial(Graphic3d_NOM_DEFAULT),
81 myInfiniteState(Standard_False),
82 hasOwnColor(Standard_False),
83 hasOwnMaterial(Standard_False),
84 myCurrentFacingModel(Aspect_TOFM_BOTH_SIDE),
85 myRecomputeEveryPrs(Standard_True),
91 myHasTransformation(Standard_False)
93 Handle (AIS_InteractiveContext) Bid;
94 myCTXPtr = Bid.operator->();
96 SetCurrentFacingModel();
100 //=======================================================================
101 //function : Redisplay
103 //=======================================================================
105 void AIS_InteractiveObject::Redisplay(const Standard_Boolean AllModes)
111 //=======================================================================
114 //=======================================================================
116 AIS_KindOfInteractive AIS_InteractiveObject::Type() const
117 {return AIS_KOI_None;}
119 //=======================================================================
120 //function : Signature
122 //=======================================================================
124 Standard_Integer AIS_InteractiveObject::Signature() const
127 //=======================================================================
128 //function : RecomputeEveryPrs
130 //=======================================================================
132 Standard_Boolean AIS_InteractiveObject::RecomputeEveryPrs() const
133 {return myRecomputeEveryPrs;}
135 //=======================================================================
138 //=======================================================================
139 Standard_Boolean AIS_InteractiveObject::HasInteractiveContext() const
141 Handle (AIS_InteractiveContext) aNull;
142 return (myCTXPtr != aNull.operator->());
145 //=======================================================================
148 //=======================================================================
149 Handle(AIS_InteractiveContext) AIS_InteractiveObject::GetContext() const
154 //=======================================================================
157 //=======================================================================
158 void AIS_InteractiveObject::SetContext(const Handle(AIS_InteractiveContext)& aCtx)
160 myCTXPtr = aCtx.operator->();
161 if (myDrawer.IsNull()) {
162 myDrawer = new AIS_Drawer;
164 cout << "AIS_InteractiveObject::SetContext DRAWER NUL!" << endl;
167 myDrawer->Link(aCtx->DefaultDrawer());
170 //=======================================================================
173 //=======================================================================
174 Standard_Boolean AIS_InteractiveObject::HasOwner() const
176 return (!myOwner.IsNull());
181 //=======================================================================
184 //=======================================================================
185 void AIS_InteractiveObject::ClearOwner()
190 //=======================================================================
193 //=======================================================================
194 Standard_Boolean AIS_InteractiveObject::HasUsers() const
196 return (!myUsers.IsEmpty());
200 //=======================================================================
203 //=======================================================================
204 void AIS_InteractiveObject::AddUser(const Handle(Standard_Transient)& aUser)
206 myUsers.Append(aUser);
209 //=======================================================================
212 //=======================================================================
213 void AIS_InteractiveObject::ClearUsers()
219 //=======================================================================
222 //=======================================================================
223 void AIS_InteractiveObject::SetDisplayMode(const Standard_Integer aMode)
226 if( AcceptDisplayMode(aMode) )
228 myDisplayMode = aMode;
232 //=======================================================================
235 //=======================================================================
236 void AIS_InteractiveObject::SetSelectionMode(const Standard_Integer aMode)
238 mySelectionMode = aMode;
243 //=======================================================================
246 //=======================================================================
248 void AIS_InteractiveObject::SetCurrentFacingModel(const Aspect_TypeOfFacingModel aModel) {
249 myCurrentFacingModel = aModel;
252 //=======================================================================
253 //function : CurrentFacingModel
255 //=======================================================================
257 Aspect_TypeOfFacingModel AIS_InteractiveObject::CurrentFacingModel() const {
258 return myCurrentFacingModel;
262 //=======================================================================
263 //function : SetColor
265 //=======================================================================
267 void AIS_InteractiveObject::SetColor(const Quantity_NameOfColor aColor)
270 SetColor(Quantity_Color(aColor));
273 //=======================================================================
274 //function : SetColor
276 //=======================================================================
278 void AIS_InteractiveObject::SetColor(const Quantity_Color &aColor)
282 hasOwnColor = Standard_True;
285 //=======================================================================
286 //function : UnsetColor
288 //=======================================================================
289 void AIS_InteractiveObject::UnsetColor()
291 hasOwnColor = Standard_False;
294 //=======================================================================
297 //=======================================================================
298 void AIS_InteractiveObject::SetWidth(const Standard_Real aValue)
303 //=======================================================================
306 //=======================================================================
307 void AIS_InteractiveObject::UnsetWidth()
313 //=======================================================================
316 //=======================================================================
318 void AIS_InteractiveObject::SetMaterial(const Graphic3d_NameOfMaterial aName)
319 //void AIS_InteractiveObject::SetMaterial(const Graphic3d_NameOfPhysicalMaterial aName)
321 if( HasColor() || IsTransparent() || HasMaterial() )
323 myDrawer->ShadingAspect()->SetMaterial(aName);
327 myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
329 myDrawer->ShadingAspect()->SetMaterial(aName);
330 #ifndef BUC60577 //???
331 myDrawer->ShadingAspect()->SetColor(AIS_GraphicTool::GetInteriorColor(myDrawer->Link()));
334 myOwnMaterial = aName;
335 hasOwnMaterial = Standard_True;
337 //=======================================================================
338 //function : SetMaterial
340 //=======================================================================
342 void AIS_InteractiveObject::SetMaterial(const Graphic3d_MaterialAspect& aMat)
345 if( HasColor() || IsTransparent() || HasMaterial() )
347 if(hasOwnColor ||(myTransparency==0.0) || hasOwnMaterial )
350 myDrawer->ShadingAspect()->SetMaterial(aMat);
354 myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
355 myDrawer->ShadingAspect()->SetMaterial(aMat);
357 hasOwnMaterial = Standard_True;
360 //=======================================================================
363 //=======================================================================
364 void AIS_InteractiveObject::UnsetMaterial()
367 if( !HasMaterial() ) return;
368 if( HasColor() || IsTransparent()) {
369 myDrawer->ShadingAspect()->SetMaterial(
370 AIS_GraphicTool::GetMaterial(myDrawer->Link()));
371 if( HasColor() ) SetColor(myOwnColor);
372 if( IsTransparent() ) SetTransparency(myTransparency);
375 if(!hasOwnMaterial) return;
376 if(hasOwnColor ||(myTransparency==0.0))
378 myDrawer->ShadingAspect()->SetMaterial(AIS_GraphicTool::GetMaterial(myDrawer->Link()));
382 Handle(Prs3d_ShadingAspect) SA;
383 myDrawer->SetShadingAspect(SA);
385 hasOwnMaterial = Standard_False;
388 //=======================================================================
389 //function : SetTransparency
391 //=======================================================================
392 void AIS_InteractiveObject::SetTransparency(const Standard_Real aValue)
395 #ifdef BUC60577 // Back & Front material can be different !
397 if(!HasColor() && !IsTransparent() && !HasMaterial() ) {
398 myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
399 if(!myDrawer->Link().IsNull())
400 myDrawer->ShadingAspect()->SetMaterial(AIS_GraphicTool::GetMaterial(myDrawer->Link()));
402 Graphic3d_MaterialAspect FMat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
403 Graphic3d_MaterialAspect BMat = myDrawer->ShadingAspect()->Aspect()->BackMaterial();
404 FMat.SetTransparency(aValue); BMat.SetTransparency(aValue);
405 myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(FMat);
406 myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(BMat);
408 if(aValue<0.0 || aValue>1.0) return;
417 if(hasOwnColor || hasOwnMaterial || myTransparency> 0.0)
419 Graphic3d_MaterialAspect Mat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
420 Mat.SetTransparency(aValue);
421 myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(Mat);
422 myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(Mat);
426 myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
427 if(!myDrawer->Link().IsNull())
428 myDrawer->ShadingAspect()->SetMaterial(AIS_GraphicTool::GetMaterial(myDrawer->Link()));
429 Graphic3d_MaterialAspect Mat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
430 Mat.SetTransparency(aValue);
431 myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(Mat);
432 myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(Mat);
435 myTransparency = aValue;
438 //=======================================================================
439 //function : UnsetTransparency
441 //=======================================================================
442 void AIS_InteractiveObject::UnsetTransparency()
444 #ifdef BUC60577 // Back & Front material can be different !
445 if(HasColor() || HasMaterial() )
447 Graphic3d_MaterialAspect FMat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
448 Graphic3d_MaterialAspect BMat = myDrawer->ShadingAspect()->Aspect()->BackMaterial();
449 FMat.SetTransparency(0.); BMat.SetTransparency(0.);
450 myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(FMat);
451 myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(BMat);
454 if(hasOwnColor || hasOwnMaterial )
456 Graphic3d_MaterialAspect Mat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
457 Mat.SetTransparency(0.0);
458 // myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(Mat);
459 // myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(Mat);
460 myDrawer->ShadingAspect()->SetMaterial(Mat);
464 Handle (Prs3d_ShadingAspect) SA;
465 myDrawer->SetShadingAspect(SA);
469 //=======================================================================
470 //function : Transparency
472 //=======================================================================
473 Standard_Real AIS_InteractiveObject::Transparency() const
475 return (myTransparency<=0.05 ? 0 : myTransparency);
476 // Graphic3d_MaterialAspect Mat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
477 // return Mat.Transparency();
480 //=======================================================================
481 //function : SetAttributes
483 //=======================================================================
485 void AIS_InteractiveObject::SetAttributes(const Handle(AIS_Drawer)& aDrawer)
486 {myDrawer = aDrawer;}
489 //=======================================================================
490 //function : UnsetAttributes
492 //=======================================================================
493 void AIS_InteractiveObject::UnsetAttributes()
495 Handle(AIS_Drawer) dr = new AIS_Drawer();
496 if(myDrawer->HasLink())
497 dr->Link(myDrawer->Link());
499 hasOwnColor = Standard_False;
500 hasOwnMaterial = Standard_False;
502 myTransparency = 0.0;
505 //=======================================================================
508 //=======================================================================
509 void AIS_InteractiveObject::MustRecomputePrs(const Standard_Integer ) const
512 //=======================================================================
515 //=======================================================================
516 const TColStd_ListOfInteger& AIS_InteractiveObject::ListOfRecomputeModes() const
517 {return myToRecomputeModes;}
519 //=======================================================================
522 //=======================================================================
523 void AIS_InteractiveObject::SetRecomputeOk()
524 {myToRecomputeModes.Clear();}
527 //=======================================================================
528 //function : AcceptDisplayMode
530 //=======================================================================
532 Standard_Boolean AIS_InteractiveObject::AcceptDisplayMode(const Standard_Integer ) const
533 {return Standard_True;}
535 //=======================================================================
536 //function : DefaultDisplayMode
538 //=======================================================================
540 Standard_Integer AIS_InteractiveObject::DefaultDisplayMode() const
544 //=======================================================================
545 //function : SetInfiniteState
547 //=======================================================================
548 void AIS_InteractiveObject::SetInfiniteState(const Standard_Boolean aFlag)
550 myInfiniteState = aFlag;
551 Handle(Prs3d_Presentation) P;
553 for(Standard_Integer i =1; i<=myPresentations.Length();i++){
554 P = Handle(Prs3d_Presentation)::DownCast(myPresentations(i).Presentation());
556 P->SetInfiniteState(myInfiniteState);}
560 //=======================================================================
561 //function : SetDegenerateModel
563 //=======================================================================
564 void AIS_InteractiveObject::SetDegenerateModel(
565 const Aspect_TypeOfDegenerateModel aModel,
566 const Quantity_Ratio aRatio ) {
567 if( !HasColor() && !IsTransparent() && !HasMaterial() ) {
568 myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
571 myDrawer->ShadingAspect()->Aspect()->SetDegenerateModel(aModel,aRatio);
573 if(!GetContext().IsNull()){
574 if( GetContext()->MainPrsMgr()->HasPresentation(this,1)){
575 Handle(Prs3d_Presentation) P =
576 GetContext()->MainPrsMgr()->CastPresentation(this,1)->Presentation();
577 Handle(Graphic3d_AspectFillArea3d) a4bis =
578 myDrawer->ShadingAspect()->Aspect();
579 P->SetPrimitivesAspect(a4bis);
584 //=======================================================================
585 //function : DegenerateModel
587 //=======================================================================
589 Aspect_TypeOfDegenerateModel AIS_InteractiveObject::DegenerateModel(
590 Quantity_Ratio& aRatio) const
592 return myDrawer->ShadingAspect()->Aspect()->DegenerateModel(aRatio);
597 //=======================================================================
598 //function : SetTransformation
600 //=======================================================================
601 void AIS_InteractiveObject::SetTransformation(const Handle(Geom_Transformation)& aTrsf, const Standard_Boolean postConcatenate, const Standard_Boolean updateSelection) {
603 if(!GetContext().IsNull()){
604 const PrsMgr_Presentations& prs = Presentations();
605 Handle(Prs3d_Presentation) P;
606 Standard_Integer mode;
607 myHasTransformation = Standard_True;
608 for( Standard_Integer i=1 ; i<=prs.Length() ; i++ ) {
609 mode = prs(i).Mode();
610 P = GetContext()->MainPrsMgr()->CastPresentation(this,mode)->Presentation();
611 if( postConcatenate ) P->Multiply(aTrsf);
612 else P->Transform(aTrsf);
613 if( updateSelection ) {
615 myCTXPtr->ClearSelected(Standard_True);
616 myCTXPtr->RecomputeSelectionOnly(this);
618 if( HasSelection(mode) ) {
619 UpdateSelection(mode);
627 //=======================================================================
628 //function : SetTransformation
630 //=======================================================================
631 void AIS_InteractiveObject::UnsetTransformation() {
633 static Handle(Geom_Transformation) trsf = new Geom_Transformation( gp_Trsf() );
635 Handle(Geom_Transformation) trsf;
638 SetTransformation(trsf); // Set identity transformation
639 myHasTransformation = Standard_False;
642 //=======================================================================
643 //function : Transformation
645 //=======================================================================
646 Handle(Geom_Transformation) AIS_InteractiveObject::Transformation() {
647 Handle(Geom_Transformation) trsf;
649 if(!GetContext().IsNull() ) {
650 const PrsMgr_Presentations& prs = Presentations();
651 if( prs.Length() > 0 ) {
652 Handle(Prs3d_Presentation) P =
653 GetContext()->MainPrsMgr()->CastPresentation(this,1)->Presentation();
654 trsf = P->Transformation();
661 //=======================================================================
662 //function : HasTransformation
664 //=======================================================================
665 Standard_Boolean AIS_InteractiveObject::HasTransformation() const {
667 return myHasTransformation;
672 //=======================================================================
673 //function : HasPresentation
675 //=======================================================================
676 Standard_Boolean AIS_InteractiveObject::HasPresentation() const {
678 if( !GetContext().IsNull() &&
679 GetContext()->MainPrsMgr()->HasPresentation(this,myDisplayMode) ) {
680 return Standard_True;
683 return Standard_False;
686 //=======================================================================
687 //function : Presentation
689 //=======================================================================
690 Handle(Prs3d_Presentation) AIS_InteractiveObject::Presentation() const {
691 Handle(Prs3d_Presentation) prs;
693 if( HasPresentation() ) {
694 prs = GetContext()->MainPrsMgr()->
695 CastPresentation(this,myDisplayMode)->Presentation();
701 //=======================================================================
702 //function : SetAspect
704 //=======================================================================
705 void AIS_InteractiveObject::SetAspect(const Handle(Prs3d_BasicAspect)& anAspect,
706 const Standard_Boolean globalChange) {
708 if( HasPresentation() ) {
709 Handle(Prs3d_Presentation) prs = Presentation();
710 { Handle(Prs3d_ShadingAspect) aspect =
711 Handle(Prs3d_ShadingAspect)::DownCast(anAspect);
712 if( !aspect.IsNull() ) {
713 if( globalChange ) prs->SetPrimitivesAspect(aspect->Aspect());
714 Prs3d_Root::CurrentGroup(prs)->SetGroupPrimitivesAspect(aspect->Aspect());
718 { Handle(Prs3d_LineAspect) aspect =
719 Handle(Prs3d_LineAspect)::DownCast(anAspect);
720 if( !aspect.IsNull() ) {
721 if( globalChange ) prs->SetPrimitivesAspect(aspect->Aspect());
722 Prs3d_Root::CurrentGroup(prs)->SetGroupPrimitivesAspect(aspect->Aspect());
726 { Handle(Prs3d_PointAspect) aspect =
727 Handle(Prs3d_PointAspect)::DownCast(anAspect);
728 if( !aspect.IsNull() ) {
729 if( globalChange ) prs->SetPrimitivesAspect(aspect->Aspect());
730 Prs3d_Root::CurrentGroup(prs)->SetGroupPrimitivesAspect(aspect->Aspect());
734 { Handle(Prs3d_TextAspect) aspect =
735 Handle(Prs3d_TextAspect)::DownCast(anAspect);
736 if( !aspect.IsNull() ) {
737 if( globalChange ) prs->SetPrimitivesAspect(aspect->Aspect());
738 Prs3d_Root::CurrentGroup(prs)->SetGroupPrimitivesAspect(aspect->Aspect());
746 // OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
748 //=======================================================================
749 //function : SetPolygonOffsets
751 //=======================================================================
752 void AIS_InteractiveObject::SetPolygonOffsets(const Standard_Integer aMode,
753 const Standard_ShortReal aFactor,
754 const Standard_ShortReal aUnits)
756 if ( !HasPolygonOffsets() )
757 myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
759 myDrawer->ShadingAspect()->Aspect()->SetPolygonOffsets( aMode, aFactor, aUnits );
761 // Modify existing presentations
762 Handle(Graphic3d_Structure) aStruct;
763 for( Standard_Integer i = 1, n = myPresentations.Length(); i <= n; i++ ) {
764 Handle(PrsMgr_Presentation3d) aPrs3d =
765 Handle(PrsMgr_Presentation3d)::DownCast( myPresentations(i).Presentation() );
766 if ( !aPrs3d.IsNull() ) {
767 aStruct = Handle(Graphic3d_Structure)::DownCast( aPrs3d->Presentation() );
768 if( !aStruct.IsNull() ) {
769 aStruct->SetPrimitivesAspect( myDrawer->ShadingAspect()->Aspect() );
770 // Workaround for issue 23115: Need to update also groups, because their
771 // face aspect ALWAYS overrides the structure's.
772 const Graphic3d_SequenceOfGroup& aGroups = aStruct->Groups();
773 Standard_Integer aGroupIndex = 1, aGroupNb = aGroups.Length();
774 for ( ; aGroupIndex <= aGroupNb; aGroupIndex++ ) {
775 Handle(Graphic3d_Group) aGrp = aGroups.Value(aGroupIndex);
776 if ( !aGrp.IsNull() && aGrp->IsGroupPrimitivesAspectSet(Graphic3d_ASPECT_FILL_AREA) ) {
777 Handle(Graphic3d_AspectFillArea3d) aFaceAsp = new Graphic3d_AspectFillArea3d();
778 Handle(Graphic3d_AspectLine3d) aLineAsp = new Graphic3d_AspectLine3d();
779 Handle(Graphic3d_AspectMarker3d) aPntAsp = new Graphic3d_AspectMarker3d();
780 Handle(Graphic3d_AspectText3d) aTextAsp = new Graphic3d_AspectText3d();
781 // TODO: Add methods for retrieving individual aspects from Graphic3d_Group
782 aGrp->GroupPrimitivesAspect(aLineAsp, aTextAsp, aPntAsp, aFaceAsp);
783 aFaceAsp->SetPolygonOffsets(aMode, aFactor, aUnits);
784 // TODO: Issue 23118 - This line kills texture data in the group...
785 aGrp->SetGroupPrimitivesAspect(aFaceAsp);
794 //=======================================================================
795 //function : HasPolygonOffsets
797 //=======================================================================
798 Standard_Boolean AIS_InteractiveObject::HasPolygonOffsets() const
800 return !( myDrawer->ShadingAspect().IsNull() ||
801 ( !myDrawer->Link().IsNull() &&
802 myDrawer->ShadingAspect() == myDrawer->Link()->ShadingAspect() ) );
805 //=======================================================================
806 //function : PolygonOffsets
808 //=======================================================================
809 void AIS_InteractiveObject::PolygonOffsets(Standard_Integer& aMode,
810 Standard_ShortReal& aFactor,
811 Standard_ShortReal& aUnits) const
813 if( HasPolygonOffsets() )
814 myDrawer->ShadingAspect()->Aspect()->PolygonOffsets( aMode, aFactor, aUnits );
816 // OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets