diff --git a/dox/dev_guides/upgrade/upgrade.md b/dox/dev_guides/upgrade/upgrade.md index 899cb1556d..a05803ceec 100644 --- a/dox/dev_guides/upgrade/upgrade.md +++ b/dox/dev_guides/upgrade/upgrade.md @@ -1017,3 +1017,4 @@ The following obsolete features have been removed: * Obsolete Antialiasing API V3d_View::SetAntialiasingOn(). This method was intended to activate deprecated OpenGL functionality (GL_POLYGON_SMOOTH, GL_LINE_SMOOTH, GL_POINT_SMOOTH). Instead of old API, application should request MSAA buffers for antialiasing by assigning Graphic3d_RenderingParams::NbMsaaSamples property of structure returned by V3d_View::ChangeRenderingParams(). +* Prs3d_Drawer::ShadingAspectGlobal() flag has been removed as not used. Corresponding calls can be removed safely from the application code. diff --git a/samples/mfc/standard/Common/User_Cylinder.cxx b/samples/mfc/standard/Common/User_Cylinder.cxx index c3084edb45..95f591ccb5 100755 --- a/samples/mfc/standard/Common/User_Cylinder.cxx +++ b/samples/mfc/standard/Common/User_Cylinder.cxx @@ -64,7 +64,6 @@ case 1: Standard_Real aTransparency = Transparency(); Graphic3d_NameOfMaterial aMaterial = Material(); - myDrawer->SetShadingAspectGlobal(Standard_False); TopExp_Explorer Ex; Handle(Geom_Surface) Surface; diff --git a/src/AIS/AIS_InteractiveContext.cxx b/src/AIS/AIS_InteractiveContext.cxx index 721b3a2e10..0a840234bc 100644 --- a/src/AIS/AIS_InteractiveContext.cxx +++ b/src/AIS/AIS_InteractiveContext.cxx @@ -2773,7 +2773,6 @@ void AIS_InteractiveContext::InitAttributes() { mgrSelector->Add (myMainSel); - myDefaultDrawer->SetShadingAspectGlobal (Standard_False); Graphic3d_MaterialAspect aMat (Graphic3d_NOM_BRASS); myDefaultDrawer->ShadingAspect()->SetMaterial (aMat); diff --git a/src/AIS/AIS_Shape.cxx b/src/AIS/AIS_Shape.cxx index 1004cfcccc..d0fc5d3fed 100644 --- a/src/AIS/AIS_Shape.cxx +++ b/src/AIS/AIS_Shape.cxx @@ -91,7 +91,6 @@ myInitAng(0.) { Set (shap); SetHilightMode(0); - myDrawer->SetShadingAspectGlobal(Standard_False); } //======================================================================= @@ -177,7 +176,6 @@ void AIS_Shape::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentat } else { - myDrawer->SetShadingAspectGlobal (Standard_False); if (IsInfinite()) { StdPrs_WFShape::Add (aPrs, myshape, myDrawer); @@ -510,7 +508,6 @@ void AIS_Shape::setColor (const Handle(Prs3d_Drawer)& theDrawer, // override color theDrawer->ShadingAspect()->SetColor (theColor, myCurrentFacingModel); - theDrawer->SetShadingAspectGlobal (Standard_False); theDrawer->LineAspect()->SetColor (theColor); theDrawer->WireAspect()->SetColor (theColor); theDrawer->PointAspect()->SetColor (theColor); diff --git a/src/AIS/AIS_TexturedShape.cxx b/src/AIS/AIS_TexturedShape.cxx index 2e249ef2ac..aa537220fe 100644 --- a/src/AIS/AIS_TexturedShape.cxx +++ b/src/AIS/AIS_TexturedShape.cxx @@ -442,7 +442,6 @@ void AIS_TexturedShape::Compute (const Handle(PrsMgr_PresentationManager3d)& /*t break; } - myDrawer->SetShadingAspectGlobal (Standard_False); if (IsInfinite()) { StdPrs_WFShape::Add (thePrs, myshape, myDrawer); diff --git a/src/Prs3d/Prs3d_Drawer.cxx b/src/Prs3d/Prs3d_Drawer.cxx index 325b2260f6..c701a587ee 100644 --- a/src/Prs3d/Prs3d_Drawer.cxx +++ b/src/Prs3d/Prs3d_Drawer.cxx @@ -67,8 +67,6 @@ Prs3d_Drawer::Prs3d_Drawer() myHasOwnLineAspect (Standard_False), myHasOwnTextAspect (Standard_False), myHasOwnShadingAspect (Standard_False), - myShadingAspectGlobal (Standard_True), - myHasOwnShadingAspectGlobal (Standard_False), myHasOwnPlaneAspect (Standard_False), myHasOwnSeenLineAspect (Standard_False), myHasOwnArrowAspect (Standard_False), @@ -697,17 +695,6 @@ void Prs3d_Drawer::SetShadingAspect (const Handle(Prs3d_ShadingAspect)& theAspec myHasOwnShadingAspect = !myShadingAspect.IsNull(); } -// ======================================================================= -// function : SetShadingAspectGlobal -// purpose : -// ======================================================================= - -void Prs3d_Drawer::SetShadingAspectGlobal (const Standard_Boolean theValue) -{ - myHasOwnShadingAspectGlobal = Standard_True; - myShadingAspectGlobal = theValue; -} - // ======================================================================= // function : PlaneAspect // purpose : @@ -1058,7 +1045,6 @@ void Prs3d_Drawer::ClearLocalAttributes() myHasOwnIsoOnTriangulation = Standard_False; myHasOwnIsAutoTriangulated = Standard_False; myHasOwnWireDraw = Standard_False; - myHasOwnShadingAspectGlobal = Standard_False; myHasOwnLineArrowDraw = Standard_False; myHasOwnDrawHiddenLine = Standard_False; myHasOwnFreeBoundaryDraw = Standard_False; diff --git a/src/Prs3d/Prs3d_Drawer.hxx b/src/Prs3d/Prs3d_Drawer.hxx index 2126e1d31a..5aa6900f2e 100644 --- a/src/Prs3d/Prs3d_Drawer.hxx +++ b/src/Prs3d/Prs3d_Drawer.hxx @@ -488,24 +488,6 @@ public: //! shading aspect that overrides the one in the link. Standard_Boolean HasOwnShadingAspect() const { return myHasOwnShadingAspect; } - //! Returns True if the ShadingAspect is applied - //! to the whole presentation. - Standard_Boolean ShadingAspectGlobal() const - { - return HasOwnShadingAspectGlobal() || myLink.IsNull() - ? myShadingAspectGlobal - : myLink->ShadingAspectGlobal(); - } - - //! Indicates that the ShadingAspect will be apply - //! to the whole presentation. This allows to modify - //! the aspect without recomputing the content of the presentation. - Standard_EXPORT void SetShadingAspectGlobal (const Standard_Boolean theValue); - - //! Returns true if the drawer has its own attribute for - //! ShadingAspectGlobal flag that overrides the one in the link. - Standard_Boolean HasOwnShadingAspectGlobal() const { return myHasOwnShadingAspectGlobal; } - //! Returns settings for seen line aspects. //! These settings can be edited. The default values are: //! Color: Quantity_NOC_YELLOW @@ -913,8 +895,6 @@ protected: Standard_Boolean myHasOwnTextAspect; Handle(Prs3d_ShadingAspect) myShadingAspect; Standard_Boolean myHasOwnShadingAspect; - Standard_Boolean myShadingAspectGlobal; - Standard_Boolean myHasOwnShadingAspectGlobal; Handle(Prs3d_PlaneAspect) myPlaneAspect; Standard_Boolean myHasOwnPlaneAspect; Handle(Prs3d_LineAspect) mySeenLineAspect; diff --git a/src/StdPrs/StdPrs_ShadedShape.cxx b/src/StdPrs/StdPrs_ShadedShape.cxx index a7bdad6ff6..243ee8e06f 100644 --- a/src/StdPrs/StdPrs_ShadedShape.cxx +++ b/src/StdPrs/StdPrs_ShadedShape.cxx @@ -290,11 +290,7 @@ namespace Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePrs); aGroup->SetClosed (theIsClosed); - if (!theDrawer->ShadingAspectGlobal()) - { - Handle(Graphic3d_AspectFillArea3d) anAsp = theDrawer->ShadingAspect()->Aspect(); - aGroup->SetGroupPrimitivesAspect (anAsp); - } + aGroup->SetGroupPrimitivesAspect (theDrawer->ShadingAspect()->Aspect()); aGroup->AddPrimitiveArray (aPArray); return Standard_True; } diff --git a/src/StdPrs/StdPrs_ShadedSurface.cxx b/src/StdPrs/StdPrs_ShadedSurface.cxx index 868b01d0ee..c09daad55a 100644 --- a/src/StdPrs/StdPrs_ShadedSurface.cxx +++ b/src/StdPrs/StdPrs_ShadedSurface.cxx @@ -41,13 +41,10 @@ void StdPrs_ShadedSurface::Add (const Handle(Prs3d_Presentation)& thePrs, N1 = N1 < 3 ? 3 : N1; N2 = N2 < 3 ? 3 : N2; - if (!theDrawer->ShadingAspectGlobal()) - { - // If the surface is closed, the faces from back-side are not traced: - Handle(Graphic3d_AspectFillArea3d) anAsp = theDrawer->ShadingAspect()->Aspect(); - Prs3d_Root::CurrentGroup (thePrs)->SetGroupPrimitivesAspect (anAsp); - Prs3d_Root::CurrentGroup (thePrs)->SetClosed (theSurface.IsUClosed() && theSurface.IsVClosed()); - } + // If the surface is closed, the faces from back-side are not traced: + Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (thePrs); + aGroup->SetGroupPrimitivesAspect (theDrawer->ShadingAspect()->Aspect()); + aGroup->SetClosed (theSurface.IsUClosed() && theSurface.IsVClosed()); Standard_Integer aNBUintv = theSurface.NbUIntervals (GeomAbs_C1); Standard_Integer aNBVintv = theSurface.NbVIntervals (GeomAbs_C1); @@ -96,7 +93,7 @@ void StdPrs_ShadedSurface::Add (const Handle(Prs3d_Presentation)& thePrs, aPArray->AddVertex (P2, D2); } } - Prs3d_Root::CurrentGroup (thePrs)->AddPrimitiveArray (aPArray); + aGroup->AddPrimitiveArray (aPArray); } } }