[vtkusers] QVTKWidget+vtkImageViewer2

Leonardo Onofri l.onofri at outlook.com
Wed Jun 10 10:33:54 EDT 2015


With the following code I can succesfully draw polydata on image on a windows platform, but not on a linux one.The polydata is actually there becuase I can see it if I change color level. But why is it hidden behind the image and, above all, why that happens on linux only?
The code:
       Widget = new QVTKWidget;       viewer = vtkSmartPointer<vtkImageViewer2>::New();       vtkSmartPointer<myVtkInteractorStyle> style = vtkSmartPointer<myVtkInteractorStyle>::New();
        Widget->GetInteractor()->GetInteractorStyle()->EnabledOff();        Widget->GetInteractor()->Disable();	
	viewer->SetInputData(vtkImporter->GetOutput());	viewer->SetColorLevel(128);	viewer->SetColorWindow(256);	viewer->UpdateDisplayExtent();

	Widget->SetRenderWindow(viewer->GetRenderWindow());	viewer->SetupInteractor(Widget->GetRenderWindow()->GetInteractor());   
		style->SetMyRenderWindow(viewer->GetRenderWindow());				Widget->GetRenderWindow()->GetInteractor()->SetInteractorStyle(style);
	Widget->GetRenderWindow()->GetInteractor()->Initialize();

// create polydata and put it on vtkactor sourceActor...// 
      viewer->GetRenderer()->AddActor(sourceActor);      viewer->Render();


 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150610/7119c178/attachment.html>


More information about the vtkusers mailing list