From 4ad06ba86f26088fd69e3ff18dea2a4deea64c6e Mon Sep 17 00:00:00 2001 From: mzn Date: Thu, 27 Oct 2005 11:46:15 +0000 Subject: [PATCH] Fix for bug PAL9160 ( No shading on visualizations ). --- src/OBJECT/Makefile.in | 2 +- src/OBJECT/VISU_ScalarMapAct.cxx | 26 +++++++++++++++++++++++++- src/OBJECT/VISU_ScalarMapAct.h | 3 +++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/OBJECT/Makefile.in b/src/OBJECT/Makefile.in index 980c00d7..6c2ba23c 100644 --- a/src/OBJECT/Makefile.in +++ b/src/OBJECT/Makefile.in @@ -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 diff --git a/src/OBJECT/VISU_ScalarMapAct.cxx b/src/OBJECT/VISU_ScalarMapAct.cxx index 01449f79..c34a8e7f 100644 --- a/src/OBJECT/VISU_ScalarMapAct.cxx +++ b/src/OBJECT/VISU_ScalarMapAct.cxx @@ -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); +} diff --git a/src/OBJECT/VISU_ScalarMapAct.h b/src/OBJECT/VISU_ScalarMapAct.h index bae6e529..1d8197a1 100644 --- a/src/OBJECT/VISU_ScalarMapAct.h +++ b/src/OBJECT/VISU_ScalarMapAct.h @@ -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; -- 2.39.2