1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-07 18:30:55 +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

@ -157,7 +157,7 @@ is
AColor : Color from Quantity ) AColor : Color from Quantity )
is static; is static;
---Level: Public ---Level: Public
---Purpose: Modifies the ambient colour of the surface. ---Purpose: Modifies the ambient and diffuse colour of the surface.
-- Category: Methods to modify the class definition -- Category: Methods to modify the class definition
SetAmbientColor ( me : in out; SetAmbientColor ( me : in out;
@ -260,7 +260,7 @@ is
is static; is static;
---C++: return const& ---C++: return const&
---Level: Public ---Level: Public
---Purpose: Returns the ambient colour of the surface. ---Purpose: Returns the diffuse colour of the surface.
---Category: Inquire methods ---Category: Inquire methods
AmbientColor ( me ) AmbientColor ( me )

View File

@ -20,7 +20,8 @@
// purpose : // purpose :
// ======================================================================= // =======================================================================
Graphic3d_MaterialAspect::Graphic3d_MaterialAspect() 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; myRequestedMaterialName = Graphic3d_NOM_DEFAULT;
Init (myRequestedMaterialName); Init (myRequestedMaterialName);
@ -31,7 +32,8 @@ Graphic3d_MaterialAspect::Graphic3d_MaterialAspect()
// purpose : // purpose :
// ======================================================================= // =======================================================================
Graphic3d_MaterialAspect::Graphic3d_MaterialAspect (const Graphic3d_NameOfMaterial theName) 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; myRequestedMaterialName = theName;
Init (myRequestedMaterialName); Init (myRequestedMaterialName);
@ -56,7 +58,7 @@ void Graphic3d_MaterialAspect::Init (const Graphic3d_NameOfMaterial theName)
myEmissiveCoef = 0.0f; myEmissiveCoef = 0.0f;
myEnvReflexion = 0.0f; myEnvReflexion = 0.0f;
myShininess = 0.039f; 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); mySpecularColor.SetValues (1.0, 1.0, 1.0, Quantity_TOC_RGB);
myMaterialName = theName; myMaterialName = theName;
@ -668,7 +670,9 @@ void Graphic3d_MaterialAspect::SetRefractionIndex (const Standard_Real theValue)
// ======================================================================= // =======================================================================
const Quantity_Color& Graphic3d_MaterialAspect::Color() const 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;
} }
// ======================================================================= // =======================================================================