1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0025459: Visualization - AIS_ColoredShape::SetMaterial() should not reset custom colors

This commit is contained in:
kgv
2014-11-14 12:55:57 +03:00
committed by bugmaster
parent e83c01bfc0
commit e0608a8d27
7 changed files with 101 additions and 82 deletions

View File

@@ -269,6 +269,28 @@ void AIS_ColoredShape::SetTransparency (const Standard_Real theValue)
}
}
//=======================================================================
//function : SetMaterial
//purpose :
//=======================================================================
void AIS_ColoredShape::SetMaterial (const Graphic3d_MaterialAspect& theMaterial)
{
setMaterial (myDrawer, theMaterial, HasColor(), IsTransparent());
//myOwnMaterial = theMaterial;
hasOwnMaterial = Standard_True;
LoadRecomputable (AIS_Shaded);
for (DataMapOfShapeColor::Iterator anIter (myShapeColors); anIter.More(); anIter.Next())
{
const Handle(AIS_ColoredDrawer)& aDrawer = anIter.Value();
//if (aDrawer->HasOwnMaterial()) continue;
if (aDrawer->HasShadingAspect())
{
setMaterial (aDrawer, theMaterial, aDrawer->HasOwnColor(), Standard_False); // aDrawer->IsTransparent()
}
}
}
//=======================================================================
//function : Compute
//purpose :