]> SALOME platform Git repositories - modules/geom.git/blobdiff - src/OBJECT/GEOM_DeviceActor.cxx
Salome HOME
Copyright update 2022
[modules/geom.git] / src / OBJECT / GEOM_DeviceActor.cxx
old mode 100755 (executable)
new mode 100644 (file)
index d421ca9..7b27f59
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 #include <vtkStripper.h>  
 #include <vtkPolyDataMapper.h>  
 #include <vtkPolyDataNormals.h>  
-#include <vtkActor.h> 
-#include <VTKViewer_Actor.h>
+#include <vtkActor.h>
 #include <vtkRenderer.h> 
+
+#include <VTKViewer_Actor.h>
+#include <VTKViewer_Transform.h>
+#include <VTKViewer_TransformFilter.h>
+
  
-vtkStandardNewMacro(GEOM_DeviceActor);
+vtkStandardNewMacro(GEOM_DeviceActor)
  
-GEOM_DeviceActor::GEOM_DeviceActor(): 
-  myStripper(vtkStripper::New(),true), 
-  myPolyDataMapper(vtkPolyDataMapper::New(),true), 
-  myPolyDataNormals(vtkPolyDataNormals::New(),true), 
-  myActor(VTKViewer_Actor::New(),true) 
+GEOM_DeviceActor::GEOM_DeviceActor() :
+  myPolyDataNormals(vtkPolyDataNormals::New(), true),
+  myPolyDataMapper(vtkPolyDataMapper::New(), true),
+  myStripper(vtkStripper::New(), true),
+  myActor(VTKViewer_Actor::New(), true),
+  myTransformFilter(VTKViewer_TransformFilter::New())
 { 
-  myStripper->SetInputConnection(myPolyDataNormals->GetOutputPort()); 
-  myPolyDataMapper->SetInputConnection(myStripper->GetOutputPort()); 
+  myStripper->SetInputConnection(myPolyDataNormals->GetOutputPort());
+  myTransformFilter->SetInputConnection(myStripper->GetOutputPort());
+  myPolyDataMapper->SetInputConnection(myTransformFilter->GetOutputPort());
  
   myActor->SetMapper(myPolyDataMapper.Get()); 
   myActor->PickableOff(); 
@@ -56,11 +62,14 @@ SetInput(vtkAlgorithmOutput* thePolyData, bool theUseStripper)
   if(theUseStripper)
   {
     myPolyDataNormals->SetInputConnection(thePolyData); 
-    myStripper->SetInputConnection(myPolyDataNormals->GetOutputPort()); 
-    myPolyDataMapper->SetInputConnection(myStripper->GetOutputPort()); 
+    myStripper->SetInputConnection(myPolyDataNormals->GetOutputPort());
+    myTransformFilter->SetInputConnection(myStripper->GetOutputPort());
+    myPolyDataMapper->SetInputConnection(myTransformFilter->GetOutputPort());
+  }
+  else {
+    myTransformFilter->SetInputConnection(thePolyData);
+    myPolyDataMapper->SetInputConnection(myTransformFilter->GetOutputPort());
   }
-  else 
-    myPolyDataMapper->SetInputConnection(thePolyData); 
 }
  
 void 
@@ -118,3 +127,10 @@ RemoveFromRender(vtkRenderer* theRenderer)
 {
   theRenderer->RemoveActor(myActor.GetPointer());
 }
+
+void
+GEOM_DeviceActor
+::SetTransform(VTKViewer_Transform* theTransform)
+{
+  myTransformFilter->SetTransform(theTransform);
+}