]> Creatis software - clitk.git/commitdiff
Remove warning with VTK8.1
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Fri, 6 Oct 2017 10:36:08 +0000 (12:36 +0200)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Fri, 6 Oct 2017 10:36:08 +0000 (12:36 +0200)
vv/vvInteractorStyleNavigator.cxx
vv/vvInteractorStyleNavigator.h
vv/vvMainWindow.cxx

index 8ddc4df78c71c06a24a8466ac40664ede6a9ef4a..f3fc53befc9cc1e1edeec2d9093b3044d18dd5c6 100644 (file)
@@ -88,14 +88,14 @@ void vvInteractorStyleNavigator::StartPick()
   if (this->State != VTKIS_NONE) {
     return;
   }
-  this->StartState(VTKIS_PICK);
+  this->StartState(VTKIS_PICK_NEW);
   this->InvokeEvent(vtkCommand::StartPickEvent, this);
 }
 
 //----------------------------------------------------------------------------
 void vvInteractorStyleNavigator::EndPick()
 {
-  if (this->State != VTKIS_PICK) {
+  if (this->State != VTKIS_PICK_NEW) {
     return;
   }
   this->InvokeEvent(vtkCommand::EndPickEvent, this);
@@ -115,7 +115,7 @@ void vvInteractorStyleNavigator::OnMouseMove()
     this->InvokeEvent(vtkCommand::InteractionEvent, NULL);
     break;
 
-  case VTKIS_PICK:
+  case VTKIS_PICK_NEW:
     this->FindPokedRenderer(x, y);
     this->Pick();
     this->InvokeEvent(vtkCommand::InteractionEvent, NULL);
@@ -151,7 +151,7 @@ void vvInteractorStyleNavigator::OnEnter()
   case VTKIS_WINDOW_LEVEL:
     break;
 
-  case VTKIS_PICK:
+  case VTKIS_PICK_NEW:
     break;
 
   case VTKIS_PAN:
@@ -176,7 +176,7 @@ void vvInteractorStyleNavigator::OnLeave()
   case VTKIS_WINDOW_LEVEL:
     break;
 
-  case VTKIS_PICK:
+  case VTKIS_PICK_NEW:
     break;
 
   case VTKIS_PAN:
@@ -266,7 +266,7 @@ void vvInteractorStyleNavigator::OnLeftButtonUp()
 {
   //  DD("OnLeftButtonUp");
   switch (this->State) {
-  case VTKIS_PICK:
+  case VTKIS_PICK_NEW:
     this->EndPick();
     if ( this->Interactor ) {
       this->ReleaseFocus();
index e0de7c0fc0fda275f06fa261b45b17f46747c391..e379292bc62aae2e2b2fdd142d1defb710ffbf60 100644 (file)
@@ -22,7 +22,7 @@
 // Motion flags
 
 #define VTKIS_WINDOW_LEVEL 1024
-#define VTKIS_PICK         1025
+#define VTKIS_PICK_NEW     1025
 
 class vvInteractorStyleNavigator : public vtkInteractorStyle
 
index aa10ded56d9944dcb11d86c8f39085e3bf95f96e..9801e8bbb65575c3a080bed78f6ff8d92ce2b7ab 100644 (file)
@@ -3302,7 +3302,11 @@ void vvMainWindow::SaveScreenshotAllSlices()
     // Screenshot
     vtkSmartPointer<vtkWindowToImageFilter> windowToImageFilter = vtkSmartPointer<vtkWindowToImageFilter>::New();
     windowToImageFilter->SetInput(renderWindow);
+#if VTK_MAJOR_VERSION >= 8 && VTK_MINOR_VERSION >= 1
+    windowToImageFilter->SetScale(1);
+#else
     windowToImageFilter->SetMagnification(1);
+#endif
     windowToImageFilter->SetInputBufferTypeToRGBA(); //also record the alpha (transparency) channel
     windowToImageFilter->Update();
 
@@ -3352,7 +3356,11 @@ void vvMainWindow::SaveScreenshot(QVTKWidget *widget)
   if (!fileName.isEmpty()) {
     vtkSmartPointer<vtkWindowToImageFilter> w2i = vtkSmartPointer<vtkWindowToImageFilter>::New();
     w2i->SetInput(widget->GetRenderWindow());
+#if VTK_MAJOR_VERSION >= 8 && VTK_MINOR_VERSION >= 1
+    w2i->SetScale(1);
+#else
     w2i->SetMagnification(1);
+#endif
     w2i->SetInputBufferTypeToRGBA(); //also record the alpha (transparency) channel
     w2i->Update();
     vtkImageData *image = w2i->GetOutput();