X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FViewerTest%2FViewerTest_ViewerCommands.cxx;h=90c890d9050216bb0ad7e45a07cdfc22f91c2b39;hb=611684187de2a7b7c59c33f7da9ca51afa64a326;hpb=c8428cb3e456e42cbe875baf6a2b39be41fe0ff3 diff --git a/src/ViewerTest/ViewerTest_ViewerCommands.cxx b/src/ViewerTest/ViewerTest_ViewerCommands.cxx index 833ac10d93..90c890d905 100644 --- a/src/ViewerTest/ViewerTest_ViewerCommands.cxx +++ b/src/ViewerTest/ViewerTest_ViewerCommands.cxx @@ -7203,18 +7203,10 @@ public: const Handle(Graphic3d_AspectFillArea3d)& aFillAspect = myDrawer->ShadingAspect()->Aspect(); Graphic3d_MaterialAspect aMat; aMat.SetMaterialType (Graphic3d_MATERIAL_PHYSIC); - aMat.SetAmbient (1.0); - aMat.SetDiffuse (1.0); - aMat.SetSpecular (1.0); - aMat.SetEmissive (1.0); - aMat.SetReflectionModeOn (Graphic3d_TOR_AMBIENT); - aMat.SetReflectionModeOn (Graphic3d_TOR_DIFFUSE); - aMat.SetReflectionModeOn (Graphic3d_TOR_SPECULAR); - aMat.SetReflectionModeOn (Graphic3d_TOR_EMISSION); - aMat.SetAmbientColor (Quantity_Color (0.0, 0.0, 0.0, Quantity_TOC_RGB)); - aMat.SetDiffuseColor (Quantity_Color (1.0, 1.0, 1.0, Quantity_TOC_RGB)); - aMat.SetSpecularColor (Quantity_Color (0.0, 0.0, 0.0, Quantity_TOC_RGB)); - aMat.SetEmissiveColor (Quantity_Color (0.0, 0.0, 0.0, Quantity_TOC_RGB)); + aMat.SetAmbientColor (Quantity_NOC_BLACK); + aMat.SetDiffuseColor (Quantity_NOC_WHITE); + aMat.SetSpecularColor (Quantity_NOC_BLACK); + aMat.SetEmissiveColor (Quantity_NOC_BLACK); aFillAspect->SetFrontMaterial (aMat); aFillAspect->SetTextureMap (new Graphic3d_Texture2Dmanual (theImage)); aFillAspect->SetTextureMapOn(); @@ -9594,13 +9586,22 @@ static int VClipPlane (Draw_Interpretor& theDi, Standard_Integer theArgsNb, cons std::cout << "Syntax error: need more arguments.\n"; return 1; } - - Graphic3d_MaterialAspect aMat = aClipPlane->CappingMaterial(); - aMat.SetAmbientColor (aColor); - aMat.SetDiffuseColor (aColor); - aClipPlane->SetCappingMaterial (aMat); + aClipPlane->SetCappingColor (aColor); anArgIter += aNbParsed; } + else if (aNbChangeArgs >= 1 + && (aChangeArg == "-material" + || aChangeArg == "material")) + { + ++anArgIter; + Graphic3d_NameOfMaterial aMatName; + if (!Graphic3d_MaterialAspect::MaterialFromName (aChangeArgs[1], aMatName)) + { + std::cout << "Syntax error: unknown material '" << aChangeArgs[1] << "'.\n"; + return 1; + } + aClipPlane->SetCappingMaterial (aMatName); + } else if ((aChangeArg == "-transparency" || aChangeArg == "-transp") && aNbChangeArgs >= 2)