]> Creatis software - clitk.git/blobdiff - vv/vvToolProfile.h
Update QVTKWidget to QVTKOpenGLNativeWidget for VTK > 8.1
[clitk.git] / vv / vvToolProfile.h
index d59e8035e0f3f1158d2fab1048f0a85e4e7e5411..0f94ff3a9177c52b81afa0e25eaedfc865d2ea3c 100644 (file)
 #define VVTOOLPROFILE_H
 
 #include <QtGlobal>
-#if QT_VERSION < 0x050000
-#include <QtDesigner/QDesignerExportWidget>
-#else
+#if QT_VERSION >= 0x050000
 #include <QtUiPlugin/QDesignerExportWidget>
+#else
+#include <QtDesigner/QDesignerExportWidget>
 #endif
 
 #include "vvToolBase.h"
 #include "vvToolWidgetBase.h"
 #include "vvImageContour.h"
 #include "vvLandmarks.h"
+#include <vtkVersion.h>
+#if (VTK_MAJOR_VERSION == 8 && VTK_MINOR_VERSION >= 1) || VTK_MAJOR_VERSION >= 9
 #include "ui_vvToolProfile.h"
+#else
+#include "ui_vvToolProfileVTK7.h"
+#endif
 #include "vvBinaryImageOverlayActor.h"
 
 #include "clitkProfileImage_ggo.h"
@@ -37,6 +42,7 @@
 #include <vtkTable.h>
 #include <vtkContextView.h>
 #include <vtkContextScene.h>
+#include <vtkTransformPolyDataFilter.h>
 
 //------------------------------------------------------------------------------
 class vvToolProfile:
@@ -51,11 +57,13 @@ class vvToolProfile:
 
   //-----------------------------------------------------
   static void Initialize();
+  void InitializeLine();
   void GetArgsInfoFromGUI();
   virtual void InputIsSelected(vvSlicerManager * m);
 
   bool isPointsSelected();
   void computeProfile();
+  void SetPoints();
 
   //-----------------------------------------------------
   public slots:
@@ -67,7 +75,8 @@ class vvToolProfile:
   void selectPoint2();
   void cancelPoints();
   void SaveAs();
-  void DisplayLine();
+  void DisplayLine(int);
+  void DeleteLine(int);
 
  protected:
   void RemoveVTKObjects();
@@ -75,15 +84,16 @@ class vvToolProfile:
   Ui::vvToolProfile ui;
   args_info_clitkProfileImage mArgsInfo;
   
-  int* mPoint1;
-  int* mPoint2;
+  double* mPoint1;
+  double* mPoint2;
   bool mPoint1Selected;
   bool mPoint2Selected;
   vtkSmartPointer<vtkContextView> mView;
   clitk::ProfileImageGenericFilter::Pointer mFilter;
   std::string mTextFileName;
-  vvImage::Pointer mImageLine;
-  std::vector< vvBinaryImageOverlayActor::Pointer > mOverlayActors;
+  std::vector<vtkSmartPointer<vtkActor> > mLineActors;
+  vtkSmartPointer<vtkPolyData> mLinesPolyData;
+  vtkSmartPointer<vtkTransformPolyDataFilter> mLineTransform;
 
 
 }; // end class vvToolProfile