From: isz Date: Thu, 18 Sep 2014 11:19:16 +0000 (+0400) Subject: 0025229: Cappings have gray tint if setting color with vclipplane command X-Git-Tag: V6_8_0_beta~99 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=8aeeca44df12896979f0b24d837cac572c97bbae;p=occt-copy.git 0025229: Cappings have gray tint if setting color with vclipplane command -Now in ViewerTest_ViewerCommands's method VClipPlane() Graphic3d_TypeOfMaterial::SetAmbientColor() and Graphic3d_TypeOfMaterial::SetDiffuseColor() are used instead of Graphic3d_TypeOfMaterial::SetColor() -New test case added: tests\bugs\vis\bug25229 -Formatting --- diff --git a/src/ViewerTest/ViewerTest_ViewerCommands.cxx b/src/ViewerTest/ViewerTest_ViewerCommands.cxx index 000e20e2f4..30c0542705 100644 --- a/src/ViewerTest/ViewerTest_ViewerCommands.cxx +++ b/src/ViewerTest/ViewerTest_ViewerCommands.cxx @@ -5451,7 +5451,9 @@ static int VClipPlane (Draw_Interpretor& theDi, Standard_Integer theArgsNb, cons Standard_Real aBlu = atof (theArgVec [7]); Graphic3d_MaterialAspect aMat = aClipPlane->CappingMaterial(); - aMat.SetColor (Quantity_Color (aRed, aGrn, aBlu, Quantity_TOC_RGB)); + Quantity_Color aColor (aRed, aGrn, aBlu, Quantity_TOC_RGB); + aMat.SetAmbientColor (aColor); + aMat.SetDiffuseColor (aColor); aClipPlane->SetCappingMaterial (aMat); } else if (aCappingArg == "texname") // texture name diff --git a/tests/bugs/vis/bug25229 b/tests/bugs/vis/bug25229 new file mode 100644 index 0000000000..4a8390413e --- /dev/null +++ b/tests/bugs/vis/bug25229 @@ -0,0 +1,27 @@ +puts "============" +puts "CR25229" +puts "============" +puts "" +####################################################################### +# Cappings have gray tint if setting color with vclipplane command. +####################################################################### +box b 100 100 100 +vinit +vsetdispmode 1 +vdisplay b +vclipplane create pln1 +vclipplane change pln1 equation 0 0 -1 20 +vclipplane set pln1 object b +vclipplane change pln1 capping on +vclipplane change pln1 capping color 1.0 1.0 1.0 +vtop +vfit + +set x_coord 100 +set y_coord 100 +checkcolor $x_coord $y_coord 1 1 1 +if { $stat != 1 } { + puts "Error : Capping color is broken." +} + +set only_screen 1