<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I would like to automatically add a glyph filter and render the
correctly scaled spheres after the user has opened a file in my
custom dock widget.<br>
I created a DockWidget using the example in
/examples/Plugins/DockWidget.<br>
When pressing a button a specific file is being opened for the user
by the following calls:<br>
<br>
void on_button_clicked()<br>
{<br>
<span style=" color:#800080;"> QString</span><span style="
color:#c0c0c0;"> </span><span style=" color:#000000;">xdmfFile</span><span
style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span
style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"C:\\..\\unknown_case.xdmf"</span><span
style=" color:#000000;">;</span>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">QStringList</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">visuFiles</span><span style=" color:#000000;">;</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">visuFiles</span><span style=" color:#000000;">.</span><span style=" color:#000000;">append</span><span style=" color:#000000;">(</span><span style=" color:#000000;">xdmfFile</span><span style=" color:#000000;">);</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">pqPipelineSource</span><span style=" color:#000000;">*</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">pqPlinesource</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">pqLoadDataReaction</span><span style=" color:#000000;">::</span><span style=" color:#000000;">loadData</span><span style=" color:#000000;">(</span><span style=" color:#000000;">visuFiles</span><span style=" color:#000000;">);</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">pqPlinesource</span><span style=" color:#000000;">-></span><span style=" color:#000000;">updatePipeline</span><span style=" color:#000000;">();
// TODO:
// add spherical glyph for loaded polyData
// scale spherical glyphs by a scalar attribute/property
// render glyphs
</span></pre>
}<br>
<br>
I would like to include that the code automatically adds spherical
glyphs and renders them for the data just loaded.<br>
<br>
I tried the following code but I am not sure if it works<br>
<br>
<span style=" color:#c0c0c0;"></span><span style="
color:#800080;">vtkSMProxy</span><span style=" color:#c0c0c0;"> </span><span
style=" color:#000000;">*</span><span style=" color:#000000;">myProxy</span><span
style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span
style=" color:#c0c0c0;"> </span><span style=" color:#000000;">pqPlinesource</span><span
style=" color:#000000;">-></span><span style=" color:#000000;">getProxy</span><span
style=" color:#000000;">();</span>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">vtkObjectBase</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">*</span><span style=" color:#000000;">myObject</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">myProxy</span><span style=" color:#000000;">-></span><span style=" color:#000000;">GetClientSideObject</span><span style=" color:#000000;">();</span></pre>
<pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
</pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">vtkAlgorithm</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">*</span><span style=" color:#000000;">myvtkAlgo</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">vtkAlgorithm</span><span style=" color:#000000;">::</span><span style=" color:#000000;">SafeDownCast</span><span style=" color:#000000;">(</span><span style=" color:#000000;">myObject</span><span style=" color:#000000;">);</span></pre>
<pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
</pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">vtkGlyph3D</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">*</span><span style=" color:#000000;">myspheres</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">vtkGlyph3D</span><span style=" color:#000000;">::</span><span style=" color:#000000;">New</span><span style=" color:#000000;">();</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">myspheres</span><span style=" color:#000000;">-></span><span style=" color:#000000;">SetSourceConnection</span><span style=" color:#000000;">(</span><span style=" color:#000000;">myvtkAlgo</span><span style=" color:#000000;">-></span><span style=" color:#000000;">GetOutputPort</span><span style=" color:#000000;">());</span><span style=" color:#008000;"></span></pre>
<br>
<br>
In case this is supposed to work, how can I now update the pipeline
and render the spheres using C++ PV core functionality ? (The user
should also see the result in the pipeline browser dock of the GUI).<br>
<br>
In case my approach is totally wrong, what would be the right way of
handling this situation ?<br>
<br>
Thank you.<br>
<br>
Best regards,<br>
<br>
Florian<br>
</body>
</html>