]> Creatis software - clitk.git/commitdiff
Fix the profile line display with transformation
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Tue, 23 Feb 2016 13:45:27 +0000 (14:45 +0100)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Tue, 23 Feb 2016 13:45:27 +0000 (14:45 +0100)
vv/vvToolProfile.cxx
vv/vvToolProfile.h

index 83334a29d55a2425bb0a9037cd6b21084263c18e..f90f6238d2d92949b03d4159138b67c157bcc9ba 100644 (file)
@@ -605,7 +605,10 @@ void vvToolProfile::DisplayLine(int slicer)
 #if VTK_MAJOR_VERSION <= 5
             clipper->SetInput(mLinesPolyData);
 #else
-            clipper->SetInputData(mLinesPolyData);
+            mLineTransform = vtkSmartPointer<vtkTransformPolyDataFilter>::New();
+            mLineTransform->SetInputData(mLinesPolyData);
+            mLineTransform->SetTransform(mCurrentSlicerManager->GetSlicer(slicer)->GetConcatenatedTransform()->GetInverse());
+            clipper->SetInputConnection(mLineTransform->GetOutputPort());
 #endif
             clipper->InsideOutOff();
             clipper->Update();        
index 03fcd0c0a730fd637b481be83d217dfff046fbc5..94b377f31a0c81f9deb4456374c8a783f7f726ea 100644 (file)
@@ -37,6 +37,7 @@
 #include <vtkTable.h>
 #include <vtkContextView.h>
 #include <vtkContextScene.h>
+#include <vtkTransformPolyDataFilter.h>
 
 //------------------------------------------------------------------------------
 class vvToolProfile:
@@ -87,6 +88,7 @@ class vvToolProfile:
   std::string mTextFileName;
   std::vector<vtkSmartPointer<vtkActor> > mLineActors;
   vtkSmartPointer<vtkPolyData> mLinesPolyData;
+  vtkSmartPointer<vtkTransformPolyDataFilter> mLineTransform;
 
 
 }; // end class vvToolProfile