Share interactors

Hi all,

I am trying to share the same interactor among three renderers. here is the code i tried but it will only apply in to the last renderer. Any hints how to do this properly?

vtkSmartPointeriact=
vtkSmartPointer::New();

this->AxialViewer->ViewRenderer->GetRenderWindow()->SetInteractor(iact);
this->SagittalViewer->ViewRenderer->GetRenderWindow()->SetInteractor(this->AxialViewer->ViewRenderer->GetRenderWindow()->GetInteractor());
this->CoronalViewer->ViewRenderer->GetRenderWindow()->SetInteractor(this->AxialViewer->ViewRenderer->GetRenderWindow()->GetInteractor());

this->AxialViewer->ViewRenderer->Render();
this->AxialViewer->ViewRenderer->GetRenderWindow()->GetInteractor()->Start();
this->SagittalViewer->ViewRenderer->Render();
this->SagittalViewer->ViewRenderer->GetRenderWindow()->GetInteractor()->Start();
this->CoronalViewer->ViewRenderer->Render();
this->CoronalViewer->ViewRenderer->GetRenderWindow()->GetInteractor()->Start();

Thanks,
Jothy

Your cannot share interactors between renderers. You can add observers to VTK objects and synchronize their states with corresponding objects in other views.

If you want to implement complex features like this then I would recommend to find an existing open-source application and customize/extend that instead of spending years with redeveloping application-level features. Paraview is a good platform for engineering visualization, 3D Slicer is good for medical imaging, and Kitware has many other more focused applications that you can use.