VTK  9.1.0
vtkMergeTimeFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMergeTimeFilter.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 =========================================================================*/
32 #ifndef vtkMergeTimeFilter_h
33 #define vtkMergeTimeFilter_h
34 
35 #include "vtkFiltersGeneralModule.h" // For export macro
37 
38 #include <vector> // Use of dynamically allocated array
39 
40 class VTKFILTERSGENERAL_EXPORT vtkMergeTimeFilter : public vtkMultiBlockDataSetAlgorithm
41 {
42 public:
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
48 
53  vtkSetClampMacro(Tolerance, double, 0, VTK_DOUBLE_MAX);
54  vtkGetMacro(Tolerance, double);
56 
58 
63  vtkSetMacro(UseRelativeTolerance, bool);
64  vtkGetMacro(UseRelativeTolerance, bool);
65  vtkBooleanMacro(UseRelativeTolerance, bool);
67 
69 
73  vtkSetMacro(UseIntersection, bool);
74  vtkGetMacro(UseIntersection, bool);
75  vtkBooleanMacro(UseIntersection, bool);
77 
78 protected:
79  vtkMergeTimeFilter() = default;
80  ~vtkMergeTimeFilter() override = default;
81 
86  vtkInformationVector* outputVector) override;
87 
92  vtkInformationVector* outputVector) override;
93 
98 
103 
108  void MergeTimeSteps(const std::vector<double>& timesteps);
109 
116  double MapToInputTime(int input, double outputTime);
117 
124  bool AreTimesWithinTolerance(double t1, double t2);
125 
126  double Tolerance = 0.00001;
127  bool UseRelativeTolerance = false;
128  bool UseIntersection = false;
129 
130  double RequestedTimeValue = 0.;
131  std::vector<double> OutputTimeSteps;
132  std::vector<std::vector<double>> InputsTimeSteps;
133 
134 private:
135  vtkMergeTimeFilter(const vtkMergeTimeFilter&) = delete;
136  void operator=(const vtkMergeTimeFilter&) = delete;
137 };
138 
139 #endif
a simple class to control print indentation
Definition: vtkIndent.h:34
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:382
@ port
Definition: vtkX3D.h:453
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165