[vtkusers] interaction on a vtkImageViewer

wyssa1 wyssa1 at hta-bi.bfh.ch
Wed Nov 24 10:30:00 EST 2004


Hi all

I use an vtkImageViewer to display an image (vtkImageData). I Setup an  
interactior with default style vtkInteractorStyleImage. But I can't do any  
interaction (zoom, pan, ...) except chaniging the window level. What I'm  
doing wrong?

Here's my code:
...
pInteractor = vtkRenderWindowInteractor::New();
pInteractor->AddObserver(vtkCommand::ErrorEvent,  
p2DViewProc->pO3DvtkCallbackMsg);
pInteractor->AddObserver(vtkCommand::WarningEvent,  
p2DViewProc->pO3DvtkCallbackMsg);
pInteractor->SetRenderWindow(pRenderWindow);
vtkInteractorStyleImage *pInteractorStyle = vtkInteractorStyleImage::New();
pInteractor->SetInteractorStyle(pInteractorStyle);
....

pImageViewer->SetInput(pImageData);
pImageViewer->SetupInteractor(pInteractor);
pImageViewer->SetParentId(hWndData);
pImageViewer->SetSize(pRenderWindow->GetSize());
pImageViewer->GetRenderer()->SetBackground(O3D_VTK_BACKGROUND);
pImageViewer->GetRenderer()->SetActiveCamera(pCamera);
...


Thanks for help

Adrian



More information about the vtkusers mailing list