[vtkusers] Close vtk render window when parent Dialog closes.

madz madaramh at gmail.com
Thu Jan 9 00:54:04 EST 2014


I have an application where when the user clicks on a right click menu item
of a MFC dialog a vtkChart is displayed as in example 
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Plotting/LinePlot
<http://www.vtk.org/Wiki/VTK/Examples/Cxx/Plotting/LinePlot>  . However when
I close the dialog the render window still remains.

I tried creating a class variable for vtkContextView and the following lines
of code in the dialog OnClose() and OnDistroy(), 

vtkSmartPointer<vtkContextView> view;
void TASViewer::OnClose()
{
        view->GetRenderer()->Delete();
        view->GetRenderWindow()->Delete();
        view->GetInteractor()->Delete();
	CDialog::OnClose();
}

Now when I close the dialog without closing the render window, the render
window closes as well, however if I try to close the render window first;
the dialog gets closed as well.

What should I do to avoid this situation?





--
View this message in context: http://vtk.1045678.n5.nabble.com/Close-vtk-render-window-when-parent-Dialog-closes-tp5725284.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list