<table cellspacing="0" cellpadding="0" border="0"><tr><td valign="top"><div>Has anyone got depth peeling to work inside a QVTKWidget at an Ubuntu ? <br /><br />renderer->GetLastRenderingUsedDepthPeeling();<br /><br />keeps returning 0 (false) after renderer->Render() even though I've set up<br />the renderer for depth peeling:<br /><br />        renderer->GetRenderWindow()->SetAlphaBitPlanes(1);<br />        renderer->GetRenderWindow()->SetMultiSamples(0);<br />        renderer->SetUseDepthPeeling(1);<br />        renderer->SetMaximumNumberOfPeels(100);<br />        renderer->SetOcclusionRatio(0.1);<br /> Qvtkwidget1->GetRenderWindow()->AddRenderer(renderer); // before the parameters set or here?<br /><br />My OS is GNU/Linux Ubuntu 10.04. What may be the reason? <br />Thanks.<br />Regards, Mehmet.</div></td></tr></table> <div id="_origMsg_">
<div>
<br />
<div>
<div style="font-size:0.9em">
<hr size="1">
<b>
<span style="font-weight:bold">From:</span>
</b>
Kyle Lutz <kyle.lutz@kitware.com>; <br>
<b>
<span style="font-weight:bold">To:</span>
</b>
Chao Liang <chaolian@mtu.edu>; <br>
<b>
<span style="font-weight:bold">Cc:</span>
</b>
vtkusers@vtk.org <vtkusers@vtk.org>; <br>
<b>
<span style="font-weight:bold">Subject:</span>
</b>
Re: [vtkusers] VTK 6 vtkCompositeDataDisplayAttributes <br>
<b>
<span style="font-weight:bold">Sent:</span>
</b>
Thu, Aug 15, 2013 9:36:41 PM <br>
</div>
<br>
<table cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td valign="top">On Thu, Aug 15, 2013 at 5:16 PM, Chao Liang <<a ymailto="mailto:chaolian@mtu.edu" href="javascript:return">chaolian@mtu.edu</a>> wrote:<BR>> Hi,<BR>><BR>> From this example,<BR>> <a href="http://vtk.org/gitweb?p=VTK.git;a=blob;f=Rendering/OpenGL/Testing/Cxx/TestMultiblockDisplayProperties.cxx" target=_blank >http://vtk.org/gitweb?p=VTK.git;a=blob;f=Rendering/OpenGL/Testing/Cxx/TestMultiblockDisplayProperties.cxx</a><BR>> It shows how to color each block on a multiblockdataset, but this dataset is<BR>> get from a reader:<BR>> vtkXMLMultiBlockDataReader<BR>><BR>> Then the key line is:<BR>> mapper->SetInputConnection(reader->GetOutputPort());<BR>> then it works, i can see different colors on different blocks.<BR>><BR>> But in my case, say, I already have a vtkMultiBlockDataSet *mb in my code,<BR>> so I don't need to use any reader. Then this is
what I did:<BR>><BR>> vtkCompositeDataGeometryFilter *sgfilter =<BR>> vtkCompositeDataGeometryFilter::New();<BR>> sgfilter->SetInputData(mb);<BR>> sgfilter->Update();<BR>> mapper->SetInputConnection(sgfilter->GetOutputPort());<BR>><BR>> But it doesn't work, I cannot see different colors as I expected.<BR>><BR>> So, what should I do in my case in order to use<BR>> vtkCompositeDataDisplayAttributes class to show different colors in<BR>> different blocks.<BR>><BR><BR>Hi Chao,<BR><BR>Are you sure you're setting the block attributes correctly? For<BR>instance the line "mapper->SetBlockColor(67, 0, 0.33, 0.0);" will set<BR>the color for block #67 to green. If your data set doesn't have a<BR>block with that ID then nothing will happen.<BR><BR>If that doesn't work can you post your full code?<BR><BR>Thanks,<BR>Kyle<BR>_______________________________________________<BR>Powered by www.kitware.com<BR><BR>Visit
other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target=_blank >http://www.kitware.com/opensource/opensource.html</a><BR><BR>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target=_blank >http://www.vtk.org/Wiki/VTK_FAQ</a><BR><BR>Follow this link to subscribe/unsubscribe:<BR><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target=_blank >http://www.vtk.org/mailman/listinfo/vtkusers</a><BR></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>