I’ve subclassed QQuickVTKItem to display topographic data stored in a file. The QQuickVTKItem::initializeVTK() method sets up the pipeline elements which in my case includes calling vtkAbstractPolyDataReader::SetFile() and vtkAbstractPolyDataReader::Update(). While my app is running the user may specify a new map file to display. In this case, how can I trigger a call to QQuickVTKItem::initializeVTK() in order to load the new image?
Thanks!
Instead of re-running QQuickVTKItem::initializeVTK(), I believe the app should schedule an update to the pipeline’s reader source, in a function passed to QQuickVTKItem::dispatch_async().
@Tomasso QQuickVTKItem::intializeVTK
should be used to set up the pipeline. So you can connect your reader to filters and finally to the rendering pipeline (mapper, actor, renderer) in initializeVTK
. To change any pipeline inputs, parameters, etc. please use dispatch_async
.