1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0027717: Visualization - drop broken Prs3d_Drawer::ShadingAspectGlobal() flag

This commit is contained in:
san 2016-08-01 18:10:55 +03:00 committed by bugmaster
parent cde2e2f0ca
commit 6887652ac6
9 changed files with 7 additions and 53 deletions

View File

@ -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.

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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);
}
}
}