]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Adjust to HEAD modifications
authorapo <apo@opencascade.com>
Thu, 27 Oct 2005 14:00:08 +0000 (14:00 +0000)
committerapo <apo@opencascade.com>
Thu, 27 Oct 2005 14:00:08 +0000 (14:00 +0000)
src/OBJECT/VISU_ScalarMapAct.cxx

index 391ec4126e2be4d0e7babfa689c38891b0f4e0ce..527f726f27cb8752d84718de6ffa788ee220f2e6 100644 (file)
@@ -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);
+}