VTK  9.2.6
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=========================================================================*/
35#ifndef vtkMergeTimeFilter_h
36#define vtkMergeTimeFilter_h
37
38#include "vtkFiltersGeneralModule.h" // For export macro
40
41#include <vector> // Use of dynamically allocated array
42
43class VTKFILTERSGENERAL_EXPORT vtkMergeTimeFilter : public vtkMultiBlockDataSetAlgorithm
44{
45public:
48 void PrintSelf(ostream& os, vtkIndent indent) override;
49
51
56 vtkSetClampMacro(Tolerance, double, 0, VTK_DOUBLE_MAX);
57 vtkGetMacro(Tolerance, double);
59
61
66 vtkSetMacro(UseRelativeTolerance, bool);
67 vtkGetMacro(UseRelativeTolerance, bool);
68 vtkBooleanMacro(UseRelativeTolerance, bool);
70
72
76 vtkSetMacro(UseIntersection, bool);
77 vtkGetMacro(UseIntersection, bool);
78 vtkBooleanMacro(UseIntersection, bool);
80
81protected:
82 vtkMergeTimeFilter() = default;
83 ~vtkMergeTimeFilter() override = default;
84
89 vtkInformationVector* outputVector) override;
90
95 vtkInformationVector* outputVector) override;
96
101
105 int FillInputPortInformation(int port, vtkInformation* info) override;
106
111 void MergeTimeSteps(const std::vector<double>& timesteps);
112
119 double MapToInputTime(int input, double outputTime);
120
127 bool AreTimesWithinTolerance(double t1, double t2);
128
129 double Tolerance = 0.00001;
130 bool UseRelativeTolerance = false;
131 bool UseIntersection = false;
132
133 double RequestedTimeValue = 0.;
134 std::vector<double> OutputTimeSteps;
135 std::vector<std::vector<double>> InputsTimeSteps;
136
137private:
138 vtkMergeTimeFilter(const vtkMergeTimeFilter&) = delete;
139 void operator=(const vtkMergeTimeFilter&) = delete;
140};
141
142#endif
a simple class to control print indentation
Definition vtkIndent.h:40
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.
~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.
static vtkMergeTimeFilter * New()
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.
#define VTK_DOUBLE_MAX
Definition vtkType.h:165