VTK: update data points in renderWindow at every simulation timestep

核能气质少年 提交于 2019-12-24 16:37:44

问题


There is a simulation application which outputs some vtk point data every timestep and I would like to render this data at every timestep and also keep it interactive.

I have created a pipeline which takes simulation points (points->SetInputData(data)) as an input and applies a set of filters to it. For the sake of testing I've created a simple timer and added an observer reacting on the timer event:

  renderWindowInteractor->AddObserver(vtkCommand::TimerEvent, cb);
  int timerId = renderWindowInteractor->CreateRepeatingTimer(1000);

This works just as I want it. The only problem left is to add a custom user event. Basically I want to trigger some event at the end of each simulation timestep and update the model in the render window. I saw some of the VTK examples but I still don't get how to do this for my case. Could anyone help?


回答1:


If you connect the visualization pipeline using SetInputConnection connected to the filter, then all you have to do is call Render() on the render window periodically.



来源:https://stackoverflow.com/questions/33504846/vtk-update-data-points-in-renderwindow-at-every-simulation-timestep

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!