VTK  9.1.0
vtkMultiTimeStepAlgorithm.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkMultiTimeStepAlgorithm.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
38#ifndef vtkMultiTimeStepAlgorithm_h
39#define vtkMultiTimeStepAlgorithm_h
40
41#include "vtkAlgorithm.h"
42#include "vtkCommonExecutionModelModule.h" // For export macro
43#include "vtkSmartPointer.h" //needed for a private variable
44
45#include "vtkDataObject.h" // needed for the smart pointer
46#include <vector> //needed for a private variable
47
50class VTKCOMMONEXECUTIONMODEL_EXPORT vtkMultiTimeStepAlgorithm : public vtkAlgorithm
51{
52public:
55 void PrintSelf(ostream& os, vtkIndent indent) override;
56
57protected:
59
60 ~vtkMultiTimeStepAlgorithm() override = default;
61
66
68
73 {
74 return 1;
75 }
77
79
84 {
85 return 1;
86 }
88
93 VTK_DEPRECATED_IN_9_1_0("cannot support all input data types; use `Execute` instead.")
95 {
96 return 1;
97 }
98
107 virtual int Execute(vtkInformation* vtkNotUsed(request),
108 const std::vector<vtkSmartPointer<vtkDataObject>>& vtkNotUsed(inputs),
109 vtkInformationVector* vtkNotUsed(outputVector))
110 {
111 return -1;
112 }
113
119 {
120 return 1;
121 }
122
125
128
129private:
131 void operator=(const vtkMultiTimeStepAlgorithm&) = delete;
132 int RequestUpdateIndex; // keep track of the time looping index
133 std::vector<double> UpdateTimeSteps; // store the requested time steps
134 bool IsInCache(double time, size_t& idx);
135 struct TimeCache
136 {
137 TimeCache(double time, vtkDataObject* data)
138 : TimeValue(time)
139 , Data(data)
140 {
141 }
142 double TimeValue;
144 };
145 std::vector<TimeCache> Cache;
146};
147
148#endif
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:114
general representation of visualization data
a simple class to control print indentation
Definition: vtkIndent.h:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Composite dataset that organizes datasets into blocks.
Superclass for algorithms that would like to make multiple time requests.
virtual int Execute(vtkInformation *vtkNotUsed(request), const std::vector< vtkSmartPointer< vtkDataObject > > &vtkNotUsed(inputs), vtkInformationVector *vtkNotUsed(outputVector))
Subclasses should override this method to do the actual execution.
static vtkInformationDoubleVectorKey * UPDATE_TIME_STEPS()
This is filled by the child class to request multiple time steps.
static vtkMultiTimeStepAlgorithm * New()
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
~vtkMultiTimeStepAlgorithm() override=default
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeBool ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
@ vector
Definition: vtkX3D.h:243
@ time
Definition: vtkX3D.h:503
@ data
Definition: vtkX3D.h:321
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_DEPRECATED_IN_9_1_0(reason)