mercredi 31 mai 2017

Multiple RenderWindows in VTK

After searching for quite a while how to have multiple completly independent renderwindows with independent interactors, I only found this: http://ift.tt/2rEQsAT

But that example just states as a question what will happen and doesn't bother to explain how that works. I am calling ->Start() on the last array element and then all start simultaniously? Is that the only way to do it? And why does it even work?

When I try to adapt the code, only the last of the renderwindows actually opens and starts interaction (as you would expect):

pC.UpdateInterface();
pC.InitializeVisualization();

ModelWindow mv;

std::vector<vtkSmartPointer<vtkRenderWindowInteractor> > interactors;
interactors.push_back(pointCloud.renderWindowInteractor);
interactors.push_back(mv.renderWindowInteractor);
interactors[1]->Start();

only starts the mv window.

This:

pC.renderWindowInteractor->Start();
mv.renderWindowInteractor->Start();

also doesn't work, since the first renderWindowInteractor is blocking and the second Start() only gets called when I close the first window.

Aucun commentaire:

Enregistrer un commentaire