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

0025349: Graphic3d_MaterialAspect::Color() returns a value different from that set by the method Graphic3d_MaterialAspect::SetColor

Fix bug with default color of clip plane.
This commit is contained in:
dbp
2014-10-23 14:59:20 +04:00
committed by bugmaster
parent 876d1f2a2c
commit 3fb72902ea
2 changed files with 10 additions and 6 deletions

View File

@@ -20,7 +20,8 @@
// purpose :
// =======================================================================
Graphic3d_MaterialAspect::Graphic3d_MaterialAspect()
: myAmbientColor (0.2, 0.2, 0.2, Quantity_TOC_RGB)
: myDiffuseColor (0.2, 0.2, 0.2, Quantity_TOC_RGB),
myAmbientColor (0.2, 0.2, 0.2, Quantity_TOC_RGB)
{
myRequestedMaterialName = Graphic3d_NOM_DEFAULT;
Init (myRequestedMaterialName);
@@ -31,7 +32,8 @@ Graphic3d_MaterialAspect::Graphic3d_MaterialAspect()
// purpose :
// =======================================================================
Graphic3d_MaterialAspect::Graphic3d_MaterialAspect (const Graphic3d_NameOfMaterial theName)
: myAmbientColor (0.2, 0.2, 0.2, Quantity_TOC_RGB)
: myDiffuseColor (0.2, 0.2, 0.2, Quantity_TOC_RGB),
myAmbientColor (0.2, 0.2, 0.2, Quantity_TOC_RGB)
{
myRequestedMaterialName = theName;
Init (myRequestedMaterialName);
@@ -56,7 +58,7 @@ void Graphic3d_MaterialAspect::Init (const Graphic3d_NameOfMaterial theName)
myEmissiveCoef = 0.0f;
myEnvReflexion = 0.0f;
myShininess = 0.039f;
myDiffuseColor .SetValues (0.0, 0.0, 0.0, Quantity_TOC_RGB);
myDiffuseColor .SetValues (0.2, 0.2, 0.2, Quantity_TOC_RGB);
mySpecularColor.SetValues (1.0, 1.0, 1.0, Quantity_TOC_RGB);
myMaterialName = theName;
@@ -668,7 +670,9 @@ void Graphic3d_MaterialAspect::SetRefractionIndex (const Standard_Real theValue)
// =======================================================================
const Quantity_Color& Graphic3d_MaterialAspect::Color() const
{
return myAmbientColor;
// It is generally accepted to consider diffuse color as
// "general" color of a material when light shines on it
return myDiffuseColor;
}
// =======================================================================