<div dir="ltr">Hi, Zoltan,<div><br></div><div> Please, try the .cpp attached. I managed to get the graph showing within the main window and with the interactor working. The two reasons for the misbehavior were:</div><div><br></div><div>1) The code created a new renderer instead of using the view's.</div><div><br></div><div>2) The view and the Qt widget were using different render window objects.</div><div><br></div><div> In conclusion, there were two renderers and two render windows in the program, causing the observed misbehavior. Let us know whether it works.</div><div><br></div><div><div><img src="cid:ii_jp6xogqe1" alt="image.png" width="472" height="370"><br></div></div><div><br></div><div>regards,</div><div><br></div><div>Paulo</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">Em qua, 28 de nov de 2018 às 09:28, Zoltan Kovacs <<a href="mailto:Zoltan.Kovacs@esi-group.com">Zoltan.Kovacs@esi-group.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="DE" link="#0563C1" vlink="#954F72">
<div class="m_2484204286948819807WordSection1">
<pre><span lang="EN-US" style="color:#26282a">Dear all,<u></u><u></u></span></pre>
<div>
<pre><span lang="EN-US" style="color:#26282a"><u></u> <u></u></span></pre>
</div>
<div>
<pre><span lang="EN-US">Based on the<span style="color:#26282a"> example <u></u><u></u></span></span></pre>
</div>
<div>
<pre><span style="color:#26282a"><a href="https://www.vtk.org/Wiki/VTK/Examples/Cxx/InfoVis/ParallelCoordinatesView" target="_blank">https://www.vtk.org/Wiki/VTK/Examples/Cxx/InfoVis/ParallelCoordinatesView</a><u></u><u></u></span></pre>
</div>
<div>
<pre><span lang="EN-US" style="color:#26282a">I created a simple Qt project </span><span lang="EN-US">using<span style="color:#26282a"> the class vtkParallelCoordinatesView. </span> <span style="color:#26282a">It has only a main window with a PushButton and a QWidget to launch a file</span><u></u><u></u></span></pre>
</div>
<div>
<pre><span style="color:#26282a">opening dialog for any CSV file and view its content. </span><span lang="EN-US" style="color:#26282a">I also created a Qt Form</span><span lang="EN-US"> <span style="color:#26282a">Class called "ParallelCoordinatesView" with the public function "View",</span> <span style="color:#26282a">which contains the CSV file reading and the parallel coordinates visualization code from the example.</span> <span style="color:#26282a">I attached the files.</span><u></u><u></u></span></pre>
</div>
<div>
<pre><span lang="EN-US" style="color:#26282a">There are two issues with the functions setting up the render</span><span lang="EN-US"> <span style="color:#26282a">window and the interactor in the public function "View".</span><u></u><u></u></span></pre>
</div>
<div>
<pre><span lang="EN-US" style="color:#26282a"><u></u> <u></u></span></pre>
</div>
<div>
<pre><span style="color:#26282a">These function calls are commented out in the code:<u></u><u></u></span></pre>
</div>
<div>
<pre><span style="color:#26282a"><u></u> <u></u></span></pre>
</div>
<div>
<pre><span style="color:#26282a"> // Set up render window<u></u><u></u></span></pre>
</div>
<div>
<pre><span style="color:#26282a"> view->GetRenderer()->SetBackground(1.0, 1.0, 1.0);<u></u><u></u></span></pre>
</div>
<div>
<pre><span style="color:#26282a"> view->GetRenderer()->GradientBackgroundOff();<u></u><u></u></span></pre>
</div>
<div>
<pre><span style="color:#26282a"> view->GetRenderWindow()->SetSize(1200,600);<u></u><u></u></span></pre>
</div>
<div>
<pre><span style="color:#26282a"> //view->SetInteractor(renderWindowInteractor);<u></u><u></u></span></pre>
</div>
<div>
<pre><span style="color:#26282a"> //view->SetRenderWindow(renderWindow);<u></u><u></u></span></pre>
</div>
<div>
<pre><span style="color:#26282a"> view->ResetCamera();<u></u><u></u></span></pre>
</div>
<div>
<pre><span style="color:#26282a"> view->Render();<u></u><u></u></span></pre>
</div>
<div>
<pre><span style="color:#26282a"> //view->GetInteractor()->Start();<u></u><u></u></span></pre>
</div>
<div>
<pre><span style="color:#26282a"><u></u> <u></u></span></pre>
</div>
<div>
<pre><span lang="EN-US" style="color:#26282a">When I compile and run the code in this form, the </span><span lang="EN-US">parallel coordinates <span style="color:#26282a">view appears in a</span> window<span style="color:#26282a"> </span>detached<span style="color:#26282a"> from</span> <span style="color:#26282a">the Qt </span>M<span style="color:#26282a">ain</span>W<span style="color:#26282a">indow after </span>the <span style="color:#26282a">file </span>test.csv <span style="color:#26282a">has been read from the </span>f<span style="color:#26282a">ile opening dialog. </span><u></u><u></u></span></pre>
</div>
<div>
<pre><span lang="EN-US" style="color:#26282a"><u></u> <u></u></span></pre>
</div>
<div>
<pre><span style="color:#26282a">If I remove the comments only from <u></u><u></u></span></pre>
</div>
<div>
<pre><span style="color:#26282a"> //view->SetInteractor(renderWindowInteractor);<u></u><u></u></span></pre>
</div>
<div>
<pre><span style="color:#26282a"> //view->SetRenderWindow(renderWindow);<u></u><u></u></span></pre>
</div>
<div>
<pre><span lang="EN-US">and <span style="color:#26282a">compile and run the code then the view window appears in the QWidget in the MainWindow, as expected,<u></u><u></u></span></span></pre>
</div>
<div>
<pre><span lang="EN-US" style="color:#26282a">but </span><span lang="EN-US">a<span style="color:#26282a">s soon as I start to move the cursor, everything blacks out in the Mainwindow.<u></u><u></u></span></span></pre>
</div>
<div>
<pre><span lang="EN-US" style="color:#26282a"><u></u> <u></u></span></pre>
</div>
<div>
<pre><span style="color:#26282a">If remove the comment only from the line </span><u></u><u></u></pre>
<pre><span lang="EN-US" style="color:#26282a"> //view->GetInteractor()->Start();<u></u><u></u></span></pre>
</div>
<div>
<pre><span lang="EN-US" style="color:#26282a">the I can select lines in the parallel coodinates view</span><span lang="EN-US"> vindow<span style="color:#26282a">, as expected with starting the interactor,<u></u><u></u></span></span></pre>
</div>
<div>
<pre><span lang="EN-US" style="color:#26282a">but the Mainwindow hangs</span><span lang="EN-US">.<span style="color:#26282a"> <u></u><u></u></span></span></pre>
</div>
<div>
<pre><span lang="EN-US" style="color:#26282a"><u></u> <u></u></span></pre>
</div>
<div>
<pre><span lang="EN-US" style="color:#26282a">I would like to ask if there is a proper setup of the render window and the interactor for the class vtkParallelCoordinatesView with Qt? </span><span style="color:#26282a">Th</span>an<span style="color:#26282a">k you very much for your help.</span><span lang="EN-US"><u></u><u></u></span></pre>
</div>
<div>
<pre><span style="color:#26282a"><u></u> <u></u></span></pre>
</div>
<div>
<pre><span style="color:#26282a">Kind regards,<u></u><u></u></span></pre>
</div>
<div>
<pre><span style="color:#26282a">Zoltan<u></u><u></u></span></pre>
</div>
<pre><span style="color:#26282a"><u></u> <u></u></span></pre>
</div>
</div>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">https://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</blockquote></div>