]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for bug PAL9160 ( No shading on visualizations ).
authormzn <mzn@opencascade.com>
Thu, 27 Oct 2005 11:46:15 +0000 (11:46 +0000)
committermzn <mzn@opencascade.com>
Thu, 27 Oct 2005 11:46:15 +0000 (11:46 +0000)
src/OBJECT/Makefile.in
src/OBJECT/VISU_ScalarMapAct.cxx
src/OBJECT/VISU_ScalarMapAct.h

index 980c00d7baa90d798da941d66a2eab93370d0ea2..6c2ba23cc3c08eefa0a2ac8e4e059a85804483f3 100644 (file)
@@ -45,7 +45,7 @@ LIB_CLIENT_IDL =
 BIN = 
 BIN_SRC        =
 
-CPPFLAGS+= $(OCC_INCLUDES) $(VTK_INCLUDES) \
+CPPFLAGS+= $(OCC_INCLUDES) $(VTK_INCLUDES) $(QT_INCLUDES) \
        -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome
 LDFLAGS+= $(VTK_LIBS) -lSalomeObject -lVisuPipeLine \
        -L${KERNEL_ROOT_DIR}/lib/salome -L${GUI_ROOT_DIR}/lib/salome
index 01449f79b21e3d63a93c441610c1868223ca1c8f..c34a8e7fe24ba42d738cdae0c902cf23123c6f69 100644 (file)
@@ -45,7 +45,7 @@ VISU_ScalarMapAct::VISU_ScalarMapAct(){
   aProperty->SetAmbient(1.0); 
   aProperty->SetDiffuse(0.0);
   aProperty->SetSpecular(0.0);
-
+  
   myProperty->DeepCopy(aProperty);
 }
 
@@ -78,3 +78,27 @@ void VISU_ScalarMapAct::SetBarVisibility(bool theMode){
   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);
+}
index bae6e5295529f0807fde190fe65cd048368a0dd1..1d8197a1edb32bcc87666cc034d1f0de5023a074 100644 (file)
@@ -50,6 +50,9 @@ class VTKOCC_EXPORT VISU_ScalarMapAct : public VISU_Actor {
   virtual void SetBarVisibility(bool theMode);
   virtual bool GetBarVisibility(){ return myBarVisibility;}
 
+  virtual void SetShading(bool theOn = true);
+  virtual bool IsShading();
+
  protected:
   VISU_ScalarMapAct();
   bool myBarVisibility;