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

0026995: Visualization, TKXCAF - do not reset custom material within XCAFPrs_AISObject::Compute()

Assign default material in class constructor instead.
This commit is contained in:
kgv 2015-12-15 12:14:41 +03:00 committed by bugmaster
parent 1ff072271f
commit 905db76982

View File

@ -48,6 +48,8 @@ IMPLEMENT_STANDARD_RTTIEXT(XCAFPrs_AISObject,AIS_ColoredShape)
XCAFPrs_AISObject::XCAFPrs_AISObject (const TDF_Label& theLabel)
: AIS_ColoredShape(TopoDS_Shape())
{
// define plastic material by default for proper color reproduction
SetMaterial (Graphic3d_NOM_PLASTIC);
myLabel = theLabel;
}
@ -117,12 +119,6 @@ void XCAFPrs_AISObject::Compute (const Handle(PrsMgr_PresentationManager3d)& the
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
thePrs->Clear();
// abv: 06 Mar 00: to have good colors
Handle(TPrsStd_AISPresentation) aPrs = Handle(TPrsStd_AISPresentation)::DownCast (GetOwner());
if (aPrs.IsNull() || !aPrs->HasOwnMaterial()) SetMaterial (Graphic3d_NOM_PLASTIC);
TopoDS_Shape aShape;
if (!XCAFDoc_ShapeTool::GetShape (myLabel, aShape) || aShape.IsNull()) return;