]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for Bug12376
authorapo <apo@opencascade.com>
Wed, 10 May 2006 12:31:42 +0000 (12:31 +0000)
committerapo <apo@opencascade.com>
Wed, 10 May 2006 12:31:42 +0000 (12:31 +0000)
   "Shading" is lost after switching between "Surface-Wireframe" display modes.

src/OBJECT/VISU_ScalarMapAct.cxx
src/OBJECT/VISU_ScalarMapAct.h

index 93445e00fbd7d35206fc6e311d4b997978354769..8d21b4cc35baac223be78136e20ad72aadb8ba80 100644 (file)
@@ -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();
   
index 1d8197a1edb32bcc87666cc034d1f0de5023a074..fcafa376b9155d6dd8b0ea8fc0f1419988cd7b81 100644 (file)
 
 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();