VTK  9.3.1
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:
35  static vtkMergeTimeFilter* New();
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 
77  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
78  vtkInformationVector* outputVector) override;
79 
83  int RequestUpdateExtent(vtkInformation* request, vtkInformationVector** inputVector,
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
#define VTK_DOUBLE_MAX
Definition: vtkType.h:154
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
std::vector< double > OutputTimeSteps
static vtkMultiBlockDataSetAlgorithm * New()
Create a multiblock containing one block per input, with unified timestep list.
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
a simple class to control print indentation
Definition: vtkIndent.h:28
std::vector< std::vector< double > > InputsTimeSteps
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
Store zero or more vtkInformation instances.
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.