Skip to content

Making vtkParticleTracerBase use vtkTemporalAlgorithm

Yohann Bearzi (Kitware) requested to merge yohann.bearzi/vtk:path-filter into master

This changes how classes subclassing vtkParticleTracerBase behave.

The temporal handling of those filters used to be embedded in the filter's algorithm, which produced an unnecessarily complicated, bug prone (there was a setup where these classes had memory leaks), and hard to maintain implementation.

After this MR, there is a sharp separation between handling the temporal aspect of the filters and performing the actual algorithm. All the handling of time is delegated to its new superclass vtkTemporalAlgorithm<vtkPolyDataAlgorithm>, which is now responsible for calling certain subroutines depending on the current state of the filter (Are we resetting the filter? Are we iterating up to a certain timestep?). This is done by calling Initialize, Execute and Finalize at appropriate moments. Subclasses need to maintain a temporal cache that can be converted into a valid output at any time.

Initialize resets the filter. Execute advances one time step, updating the temporal cache (current time step is provided by the API of vtkTemporalAlgorithm). Finalize produces the output from the cache.

vtkParticleTracerBase provides the new location of all particles after its Execute terminates in OutputCoordinates and their related point data in OutputPointData. Subclasses can use those to maintain their temporal cache.

The P filters (`vtkPParticleTracerBase` etc.) are now deprecated, as the multi process logic is moved to the base class. One can use the base class like they used the P class.

Edited by Yohann Bearzi (Kitware)

Merge request reports