VTK  9.3.0
vtkGenerateTimeSteps.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
15 #ifndef vtkGenerateTimeSteps_h
16 #define vtkGenerateTimeSteps_h
17 
18 #include "vtkFiltersHybridModule.h" // for export macro
20 
21 #include <vector> // for time steps
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class VTKFILTERSHYBRID_EXPORT vtkGenerateTimeSteps : public vtkPassInputTypeAlgorithm
25 {
26 public:
28  void PrintSelf(ostream& os, vtkIndent indent) override;
29 
31 
35  int GetNumberOfTimeSteps() const { return static_cast<int>(this->TimeStepValues.size()); }
36 
40  void AddTimeStepValue(double timeStepValue);
41 
43 
47  void SetTimeStepValues(int count, const double* timeStepValues);
48  void GetTimeStepValues(double* timeStepValues) const;
50 
54  void GenerateTimeStepValues(double begin, double end, double step);
55 
57 
61  {
62  this->TimeStepValues.clear();
63  this->Modified();
64  }
66 
67 protected:
68  vtkGenerateTimeSteps() = default;
69  ~vtkGenerateTimeSteps() override = default;
70 
73 
74  std::vector<double> TimeStepValues;
75 
76 private:
78  void operator=(const vtkGenerateTimeSteps&) = delete;
79 };
80 VTK_ABI_NAMESPACE_END
81 
82 #endif // vtkGenerateTimeSteps_h
Generate timesteps on any input.
void GetTimeStepValues(double *timeStepValues) const
Get/Set an array of time step values.
int GetNumberOfTimeSteps() const
Get the number of time steps that will be extracted.
~vtkGenerateTimeSteps() override=default
std::vector< double > TimeStepValues
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
vtkGenerateTimeSteps()=default
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks for Information.
static vtkGenerateTimeSteps * New()
void SetTimeStepValues(int count, const double *timeStepValues)
Get/Set an array of time step values.
void GenerateTimeStepValues(double begin, double end, double step)
Generate a range of values in [begin, end) with a step size of 'step'.
void AddTimeStepValue(double timeStepValue)
Add a time step value.
void ClearTimeStepValues()
Clear the time step values.
a simple class to control print indentation
Definition: vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
virtual void Modified()
Update the modification time for this object.
Superclass for algorithms that produce output of the same type as input.