Browse Source

Fix ctkVTKSliceView for VTK v5

The image actors were not added to the renderer.
Julien Finet 11 years ago
parent
commit
f4c42ecc53

+ 6 - 2
Libs/Visualization/VTK/Core/vtkLightBoxRendererManager.cpp

@@ -133,7 +133,9 @@ void RenderWindowItem::SetupImageMapperActor(double colorWindow, double colorLev
   this->ImageActor->GetProperty()->SetDisplayLocationToBackground();
 
   // .. and add it to the renderer
-  //this->Renderer->AddActor2D(this->ImageActor.GetPointer());
+#if VTK_MAJOR_VERSION <= 5
+  this->Renderer->AddActor2D(this->ImageActor.GetPointer());
+#endif
 }
 
 //---------------------------------------------------------------------------
@@ -213,7 +215,9 @@ void RenderWindowItem::SetupHighlightedBoxActor(const double highlightedBoxColor
   this->HighlightedBoxActor->GetProperty()->SetLineWidth(1.0f);
   this->HighlightedBoxActor->SetVisibility(visible);
 
-  //this->Renderer->AddActor2D(this->HighlightedBoxActor);
+#if VTK_MAJOR_VERSION <= 5
+  this->Renderer->AddActor2D(this->HighlightedBoxActor);
+#endif
 }
 
 //-----------------------------------------------------------------------------

+ 1 - 1
Libs/Visualization/VTK/Widgets/ctkVTKSliceView.h

@@ -60,7 +60,7 @@ public:
   void setActiveCamera(vtkCamera * newActiveCamera);
 
   /// Get lightBoxRendererManager
-  vtkLightBoxRendererManager* lightBoxRendererManager() const;
+  Q_INVOKABLE vtkLightBoxRendererManager* lightBoxRendererManager() const;
 
   /// Get overlay renderer
   vtkRenderer* overlayRenderer() const;