[vtkusers] Multiple renderes and interactor callback

sfaisalali91 sfaisal.ali91 at gmail.com
Tue Aug 26 06:15:54 EDT 2014


hey guys, 
 
 I am trying to synchronize MPR view with Volume rendering view and to
achieve this i am using multiple viewports (3 to display Mpr and 1 to
display volume) and an interactor for overall interaction making use of
vtkInteractorStyleSwitch and vtkInteractorStyleImage. 

Using a callback function and MouseMoveEvent i am able to achieve the
desired i.e, volume renders independently (only at the first interaction)
and as i move the 3d cursor to slice through different orientations the
volume rotates accordingly, but i am facing a problem interacting and
resetting the interactor of volume renderer after interacting with the MPR
views as the camera of volume renderer is synchronized with other views. i
tried to reset the camera, assign another camera and also tried calling
another function to reinitialize interactor of volume renderer but
everything in vain. 

Here is a snippet of my call back function. 

vtkRenderer *pokedRenderer = iren->FindPokedRenderer(currPos[0],
currPos[1]); //mouse movement  
	 if (event == vtkCommand::MouseMoveEvent) 
		{
        	if (pokedRenderer == renn[0])
			{
			iren->SetInteractorStyle(ImageIren);
			ImageRenderer->SetActiveCamera(renn[2]->GetActiveCamera());
			}
			else if (pokedRenderer == renn[1])
			{
			iren->SetInteractorStyle(ImageIren);
			ImageRenderer->SetActiveCamera(renn[0]->GetActiveCamera());
			}
			else if (pokedRenderer == renn[2])
			{
			iren->SetInteractorStyle(ImageIren);
			ImageRenderer->SetActiveCamera(renn[1]->GetActiveCamera());
			}
			else if (pokedRenderer == ImageRenderer)  //Volume Renderer
			{
			ImageIren->Delete();
			iren->RemoveObserver(MouseMoveEvent);
			iren->SetInteractorStyle(VolumeIren);
                        iren->ReInitialize();
			VolumeIren->Rotate();
			ImageRenderer->ResetCamera();
                       //ImageRenderer->ResetCameraClippingRange();
			iren->Render();
			}
	    }
	 
	 }; 

I highly appreciate your help.

Thanks & Regards 
Ali



--
View this message in context: http://vtk.1045678.n5.nabble.com/Multiple-renderes-and-interactor-callback-tp5728393.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list