Salome HOME
Fix for Bug IPAL8945
[modules/visu.git] / src / OBJECT / VISU_VectorsAct.cxx
index 30de9bae2b2ed3ede78360aa85e75bf0e0c1e88e..e568a9d419874d49ab4196aea539971945346946 100644 (file)
 
 #include "VISU_VectorsAct.h"
 #include "VISU_VectorsPL.hxx"
-#include "SALOME_PassThroughFilter.h"
+#include "VTKViewer_PassThroughFilter.h"
  
 // VTK Includes
 #include <vtkObjectFactory.h>
+#include <vtkDataSetMapper.h>
+#include <vtkPolyDataMapper.h>
+#include <vtkPolyData.h>
 
-using namespace std;
-
-//=======================================================================
 
+//----------------------------------------------------------------------------
 vtkStandardNewMacro(VISU_VectorsAct);
 
 
-VISU_VectorsAct::VISU_VectorsAct(){}
+//----------------------------------------------------------------------------
+VISU_VectorsAct
+::VISU_VectorsAct():
+  myVectorsPL(NULL)
+{}
 
 
-VISU_VectorsAct::~VISU_VectorsAct(){}
+//----------------------------------------------------------------------------
+VISU_VectorsAct
+::~VISU_VectorsAct()
+{}
 
 
-void VISU_VectorsAct::SetPipeLine(VISU_PipeLine* thePipeLine) {
-  if(myPipeLine = dynamic_cast<VISU_VectorsPL*>(thePipeLine)){
-    VISU_Actor::SetPipeLine(myPipeLine);
-    myPipeLine->Delete();
-  }
+//----------------------------------------------------------------------------
+void 
+VISU_VectorsAct
+::SetPipeLine(VISU_PipeLine* thePipeLine) 
+{
+  myVectorsPL = dynamic_cast<VISU_VectorsPL*>(thePipeLine);
+  VISU_Actor::SetPipeLine(myVectorsPL);
+  myVectorsPL->Delete();
+}
+
+
+//----------------------------------------------------------------------------
+vtkDataSet* 
+VISU_VectorsAct
+::GetInput()
+{
+  return GetCurrentPL()->GetOutput();
 }
 
 
-void VISU_VectorsAct::SetTransform(SALOME_Transform* theTransform){
-  myPipeLine->SetTransform(theTransform);
-  Modified();
+//----------------------------------------------------------------------------
+void
+VISU_VectorsAct
+::SetTransform(VTKViewer_Transform* theTransform)
+{
+  Superclass::SetTransform(theTransform);
+  myVectorsPL->SetTransform(theTransform);
 }
 
 
-void VISU_VectorsAct::SetMapper(vtkMapper* theMapper){
+//----------------------------------------------------------------------------
+void
+VISU_VectorsAct
+::SetMapper(vtkMapper* theMapper)
+{
   if(theMapper){
     myPassFilter[0]->SetInput(theMapper->GetInput());
-    myPassFilter[0]->Update();
+    
     myPassFilter[1]->SetInput(myPassFilter[0]->GetPolyDataOutput());
-    myPassFilter[1]->Update();
+
     myPassFilter[2]->SetInput(myPassFilter[1]->GetPolyDataOutput());
-    myPassFilter[2]->Update();
+
     myPassFilter[3]->SetInput(myPassFilter[2]->GetPolyDataOutput());
-    myPassFilter[3]->Update();
+
     if(vtkDataSetMapper* aMapper = dynamic_cast<vtkDataSetMapper*>(theMapper))
       aMapper->SetInput(myPassFilter[3]->GetPolyDataOutput());
     else if(vtkPolyDataMapper* aMapper = dynamic_cast<vtkPolyDataMapper*>(theMapper))