<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Update:<div><br></div><div>If I modify the z coordinates of the polydata, so that I am sure it is actually in front of the image, nothing changes.</div><div>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.</div><div><br></div><div>Further details:</div><div>Qt 5.4.1</div><div>VTK 6.2</div><div>It works well on Windows 7.</div><div>It does not work on Ubuntu 14.04<br><br><div><hr id="stopSpelling">From: l.onofri@outlook.com<br>To: vtkusers@vtk.org<br>Date: Wed, 10 Jun 2015 16:33:54 +0200<br>Subject: [vtkusers] QVTKWidget+vtkImageViewer2<br><br>
<style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}
.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}
--></style>
<div dir="ltr">With the following code I can succesfully draw polydata on image on a windows platform, but not on a linux one.<div>The polydata is actually there becuase I can see it if I change color level. </div><div>But why is it hidden behind the image and, above all, why that happens on linux only?<div><br></div><div>The code:</div><div><br></div><div><div> Widget = new QVTKWidget;</div><div> viewer = vtkSmartPointer<vtkImageViewer2>::New();</div><div> vtkSmartPointer<myVtkInteractorStyle> style = vtkSmartPointer<myVtkInteractorStyle>::New();</div></div><div><br></div><div><div> Widget->GetInteractor()->GetInteractorStyle()->EnabledOff();</div><div> Widget->GetInteractor()->Disable();<span class="ecxApple-tab-span" style="white-space:pre;"> </span></div><div><br></div><div><span class="ecxApple-tab-span" style="white-space:pre;"> </span>viewer->SetInputData(vtkImporter->GetOutput());</div><div><span class="ecxApple-tab-span" style="white-space:pre;"> </span>viewer->SetColorLevel(128);</div><div><span class="ecxApple-tab-span" style="white-space:pre;"> </span>viewer->SetColorWindow(256);</div><div><span class="ecxApple-tab-span" style="white-space:pre;"> </span>viewer->UpdateDisplayExtent();</div><div><br></div><div><br></div><div><span class="ecxApple-tab-span" style="white-space:pre;"> </span>Widget->SetRenderWindow(viewer->GetRenderWindow());</div><div><span class="ecxApple-tab-span" style="white-space:pre;"> </span>viewer->SetupInteractor(Widget->GetRenderWindow()->GetInteractor()); </div><div><br></div><div><span class="ecxApple-tab-span" style="white-space:pre;"> </span></div><div><span class="ecxApple-tab-span" style="white-space:pre;"> </span>style->SetMyRenderWindow(viewer->GetRenderWindow());</div><div><span class="ecxApple-tab-span" style="white-space:pre;"> </span></div><div><span class="ecxApple-tab-span" style="white-space:pre;"> </span></div><div><span class="ecxApple-tab-span" style="white-space:pre;"> </span>Widget->GetRenderWindow()->GetInteractor()->SetInteractorStyle(style);</div><div><br></div><div><span class="ecxApple-tab-span" style="white-space:pre;"> </span>Widget->GetRenderWindow()->GetInteractor()->Initialize();</div><div><br></div></div><div><br></div><div>// create polydata and put it on vtkactor sourceActor</div><div>...</div><div>// </div><div><br></div><div> viewer->GetRenderer()->AddActor(sourceActor);</div><div> <span style="font-size:12pt;">viewer->Render();</span></div><div><br></div><div><br></div><div><br></div></div> </div>
<br>_______________________________________________
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</div></div> </div></body>
</html>