VTK  9.5.2
vtkTemporalAlgorithm Class Reference

Base class for temporal algorithms. More...

#include <vtkTemporalAlgorithm.h>

Detailed Description

Base class for temporal algorithms.

vtkTemporalAlgorithm is a class to template over a subclass of vtkAlgorithm. It effectively implements RequestData, which, depending on the request, will call Initialize, Execute' and / or Finalize. Algorithms subclassing vtkTemporalAlgorithm should provide a temporal cache that on which to accumulate data in order to provide a complete output upon calling Finalize. This algorithm class assumes temporal integration over input port 0, connection 0. Time steps are gathered from its input information, and UPDATE_TIME_STEP()` requests are propagated to this input connection only. Filters taking multiple time series as inputs should probably not inherit from this class.

This class of algorithm handles 2 types of temporal integration, controlled by the member IntegrateFullTimeSeries:

  • When turned ON, integration is performed over the entire input time series for any requested, time step. effectively removing the temporalness of the outputs.
  • When turned OFF, the output remains temporal. It is the result of integrating all time steps up to the time step requested downstream by UPDATE_TIME_STEP().

In any case, this algorithm will request all necessary time steps upstream in order to generate the output, in chronological order, setting the information key CONTINUE_EXECUTING(). The executive of this filter will iterate over all time requests until the output is generating. Initialize will be called if the requested time step is more ancient than the last generated time step. Then, at each iteration, Execute is called. Finally, when the last needed iteration has completed, Finalize is called.

There are cases where the user does not have access to the entire time series at once. This compromises filters that have IntegrateFullTimeSeries ON, and which rely on knowledge provided by the information key TIME_STEPS(). The implementation of this algorithm provides a special mode for such circumstances. All the user needs to do is set the information key NO_PRIOR_TEMPORAL_ACCESS() in the sources. If the information key NO_PRIOR_TEMPORAL_ACCESS() is set on the first input on port 0, then this class will assume that the user is requesting time steps in chronological order using UpdateTimeStep(double) and will provide a complete output at each temporal iteration. Effectively, at each iteration, Execute and Finalize are called. Initialize is called at the first iteration, or when NO_PRIOR_TEMPORAL_ACCESS() is set to vtkStreamingDemandDrivenPipeline::NO_PRIOR_TEMPORAL_ACCESS_RESET. Processed time steps are gathered in an array added to the field data of the outputs. The name of this array is time_steps and can be retrieved through the method TimeStepsArrayName().

Warning
Python wrapping of subclasses require special handling. Here is an example ensuring wrapping works as expected, implementing a temporal algorithm as a vtkPassInputTypeAlgorithm:
#ifndef __VTK_WRAP__
#define vtkPassInputTypeAlgorithm vtkTemporalAlgorithm<vtkPassInputTypeAlgorithm>
#endif
// We make the wrapper think that we inherit from vtkPassInputTypeAlgorithm
class MyTemporalFilter : vtkPassInputTypeAlgorithm
{
public:
vtkTypeMacro(MyTemporalFilter, vtkPassInputTypeAlgorithm);
// We do not need to trick the wrapper with the superclass name anymore
#ifndef __VTK_WRAP__
#undef vtkPassInputTypeAlgorithm
#endif
// We didn't wrap the non-overridden API of vtkTemporalAlgorithm. We define
// the missing API using this macro
#if defined(__VTK_WRAP__) || defined(__WRAP_GCCXML)
#endif
// ...
};
#define vtkCreateWrappedTemporalAlgorithmInterface()
#define vtkPassInputTypeAlgorithm

*/

For export macro For TimeSteps

class vtkDoubleArray; class vtkInformation; class vtkInformationVector;

template <class AlgorithmT> class vtkTemporalAlgorithm : public AlgorithmT { public: / /** Standard methods for instantiation, type information, and printing.


The documentation for this class was generated from the following file: