VTK  9.3.0
vtkMergeTimeFilter.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
23 #ifndef vtkMergeTimeFilter_h
24 #define vtkMergeTimeFilter_h
25 
26 #include "vtkFiltersGeneralModule.h" // For export macro
28 
29 #include <vector> // Use of dynamically allocated array
30 
31 VTK_ABI_NAMESPACE_BEGIN
32 class VTKFILTERSGENERAL_EXPORT vtkMergeTimeFilter : public vtkMultiBlockDataSetAlgorithm
33 {
34 public:
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
40 
45  vtkSetClampMacro(Tolerance, double, 0, VTK_DOUBLE_MAX);
46  vtkGetMacro(Tolerance, double);
48 
50 
55  vtkSetMacro(UseRelativeTolerance, bool);
56  vtkGetMacro(UseRelativeTolerance, bool);
57  vtkBooleanMacro(UseRelativeTolerance, bool);
59 
61 
65  vtkSetMacro(UseIntersection, bool);
66  vtkGetMacro(UseIntersection, bool);
67  vtkBooleanMacro(UseIntersection, bool);
69 
70 protected:
71  vtkMergeTimeFilter() = default;
72  ~vtkMergeTimeFilter() override = default;
73 
78  vtkInformationVector* outputVector) override;
79 
84  vtkInformationVector* outputVector) override;
85 
90 
95 
100  void MergeTimeSteps(const std::vector<double>& timesteps);
101 
108  double MapToInputTime(int input, double outputTime);
109 
116  bool AreTimesWithinTolerance(double t1, double t2);
117 
118  double Tolerance = 0.00001;
119  bool UseRelativeTolerance = false;
120  bool UseIntersection = false;
121 
122  double RequestedTimeValue = 0.;
123  std::vector<double> OutputTimeSteps;
124  std::vector<std::vector<double>> InputsTimeSteps;
125 
126 private:
127  vtkMergeTimeFilter(const vtkMergeTimeFilter&) = delete;
128  void operator=(const vtkMergeTimeFilter&) = delete;
129 };
130 
131 VTK_ABI_NAMESPACE_END
132 #endif
a simple class to control print indentation
Definition: vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Create a multiblock containing one block per input, with unified timestep list.
double MapToInputTime(int input, double outputTime)
Look for an input time, either:
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Compute global extent and timesteps list, depending on Tolerance.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkMergeTimeFilter * New()
~vtkMergeTimeFilter() override=default
std::vector< std::vector< double > > InputsTimeSteps
bool AreTimesWithinTolerance(double t1, double t2)
Return true if t1 and t2 are within absolute or relative Tolerance.
int FillInputPortInformation(int port, vtkInformation *info) override
Override to allow multiple inputs.
vtkMergeTimeFilter()=default
std::vector< double > OutputTimeSteps
void MergeTimeSteps(const std::vector< double > &timesteps)
Create an ordered combination of given timesteps and current OutputTimeSteps list.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Reimplemented to create a multiblock from inputs.
int RequestUpdateExtent(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Append contribution from each input.
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
#define VTK_DOUBLE_MAX
Definition: vtkType.h:154