From 76d84a346499e5fd740ead47f1b435b59b410453 Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 27 Oct 2005 14:00:08 +0000 Subject: [PATCH] Adjust to HEAD modifications --- src/OBJECT/VISU_ScalarMapAct.cxx | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) 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); +} -- 2.39.2