Salome HOME
Update Help for VISU module.
[modules/visu.git] / src / OBJECT / VISU_Actor.cxx
index 74036d0c95feaf8803f1ee9f6f825a76415898b2..e38b8cd3a139f4aec69ef7ec76bac64a61138d5a 100644 (file)
@@ -28,9 +28,9 @@
 
 #include "VISU_Actor.h"
 #include "VISU_PipeLine.hxx"
-#include "SALOME_ShrinkFilter.h"
-#include "SALOME_GeometryFilter.h"
-#include "SALOME_PassThroughFilter.h"
+#include "VTKViewer_ShrinkFilter.h"
+#include "VTKViewer_GeometryFilter.h"
+#include "VTKViewer_PassThroughFilter.h"
  
 #include <stdexcept>
 
@@ -56,10 +56,8 @@ static int MYVTKDEBUG = 0;
 
 #ifdef _DEBUG_
 static int MYDEBUG = 1;
-static int MYDEBUGWITHFILES = 0;
 #else
 static int MYDEBUG = 0;
-static int MYDEBUGWITHFILES = 0;
 #endif
 
 //=======================================================================
@@ -76,7 +74,7 @@ VISU_Actor::VISU_Actor(){
 
   myIsShrunk = false;
   myIsShrinkable = false;
-  myShrinkFilter = SALOME_ShrinkFilter::New();
+  myShrinkFilter = VTKViewer_ShrinkFilter::New();
   myShrinkFilter->SetStoreMapping(true);
   SetShrinkFactor();
   
@@ -84,15 +82,6 @@ VISU_Actor::VISU_Actor(){
 
   myIO = NULL;
   myName = "";
-
-  vtkProperty* aProperty = GetProperty();
-  aProperty->SetAmbient(0.5); 
-  aProperty->SetDiffuse(0.2);
-  aProperty->SetSpecular(0.2);
-  aProperty->SetAmbientColor(1, 1, 1);
-  aProperty->SetDiffuseColor(1, 1, 1);
-  aProperty->SetSpecularColor(0.5, 0.5, 0.5);
-  this->SetProperty(aProperty);
 }
 
 VISU_Actor::~VISU_Actor(){
@@ -125,20 +114,23 @@ void VISU_Actor::SetPipeLine(VISU_PipeLine* thePipeLine) {
     this->Modified();
     vtkMapper *aMapper = myPipeLine->GetMapper();
     vtkDataSet *aDataSet = aMapper->GetInput();
-    if(!aDataSet)
-      throw std::runtime_error("VISU_Actor::SetPipeLine >> There is no input data !!!");
-    aDataSet->Update();
-    static float eps = VTK_LARGE_FLOAT * 0.1 ;
-    if(aDataSet->GetLength() > eps)
-      throw std::runtime_error("VISU_Actor::SetPipeLine >> Diagonal of the actor is too large !!!");
-    if(!aDataSet->GetNumberOfCells())
-      throw std::runtime_error("VISU_Actor::SetPipeLine >> There is no visible elements");
+
+    //This code has been moved into VISU::Prs3d_i::UpdateActor() for bug 9808
+    //if(!aDataSet)
+    //  throw std::runtime_error("VISU_Actor::SetPipeLine >> There is no input data !!!");
+    //aDataSet->Update();
+    //static float eps = VTK_LARGE_FLOAT * 0.1 ;
+    //if(aDataSet->GetLength() > eps)
+    //  throw std::runtime_error("VISU_Actor::SetPipeLine >> Diagonal of the actor is too large !!!");
+    //if(!aDataSet->GetNumberOfCells())
+    //  throw std::runtime_error("VISU_Actor::SetPipeLine >> There is no visible elements");
+
     //Bug SAL4221:  Mesh with less than 10 cells : shrink mode disable
     //SetShrinkable(aDataSet->GetNumberOfCells() > 10);
-    SetShrinkable(true);
+    SetShrinkable(thePipeLine->IsShrinkable());
     //Now, we use vtkShrinkPolyData (not vtkShrinkFilter), 
     //and the class there is no such limitation.
-    
+
     myMapper->SetInput(aDataSet);
     SetMapper(myMapper);
   }
@@ -205,14 +197,6 @@ int VISU_Actor::GetVisibility(){
   return SALOME_Actor::GetVisibility();
 }
 
-void VISU_Actor::SetProperty(vtkProperty* theProperty){
-  SALOME_Actor::SetProperty(theProperty);
-}
-
-vtkProperty* VISU_Actor::GetProperty(){
-  return SALOME_Actor::GetProperty();
-}
-
 void VISU_Actor::SetLineWidth(float theLineWidth){
   GetProperty()->SetLineWidth(theLineWidth);
 }