From: apo Date: Thu, 27 Oct 2005 14:00:08 +0000 (+0000) Subject: Adjust to HEAD modifications X-Git-Tag: TG-D5-38-2003_D2005-20-12~122 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=76d84a346499e5fd740ead47f1b435b59b410453;p=modules%2Fvisu.git Adjust to HEAD modifications --- diff --git a/src/OBJECT/VISU_ScalarMapAct.cxx b/src/OBJECT/VISU_ScalarMapAct.cxx index 391ec412..527f726f 100644 --- a/src/OBJECT/VISU_ScalarMapAct.cxx +++ b/src/OBJECT/VISU_ScalarMapAct.cxx @@ -47,7 +47,7 @@ VISU_ScalarMapAct aProperty->SetAmbient(1.0); aProperty->SetDiffuse(0.0); aProperty->SetSpecular(0.0); - + myProperty->DeepCopy(aProperty); } @@ -97,3 +97,27 @@ VISU_ScalarMapAct myBarVisibility = theMode; if(myScalarBar) myScalarBar->SetVisibility(myBarVisibility); } + +void VISU_ScalarMapAct::SetShading(bool theOn) +{ + vtkProperty* aProperty = GetProperty(); + + if (theOn) + { + aProperty->SetAmbient(0.0); + aProperty->SetDiffuse(1.0); + } + else + { + aProperty->SetAmbient(1.0); + aProperty->SetDiffuse(0.0); + } + myProperty->DeepCopy(aProperty); +} + +bool VISU_ScalarMapAct::IsShading() +{ + vtkProperty* aProperty = GetProperty(); + + return (aProperty->GetAmbient() == 0 && aProperty->GetDiffuse() == 1); +}