vtkParallelCoordinatesView with Qt

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

vtkParallelCoordinatesView with Qt

Zoltan Kovacs
Dear all,
 
Based on the example 
I created a simple Qt project using the class vtkParallelCoordinatesView.  It has only a main window with a PushButton and a QWidget to launch a file
opening dialog for any CSV file and view its content. I also created a Qt Form Class called "ParallelCoordinatesView" with the public function "View", which contains the CSV file reading and the parallel coordinates visualization code from the example. I attached the files.
There are two issues with the functions setting up the render window and the interactor in the public function "View".
 
These function calls are commented out in the code:
 
    // Set up render window
    view->GetRenderer()->SetBackground(1.0, 1.0, 1.0);
    view->GetRenderer()->GradientBackgroundOff();
    view->GetRenderWindow()->SetSize(1200,600);
    //view->SetInteractor(renderWindowInteractor);
    //view->SetRenderWindow(renderWindow);
    view->ResetCamera();
    view->Render();
    //view->GetInteractor()->Start();
 
When I compile and run the code in this form, the parallel coordinates view appears in a window detached from the Qt MainWindow after the file test.csv has been read from the file opening dialog. 
 
If I remove the comments only from 
   //view->SetInteractor(renderWindowInteractor);
    //view->SetRenderWindow(renderWindow);
and compile and run the code then the view window appears in the QWidget in the MainWindow, as expected,
but as soon as I start to move the cursor, everything blacks out in the Mainwindow.
 
If remove the comment only from the line  
 //view->GetInteractor()->Start();
the I can select lines in the parallel coodinates view vindow, as expected with starting the interactor,
but the Mainwindow hangs. 
 
I would like to ask if there is a proper setup of the render window and the interactor for the class vtkParallelCoordinatesView with Qt? Thank you very much for your help.
 
Kind regards,
Zoltan
 

_______________________________________________
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:
https://public.kitware.com/mailman/listinfo/vtkusers

main.cpp (240 bytes) Download Attachment
mainwindow.cpp (712 bytes) Download Attachment
mainwindow.h (658 bytes) Download Attachment
mainwindow.ui (1K) Download Attachment
parallelcoordinatesview.cpp (4K) Download Attachment
parallelcoordinatesview.h (2K) Download Attachment
parallelcoordinatesview.ui (572 bytes) Download Attachment
ParCoordView.pro (5K) Download Attachment
test.csv (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: vtkParallelCoordinatesView with Qt

Paulo Carvalho
Hi, Zoltan,

   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:

1) The code created a new renderer instead of using the view's.

2) The view and the Qt widget were using different render window objects.

  In conclusion, there were two renderers and two render windows in the program, causing the observed misbehavior.  Let us know whether it works.

image.png

regards,

Paulo



Em qua, 28 de nov de 2018 às 09:28, Zoltan Kovacs <[hidden email]> escreveu:
Dear all,
 
Based on the example 
I created a simple Qt project using the class vtkParallelCoordinatesView.  It has only a main window with a PushButton and a QWidget to launch a file
opening dialog for any CSV file and view its content. I also created a Qt Form Class called "ParallelCoordinatesView" with the public function "View", which contains the CSV file reading and the parallel coordinates visualization code from the example. I attached the files.
There are two issues with the functions setting up the render window and the interactor in the public function "View".
 
These function calls are commented out in the code:
 
    // Set up render window
    view->GetRenderer()->SetBackground(1.0, 1.0, 1.0);
    view->GetRenderer()->GradientBackgroundOff();
    view->GetRenderWindow()->SetSize(1200,600);
    //view->SetInteractor(renderWindowInteractor);
    //view->SetRenderWindow(renderWindow);
    view->ResetCamera();
    view->Render();
    //view->GetInteractor()->Start();
 
When I compile and run the code in this form, the parallel coordinates view appears in a window detached from the Qt MainWindow after the file test.csv has been read from the file opening dialog. 
 
If I remove the comments only from 
   //view->SetInteractor(renderWindowInteractor);
    //view->SetRenderWindow(renderWindow);
and compile and run the code then the view window appears in the QWidget in the MainWindow, as expected,
but as soon as I start to move the cursor, everything blacks out in the Mainwindow.
 
If remove the comment only from the line  
 //view->GetInteractor()->Start();
the I can select lines in the parallel coodinates view vindow, as expected with starting the interactor,
but the Mainwindow hangs. 
 
I would like to ask if there is a proper setup of the render window and the interactor for the class vtkParallelCoordinatesView with Qt? Thank you very much for your help.
 
Kind regards,
Zoltan
 
_______________________________________________
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:
https://public.kitware.com/mailman/listinfo/vtkusers

_______________________________________________
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:
https://public.kitware.com/mailman/listinfo/vtkusers

parallelcoordinatesview.cpp (4K) Download Attachment