From: mzn Date: Thu, 27 Oct 2005 11:46:15 +0000 (+0000) Subject: Fix for bug PAL9160 ( No shading on visualizations ). X-Git-Tag: BR-D5-38-2003_D2005-27-10~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4ad06ba86f26088fd69e3ff18dea2a4deea64c6e;p=modules%2Fvisu.git Fix for bug PAL9160 ( No shading on visualizations ). --- 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;