1 // Created on: 1997-12-16
2 // Created by: Jean Louis Frenkel
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.
17 #include <PrsMgr_PresentableObject.hxx>
19 #include <Graphic3d_AspectFillArea3d.hxx>
20 #include <Prs3d_Drawer.hxx>
21 #include <Prs3d_LineAspect.hxx>
22 #include <Prs3d_PointAspect.hxx>
23 #include <Prs3d_Presentation.hxx>
24 #include <Prs3d_ShadingAspect.hxx>
25 #include <PrsMgr_Presentation.hxx>
26 #include <PrsMgr_PresentationManager.hxx>
27 #include <Standard_NotImplemented.hxx>
28 #include <TColStd_MapOfInteger.hxx>
30 IMPLEMENT_STANDARD_RTTIEXT(PrsMgr_PresentableObject, Standard_Transient)
32 //=======================================================================
33 //function : getIdentityTrsf
35 //=======================================================================
36 const gp_Trsf& PrsMgr_PresentableObject::getIdentityTrsf()
38 static const gp_Trsf THE_IDENTITY_TRSF;
39 return THE_IDENTITY_TRSF;
42 //=======================================================================
43 //function : PrsMgr_PresentableObject
45 //=======================================================================
46 PrsMgr_PresentableObject::PrsMgr_PresentableObject (const PrsMgr_TypeOfPresentation3d theType)
48 myDrawer (new Prs3d_Drawer()),
49 myTypeOfPresentation3d (theType),
51 myCurrentFacingModel (Aspect_TOFM_BOTH_SIDE),
53 hasOwnColor (Standard_False),
54 hasOwnMaterial (Standard_False),
56 myInfiniteState (Standard_False),
57 myIsMutable (Standard_False),
58 myHasOwnPresentations (Standard_True),
59 myToPropagateVisualState (Standard_True)
61 myDrawer->SetDisplayMode (-1);
64 //=======================================================================
65 //function : ~PrsMgr_PresentableObject
66 //purpose : destructor
67 //=======================================================================
68 PrsMgr_PresentableObject::~PrsMgr_PresentableObject()
70 for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
72 // should never happen - assertion can be used
73 const Handle(PrsMgr_Presentation)& aPrs3d = aPrsIter.Value();
75 aPrs3d->myPresentableObject = NULL;
78 for (PrsMgr_ListOfPresentableObjectsIter anIter (myChildren); anIter.More(); anIter.Next())
80 anIter.Value()->SetCombinedParentTransform (Handle(TopLoc_Datum3D)());
81 anIter.Value()->myParent = NULL;
85 //=======================================================================
88 //=======================================================================
89 void PrsMgr_PresentableObject::Fill (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
90 const Handle(PrsMgr_Presentation)& thePrs,
91 const Standard_Integer theMode)
93 const Handle(Prs3d_Presentation)& aStruct3d = thePrs;
94 Compute (thePrsMgr, aStruct3d, theMode);
95 aStruct3d->SetTransformation (myTransformation);
96 aStruct3d->SetClipPlanes (myClipPlanes);
97 aStruct3d->SetTransformPersistence (TransformPersistence());
100 //=======================================================================
101 //function : computeHLR
103 //=======================================================================
104 void PrsMgr_PresentableObject::computeHLR (const Handle(Graphic3d_Camera)& ,
105 const Handle(TopLoc_Datum3D)& ,
106 const Handle(Prs3d_Presentation)& )
108 throw Standard_NotImplemented("cannot compute under a specific projector");
111 //=======================================================================
112 //function : ToBeUpdated
114 //=======================================================================
115 Standard_Boolean PrsMgr_PresentableObject::ToBeUpdated (Standard_Boolean theToIncludeHidden) const
117 for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
119 const Handle(PrsMgr_Presentation)& aModedPrs = aPrsIter.Value();
120 if (aModedPrs->MustBeUpdated())
122 if (theToIncludeHidden)
124 return Standard_True;
127 Handle(PrsMgr_PresentationManager) aPrsMgr = aModedPrs->PresentationManager();
128 if (aPrsMgr->IsDisplayed (this, aModedPrs->Mode())
129 || aPrsMgr->IsHighlighted(this, aModedPrs->Mode()))
131 return Standard_True;
135 return Standard_False;
138 //=======================================================================
139 //function : UpdatePresentations
141 //=======================================================================
142 Standard_Boolean PrsMgr_PresentableObject::UpdatePresentations (Standard_Boolean theToIncludeHidden)
144 Standard_Boolean hasUpdates = Standard_False;
145 for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
147 const Handle(PrsMgr_Presentation)& aModedPrs = aPrsIter.Value();
148 if (aModedPrs->MustBeUpdated())
150 Handle(PrsMgr_PresentationManager) aPrsMgr = aModedPrs->PresentationManager();
151 if (theToIncludeHidden
152 || aPrsMgr->IsDisplayed (this, aModedPrs->Mode())
153 || aPrsMgr->IsHighlighted(this, aModedPrs->Mode()))
155 hasUpdates = Standard_True;
156 aPrsMgr->Update (this, aModedPrs->Mode());
163 //=======================================================================
166 //=======================================================================
167 void PrsMgr_PresentableObject::Update (Standard_Integer theMode, Standard_Boolean theToClearOther)
169 for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More();)
171 if (aPrsIter.Value()->Mode() == theMode)
173 Handle(PrsMgr_PresentationManager) aPrsMgr = aPrsIter.Value()->PresentationManager();
174 if (aPrsMgr->IsDisplayed (this, theMode)
175 || aPrsMgr->IsHighlighted(this, theMode))
177 aPrsMgr->Update (this, theMode);
178 aPrsIter.Value()->SetUpdateStatus (Standard_False);
182 SetToUpdate (aPrsIter.Value()->Mode());
185 else if (theToClearOther)
187 myPresentations.Remove (aPrsIter);
194 //=======================================================================
195 //function : SetToUpdate
197 //=======================================================================
198 void PrsMgr_PresentableObject::SetToUpdate (Standard_Integer theMode)
200 for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
203 || aPrsIter.Value()->Mode() == theMode)
205 aPrsIter.ChangeValue()->SetUpdateStatus (Standard_True);
210 //=======================================================================
211 //function : ToBeUpdated
212 //purpose : gets the list of modes to be updated
213 //=======================================================================
214 void PrsMgr_PresentableObject::ToBeUpdated (TColStd_ListOfInteger& theOutList) const
217 TColStd_MapOfInteger MI(myPresentations.Length());
218 for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
220 const Handle(PrsMgr_Presentation)& aModedPrs = aPrsIter.Value();
221 if (aModedPrs->MustBeUpdated()
222 && MI.Add (aModedPrs->Mode()))
224 theOutList.Append (aModedPrs->Mode());
229 //=======================================================================
230 //function : SetTypeOfPresentation
232 //=======================================================================
233 void PrsMgr_PresentableObject::SetTypeOfPresentation (const PrsMgr_TypeOfPresentation3d theType)
235 myTypeOfPresentation3d = theType;
236 for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
238 const Handle(PrsMgr_Presentation)& aPrs = aPrsIter.Value();
239 aPrs->SetVisual (myTypeOfPresentation3d == PrsMgr_TOP_ProjectorDependant
240 ? Graphic3d_TOS_COMPUTED
241 : Graphic3d_TOS_ALL);
245 //=======================================================================
246 //function : setLocalTransformation
248 //=======================================================================
249 void PrsMgr_PresentableObject::setLocalTransformation (const Handle(TopLoc_Datum3D)& theTransformation)
251 myLocalTransformation = theTransformation;
252 UpdateTransformation();
255 //=======================================================================
256 //function : ResetTransformation
258 //=======================================================================
259 void PrsMgr_PresentableObject::ResetTransformation()
261 setLocalTransformation (Handle(TopLoc_Datum3D)());
264 //=======================================================================
265 //function : SetCombinedParentTransform
267 //=======================================================================
268 void PrsMgr_PresentableObject::SetCombinedParentTransform (const Handle(TopLoc_Datum3D)& theTrsf)
270 myCombinedParentTransform = theTrsf;
271 UpdateTransformation();
274 //=======================================================================
275 //function : UpdateTransformation
277 //=======================================================================
278 void PrsMgr_PresentableObject::UpdateTransformation()
280 myTransformation.Nullify();
281 myInvTransformation = gp_Trsf();
282 if (!myCombinedParentTransform.IsNull() && myCombinedParentTransform->Form() != gp_Identity)
284 if (!myLocalTransformation.IsNull() && myLocalTransformation->Form() != gp_Identity)
286 const gp_Trsf aTrsf = myCombinedParentTransform->Trsf() * myLocalTransformation->Trsf();
287 myTransformation = new TopLoc_Datum3D (aTrsf);
288 myInvTransformation = aTrsf.Inverted();
292 myTransformation = myCombinedParentTransform;
293 myInvTransformation = myCombinedParentTransform->Trsf().Inverted();
296 else if (!myLocalTransformation.IsNull() && myLocalTransformation->Form() != gp_Identity)
298 myTransformation = myLocalTransformation;
299 myInvTransformation = myLocalTransformation->Trsf().Inverted();
302 for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
304 aPrsIter.ChangeValue()->SetTransformation (myTransformation);
307 for (PrsMgr_ListOfPresentableObjectsIter aChildIter (myChildren); aChildIter.More(); aChildIter.Next())
309 aChildIter.Value()->SetCombinedParentTransform (myTransformation);
313 //=======================================================================
314 //function : recomputeComputed
316 //=======================================================================
317 void PrsMgr_PresentableObject::recomputeComputed() const
319 for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
321 const Handle(PrsMgr_Presentation)& aPrs3d = aPrsIter.Value();
326 //=======================================================================
327 //function : SetTransformPersistence
329 //=======================================================================
330 void PrsMgr_PresentableObject::SetTransformPersistence (const Handle(Graphic3d_TransformPers)& theTrsfPers)
332 myTransformPersistence = theTrsfPers;
333 for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
335 const Handle(PrsMgr_Presentation)& aPrs3d = aPrsIter.Value();
336 aPrs3d->SetTransformPersistence (myTransformPersistence);
341 //=======================================================================
342 //function : AddChild
344 //=======================================================================
345 void PrsMgr_PresentableObject::AddChild (const Handle(PrsMgr_PresentableObject)& theObject)
347 Handle(PrsMgr_PresentableObject) aHandleGuard = theObject;
348 if (theObject->myParent != NULL)
350 theObject->myParent->RemoveChild (aHandleGuard);
353 myChildren.Append (theObject);
354 theObject->myParent = this;
355 theObject->SetCombinedParentTransform (myTransformation);
358 //=======================================================================
359 //function : AddChildWithCurrentTransformation
361 //=======================================================================
362 void PrsMgr_PresentableObject::AddChildWithCurrentTransformation(const Handle(PrsMgr_PresentableObject)& theObject)
364 gp_Trsf aTrsf = Transformation().Inverted() * theObject->Transformation();
365 theObject->SetLocalTransformation(aTrsf);
369 //=======================================================================
370 //function : RemoveChild
372 //=======================================================================
373 void PrsMgr_PresentableObject::RemoveChild (const Handle(PrsMgr_PresentableObject)& theObject)
375 PrsMgr_ListOfPresentableObjectsIter anIter (myChildren);
376 for (; anIter.More(); anIter.Next())
378 if (anIter.Value() == theObject)
380 theObject->myParent = NULL;
381 theObject->SetCombinedParentTransform (Handle(TopLoc_Datum3D)());
382 myChildren.Remove (anIter);
388 //=======================================================================
389 //function : RemoveChildWithRestoreTransformation
391 //=======================================================================
392 void PrsMgr_PresentableObject::RemoveChildWithRestoreTransformation(const Handle(PrsMgr_PresentableObject)& theObject)
394 gp_Trsf aTrsf = theObject->Transformation();
395 RemoveChild(theObject);
396 theObject->SetLocalTransformation(aTrsf);
399 //=======================================================================
400 //function : SetZLayer
402 //=======================================================================
403 void PrsMgr_PresentableObject::SetZLayer (const Graphic3d_ZLayerId theLayerId)
405 if (myDrawer->ZLayer() == theLayerId)
410 myDrawer->SetZLayer (theLayerId);
411 for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
413 const Handle(PrsMgr_Presentation)& aModedPrs = aPrsIter.Value();
414 aModedPrs->SetZLayer (theLayerId);
418 // =======================================================================
419 // function : AddClipPlane
421 // =======================================================================
422 void PrsMgr_PresentableObject::AddClipPlane (const Handle(Graphic3d_ClipPlane)& thePlane)
424 // add to collection and process changes
425 if (myClipPlanes.IsNull())
427 myClipPlanes = new Graphic3d_SequenceOfHClipPlane();
430 myClipPlanes->Append (thePlane);
434 // =======================================================================
435 // function : RemoveClipPlane
437 // =======================================================================
438 void PrsMgr_PresentableObject::RemoveClipPlane (const Handle(Graphic3d_ClipPlane)& thePlane)
440 if (myClipPlanes.IsNull())
445 // remove from collection and process changes
446 for (Graphic3d_SequenceOfHClipPlane::Iterator aPlaneIt (*myClipPlanes); aPlaneIt.More(); aPlaneIt.Next())
448 const Handle(Graphic3d_ClipPlane)& aPlane = aPlaneIt.Value();
449 if (aPlane != thePlane)
452 myClipPlanes->Remove (aPlaneIt);
458 // =======================================================================
459 // function : SetClipPlanes
461 // =======================================================================
462 void PrsMgr_PresentableObject::SetClipPlanes (const Handle(Graphic3d_SequenceOfHClipPlane)& thePlanes)
464 // change collection and process changes
465 myClipPlanes = thePlanes;
469 // =======================================================================
470 // function : UpdateClipping
472 // =======================================================================
473 void PrsMgr_PresentableObject::UpdateClipping()
475 for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
477 const Handle(PrsMgr_Presentation)& aModedPrs = aPrsIter.Value();
478 aModedPrs->SetClipPlanes (myClipPlanes);
482 //=======================================================================
483 //function : SetInfiniteState
485 //=======================================================================
486 void PrsMgr_PresentableObject::SetInfiniteState (const Standard_Boolean theFlag)
488 if (myInfiniteState == theFlag)
493 myInfiniteState = theFlag;
494 for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
496 const Handle(PrsMgr_Presentation)& aModedPrs = aPrsIter.Value();
497 aModedPrs->SetInfiniteState (theFlag);
501 // =======================================================================
502 // function : SetMutable
504 // =======================================================================
505 void PrsMgr_PresentableObject::SetMutable (const Standard_Boolean theIsMutable)
507 if (myIsMutable == theIsMutable)
512 myIsMutable = theIsMutable;
513 for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
515 const Handle(PrsMgr_Presentation)& aModedPrs = aPrsIter.Value();
516 aModedPrs->SetMutable (theIsMutable);
520 // =======================================================================
521 // function : UnsetAttributes
523 // =======================================================================
524 void PrsMgr_PresentableObject::UnsetAttributes()
526 Handle(Prs3d_Drawer) aDrawer = new Prs3d_Drawer();
527 if (myDrawer->HasLink())
529 aDrawer->Link(myDrawer->Link());
533 hasOwnColor = Standard_False;
534 hasOwnMaterial = Standard_False;
536 myDrawer->SetTransparency (0.0f);
539 //=======================================================================
540 //function : SetHilightMode
542 //=======================================================================
543 void PrsMgr_PresentableObject::SetHilightMode (const Standard_Integer theMode)
545 if (myHilightDrawer.IsNull())
547 myHilightDrawer = new Prs3d_Drawer();
548 myHilightDrawer->Link (myDrawer);
549 myHilightDrawer->SetAutoTriangulation (Standard_False);
550 myHilightDrawer->SetColor (Quantity_NOC_GRAY80);
551 myHilightDrawer->SetZLayer(Graphic3d_ZLayerId_UNKNOWN);
553 if (myDynHilightDrawer.IsNull())
555 myDynHilightDrawer = new Prs3d_Drawer();
556 myDynHilightDrawer->Link (myDrawer);
557 myDynHilightDrawer->SetColor (Quantity_NOC_CYAN1);
558 myDynHilightDrawer->SetAutoTriangulation (Standard_False);
559 myDynHilightDrawer->SetZLayer(Graphic3d_ZLayerId_Top);
561 myHilightDrawer ->SetDisplayMode (theMode);
562 myDynHilightDrawer->SetDisplayMode (theMode);
565 //=======================================================================
566 //function : SynchronizeAspects
568 //=======================================================================
569 void PrsMgr_PresentableObject::SynchronizeAspects()
571 for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
573 const Handle(PrsMgr_Presentation)& aPrs3d = aPrsIter.ChangeValue();
574 for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (aPrs3d->Groups()); aGroupIter.More(); aGroupIter.Next())
576 if (!aGroupIter.Value().IsNull())
578 aGroupIter.ChangeValue()->SynchronizeAspects();
584 //=======================================================================
585 //function : replaceAspects
587 //=======================================================================
588 void PrsMgr_PresentableObject::replaceAspects (const Graphic3d_MapOfAspectsToAspects& theMap)
590 if (theMap.IsEmpty())
595 for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
597 const Handle(PrsMgr_Presentation)& aPrs3d = aPrsIter.ChangeValue();
598 for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (aPrs3d->Groups()); aGroupIter.More(); aGroupIter.Next())
600 if (!aGroupIter.Value().IsNull())
602 aGroupIter.ChangeValue()->ReplaceAspects (theMap);
608 //=======================================================================
609 //function : BoundingBox
611 //=======================================================================
612 void PrsMgr_PresentableObject::BoundingBox (Bnd_Box& theBndBox)
614 if (myDrawer->DisplayMode() == -1)
616 if (!myPresentations.IsEmpty())
618 const Handle(PrsMgr_Presentation)& aPrs3d = myPresentations.First();
619 const Graphic3d_BndBox3d& aBndBox = aPrs3d->CStructure()->BoundingBox();
620 if (aBndBox.IsValid())
622 theBndBox.Update (aBndBox.CornerMin().x(), aBndBox.CornerMin().y(), aBndBox.CornerMin().z(),
623 aBndBox.CornerMax().x(), aBndBox.CornerMax().y(), aBndBox.CornerMax().z());
632 for (PrsMgr_ListOfPresentableObjectsIter aPrsIter (myChildren); aPrsIter.More(); aPrsIter.Next())
634 if (const Handle(PrsMgr_PresentableObject)& aChild = aPrsIter.Value())
637 aChild->BoundingBox (aBox);
638 theBndBox.Add (aBox);
644 for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
646 const Handle(PrsMgr_Presentation)& aPrs3d = aPrsIter.ChangeValue();
647 if (aPrs3d->Mode() == myDrawer->DisplayMode())
649 const Graphic3d_BndBox3d& aBndBox = aPrs3d->CStructure()->BoundingBox();
650 if (aBndBox.IsValid())
652 theBndBox.Update (aBndBox.CornerMin().x(), aBndBox.CornerMin().y(), aBndBox.CornerMin().z(),
653 aBndBox.CornerMax().x(), aBndBox.CornerMax().y(), aBndBox.CornerMax().z());
664 //=======================================================================
665 //function : Material
667 //=======================================================================
668 Graphic3d_NameOfMaterial PrsMgr_PresentableObject::Material() const
670 return myDrawer->ShadingAspect()->Material().Name();
673 //=======================================================================
674 //function : SetMaterial
676 //=======================================================================
677 void PrsMgr_PresentableObject::SetMaterial (const Graphic3d_MaterialAspect& theMaterial)
679 myDrawer->SetupOwnShadingAspect();
680 myDrawer->ShadingAspect()->SetMaterial (theMaterial);
681 hasOwnMaterial = Standard_True;
684 //=======================================================================
685 //function : UnsetMaterial
687 //=======================================================================
688 void PrsMgr_PresentableObject::UnsetMaterial()
695 if (HasColor() || IsTransparent())
697 if (myDrawer->HasLink())
699 myDrawer->ShadingAspect()->SetMaterial (myDrawer->Link()->ShadingAspect()->Aspect()->BackMaterial());
704 SetColor (myDrawer->Color());
709 SetTransparency (myDrawer->Transparency());
714 myDrawer->SetShadingAspect (Handle(Prs3d_ShadingAspect)());
717 hasOwnMaterial = Standard_False;
720 //=======================================================================
721 //function : SetTransparency
723 //=======================================================================
724 void PrsMgr_PresentableObject::SetTransparency (const Standard_Real theValue)
726 myDrawer->SetupOwnShadingAspect();
727 myDrawer->ShadingAspect()->Aspect()->ChangeFrontMaterial().SetTransparency (Standard_ShortReal(theValue));
728 myDrawer->ShadingAspect()->Aspect()->ChangeBackMaterial() .SetTransparency (Standard_ShortReal(theValue));
729 myDrawer->SetTransparency (Standard_ShortReal(theValue));
732 //=======================================================================
733 //function : UnsetTransparency
735 //=======================================================================
736 void PrsMgr_PresentableObject::UnsetTransparency()
738 if (HasColor() || HasMaterial())
740 myDrawer->ShadingAspect()->Aspect()->ChangeFrontMaterial().SetTransparency (0.0f);
741 myDrawer->ShadingAspect()->Aspect()->ChangeBackMaterial() .SetTransparency (0.0f);
745 myDrawer->SetShadingAspect (Handle(Prs3d_ShadingAspect)());
747 myDrawer->SetTransparency (0.0f);
750 //=======================================================================
751 //function : SetPolygonOffsets
753 //=======================================================================
754 void PrsMgr_PresentableObject::SetPolygonOffsets (const Standard_Integer theMode,
755 const Standard_ShortReal theFactor,
756 const Standard_ShortReal theUnits)
758 myDrawer->SetupOwnShadingAspect();
759 myDrawer->ShadingAspect()->Aspect()->SetPolygonOffsets (theMode, theFactor, theUnits);
760 SynchronizeAspects();
763 //=======================================================================
764 //function : HasPolygonOffsets
766 //=======================================================================
767 Standard_Boolean PrsMgr_PresentableObject::HasPolygonOffsets() const
769 return !(myDrawer->HasOwnShadingAspect()
770 || (myDrawer->HasLink()
771 && myDrawer->ShadingAspect() == myDrawer->Link()->ShadingAspect()));
774 //=======================================================================
775 //function : PolygonOffsets
777 //=======================================================================
778 void PrsMgr_PresentableObject::PolygonOffsets (Standard_Integer& theMode,
779 Standard_ShortReal& theFactor,
780 Standard_ShortReal& theUnits) const
782 if (HasPolygonOffsets())
784 myDrawer->ShadingAspect()->Aspect()->PolygonOffsets (theMode, theFactor, theUnits);
788 // =======================================================================
789 // function : DumpJson
791 // =======================================================================
792 void PrsMgr_PresentableObject::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
794 OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
796 OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myParent)
798 for (PrsMgr_Presentations::Iterator anIterator (myPresentations); anIterator.More(); anIterator.Next())
800 const Handle(PrsMgr_Presentation)& aPresentation = anIterator.Value();
801 OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aPresentation.get())
804 OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myClipPlanes.get())
806 OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myDrawer.get())
807 OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myHilightDrawer.get())
808 OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myDynHilightDrawer.get())
810 OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTransformPersistence.get())
812 OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myLocalTransformation.get())
813 OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTransformation.get())
814 OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myCombinedParentTransform.get())
816 for (PrsMgr_ListOfPresentableObjects::Iterator anIterator (myChildren); anIterator.More(); anIterator.Next())
818 const Handle(PrsMgr_PresentableObject)& aChildObject = anIterator.Value();
819 OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aChildObject.get())
822 OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myInvTransformation)
824 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTypeOfPresentation3d)
825 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurrentFacingModel)
827 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myOwnWidth)
828 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, hasOwnColor)
829 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, hasOwnMaterial)
831 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myInfiniteState)
832 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsMutable)
833 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnPresentations)
835 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToPropagateVisualState)