From 3b1d145d0e194bd4e4bad370041f25b3c56ebb1f Mon Sep 17 00:00:00 2001 From: apo Date: Wed, 10 May 2006 12:31:42 +0000 Subject: [PATCH] Fix for Bug12376 "Shading" is lost after switching between "Surface-Wireframe" display modes. --- src/OBJECT/VISU_ScalarMapAct.cxx | 31 ++++++++++++++++---- src/OBJECT/VISU_ScalarMapAct.h | 49 +++++++++++++++++++++++++------- 2 files changed, 64 insertions(+), 16 deletions(-) diff --git a/src/OBJECT/VISU_ScalarMapAct.cxx b/src/OBJECT/VISU_ScalarMapAct.cxx index 93445e00..8d21b4cc 100644 --- a/src/OBJECT/VISU_ScalarMapAct.cxx +++ b/src/OBJECT/VISU_ScalarMapAct.cxx @@ -90,9 +90,16 @@ VISU_ScalarMapAct int VISU_ScalarMapAct -::GetVisibility() +::GetBarVisibility() { - return Superclass::GetVisibility(); + return myBarVisibility; +} + +VISU_ScalarBarActor* +VISU_ScalarMapAct +::GetScalarBar() +{ + return myScalarBar; } void @@ -103,7 +110,20 @@ VISU_ScalarMapAct if(myScalarBar) myScalarBar->SetVisibility(myBarVisibility); } -void VISU_ScalarMapAct::SetShading(bool theOn) + +void +VISU_ScalarMapAct +::SetRepresentation(int theMode) +{ + bool anIsShanding = IsShading(); + Superclass::SetRepresentation(theMode); + SetShading(anIsShanding); +} + + +void +VISU_ScalarMapAct +::SetShading(bool theOn) { vtkProperty* aProperty = GetProperty(); @@ -117,10 +137,11 @@ void VISU_ScalarMapAct::SetShading(bool theOn) aProperty->SetAmbient(1.0); aProperty->SetDiffuse(0.0); } - myProperty->DeepCopy(aProperty); } -bool VISU_ScalarMapAct::IsShading() +bool +VISU_ScalarMapAct +::IsShading() { vtkProperty* aProperty = GetProperty(); diff --git a/src/OBJECT/VISU_ScalarMapAct.h b/src/OBJECT/VISU_ScalarMapAct.h index 1d8197a1..fcafa376 100644 --- a/src/OBJECT/VISU_ScalarMapAct.h +++ b/src/OBJECT/VISU_ScalarMapAct.h @@ -33,25 +33,52 @@ class VISU_ScalarBarActor; -class VTKOCC_EXPORT VISU_ScalarMapAct : public VISU_Actor { +class VTKOCC_EXPORT VISU_ScalarMapAct : public VISU_Actor +{ public: vtkTypeMacro(VISU_ScalarMapAct,VISU_Actor); - static VISU_ScalarMapAct* New(); + + static + VISU_ScalarMapAct* + New(); + ~VISU_ScalarMapAct(); - virtual void AddToRender(vtkRenderer* theRenderer); - virtual void RemoveFromRender(vtkRenderer* theRenderer); + virtual + void + AddToRender(vtkRenderer* theRenderer); + + virtual + void + RemoveFromRender(vtkRenderer* theRenderer); + + virtual + void + SetVisibility(int theMode); + + virtual + int + GetBarVisibility(); + + virtual + VISU_ScalarBarActor* + GetScalarBar(); - virtual void SetVisibility(int theMode); - virtual int GetVisibility(); + virtual + void + SetBarVisibility(bool theMode); - virtual VISU_ScalarBarActor* GetScalarBar(){ return myScalarBar;} + virtual + void + SetRepresentation(int theMode); - virtual void SetBarVisibility(bool theMode); - virtual bool GetBarVisibility(){ return myBarVisibility;} + virtual + void + SetShading(bool theOn = true); - virtual void SetShading(bool theOn = true); - virtual bool IsShading(); + virtual + bool + IsShading(); protected: VISU_ScalarMapAct(); -- 2.39.2