[vtkusers] Display vtk render result in a view of vc
pagen_ivan at sohu.com
pagen_ivan at sohu.com
Tue Nov 9 22:22:59 EST 2004
Hi:
I want to display the render result in a view inherited from CFormView of VC. The following code is written in a command handling function of MyView.cpp:
.....
vtkRenderWindow * Renderwindow=vtkRenderWindow::New();
RenderWindow->AddRenderer(Render);
RenderWindow->SetParentId(m_hWnd);
vtkRenderWindowInteractor *iren=vtkRenderWindowInteractor::New();
iren->SetRenderWindow(RenderWindow);
iren->Initialize();
RenderWindow->Start();
iren->Start();
iren->Delete();
RenderWindow->Delete();
.....
Till now I'v got the render result in my view, but there remains two problems:
1. After I terminate the programe, the process of this programe is still running. But if "RenderWindow->SetParentId(m_hWnd);" is removed, it worked properly;
2. When the programe is running, if I open another data file the render result could be displayed. But then I click the mouse in the render window, the render result of last data file display again;
Could somebody help me? Thanks!
ivan
2004.11.10
More information about the vtkusers
mailing list