Browse Source

Merge branch 'ctkVTKSliceView'

  BUG: Re-added missing implementation of ctkVTKSliceView::{interactorStyle, setInteractor, interactor} methods
Jean-Christophe Fillion-Robin 14 years ago
parent
commit
8ee1ac57bd

+ 25 - 0
Libs/Visualization/VTK/Widgets/ctkVTKSliceView.cpp

@@ -141,6 +141,31 @@ CTK_SET_CXX(ctkVTKSliceView, bool, setRenderEnabled, RenderEnabled);
 CTK_GET_CXX(ctkVTKSliceView, bool, renderEnabled, RenderEnabled);
 
 //----------------------------------------------------------------------------
+vtkRenderWindowInteractor* ctkVTKSliceView::interactor() const
+{
+  CTK_D(const ctkVTKSliceView);
+  return d->RenderWindow->GetInteractor();
+}
+
+//----------------------------------------------------------------------------
+void ctkVTKSliceView::setInteractor(vtkRenderWindowInteractor* newInteractor)
+{
+  CTK_D(const ctkVTKSliceView);
+  d->RenderWindow->SetInteractor(newInteractor);
+}
+
+//----------------------------------------------------------------------------
+vtkInteractorObserver* ctkVTKSliceView::interactorStyle()const
+{
+  CTK_D(const ctkVTKSliceView);
+  if (!d->RenderWindow->GetInteractor())
+    {
+    return 0;
+    }
+  return d->RenderWindow->GetInteractor()->GetInteractorStyle();
+}
+
+//----------------------------------------------------------------------------
 void ctkVTKSliceView::resetCamera()
 {
   CTK_D(ctkVTKSliceView);

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

@@ -78,7 +78,7 @@ public:
   void setInteractor(vtkRenderWindowInteractor* newInteractor);
 
   /// Get current interactor style
-  vtkInteractorObserver* interactorStyle();
+  vtkInteractorObserver* interactorStyle()const;
 
   /// Get corner annotation text
   /// \sa setCornerAnnotationText();