From: tbaudier Date: Fri, 6 Oct 2017 10:36:08 +0000 (+0200) Subject: Remove warning with VTK8.1 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=e90f3417df897baa4a768b35374d7a80c5fa688e;p=clitk.git Remove warning with VTK8.1 --- diff --git a/vv/vvInteractorStyleNavigator.cxx b/vv/vvInteractorStyleNavigator.cxx index 8ddc4df..f3fc53b 100644 --- a/vv/vvInteractorStyleNavigator.cxx +++ b/vv/vvInteractorStyleNavigator.cxx @@ -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(); diff --git a/vv/vvInteractorStyleNavigator.h b/vv/vvInteractorStyleNavigator.h index e0de7c0..e379292 100644 --- a/vv/vvInteractorStyleNavigator.h +++ b/vv/vvInteractorStyleNavigator.h @@ -22,7 +22,7 @@ // Motion flags #define VTKIS_WINDOW_LEVEL 1024 -#define VTKIS_PICK 1025 +#define VTKIS_PICK_NEW 1025 class vvInteractorStyleNavigator : public vtkInteractorStyle diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index aa10ded..9801e8b 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -3302,7 +3302,11 @@ void vvMainWindow::SaveScreenshotAllSlices() // Screenshot vtkSmartPointer windowToImageFilter = vtkSmartPointer::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 w2i = vtkSmartPointer::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();