<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'>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="Apple-tab-span" style="white-space:pre"> </span></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>viewer->SetInputData(vtkImporter->GetOutput());</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>viewer->SetColorLevel(128);</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>viewer->SetColorWindow(256);</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>viewer->UpdateDisplayExtent();</div><div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Widget->SetRenderWindow(viewer->GetRenderWindow());</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>viewer->SetupInteractor(Widget->GetRenderWindow()->GetInteractor()); </div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>style->SetMyRenderWindow(viewer->GetRenderWindow());</div><div><span class="Apple-tab-span" style="white-space:pre"> </span></div><div><span class="Apple-tab-span" style="white-space:pre"> </span></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Widget->GetRenderWindow()->GetInteractor()->SetInteractorStyle(style);</div><div><br></div><div><span class="Apple-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></body>
</html>