[vtkusers] QVTKWidget+vtkImageViewer2

Leonardo Onofri l.onofri at outlook.com
Thu Jun 11 04:25:11 EDT 2015


Update:
If I modify the z coordinates of the polydata, so that I am sure it is actually in front of the image, nothing changes.If I rotate the image I can see that polydata are in front of the image, but when they are aligned in front of the camera, only the image is visible.
Further details:Qt 5.4.1VTK 6.2It works well on Windows 7.It does not work on Ubuntu 14.04

From: l.onofri at outlook.com
To: vtkusers at vtk.org
Date: Wed, 10 Jun 2015 16:33:54 +0200
Subject: [vtkusers] QVTKWidget+vtkImageViewer2




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();


 		 	   		  

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150611/591cac6d/attachment.html>


More information about the vtkusers mailing list