VTK: Filters/General/vtkMergeTimeFilter.h Source File

| 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
27 #include "vtkMultiBlockDataSetAlgorithm.h"
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();
36 vtkTypeMacro(vtkMergeTimeFilter, vtkMultiBlockDataSetAlgorithm);
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
89 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
90
94 int FillInputPortInformation(int port, vtkInformation* info) override;
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
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkMergeTimeFilter
Create a multiblock containing one block per input, with unified timestep list.
Definition: vtkMergeTimeFilter.h:33
vtkMergeTimeFilter::MapToInputTime
double MapToInputTime(int input, double outputTime)
Look for an input time, either:
vtkMergeTimeFilter::RequestInformation
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Compute global extent and timesteps list, depending on Tolerance.
vtkMergeTimeFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMergeTimeFilter::New
static vtkMergeTimeFilter * New()
vtkMergeTimeFilter::~vtkMergeTimeFilter
~vtkMergeTimeFilter() override=default
vtkMergeTimeFilter::InputsTimeSteps
std::vector< std::vector< double > > InputsTimeSteps
Definition: vtkMergeTimeFilter.h:124
vtkMergeTimeFilter::AreTimesWithinTolerance
bool AreTimesWithinTolerance(double t1, double t2)
Return true if t1 and t2 are within absolute or relative Tolerance.
vtkMergeTimeFilter::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Override to allow multiple inputs.
vtkMergeTimeFilter::vtkMergeTimeFilter
vtkMergeTimeFilter()=default
vtkMergeTimeFilter::OutputTimeSteps
std::vector< double > OutputTimeSteps
Definition: vtkMergeTimeFilter.h:123
vtkMergeTimeFilter::MergeTimeSteps
void MergeTimeSteps(const std::vector< double > &timesteps)
Create an ordered combination of given timesteps and current OutputTimeSteps list.
vtkMergeTimeFilter::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Reimplemented to create a multiblock from inputs.
vtkMergeTimeFilter::RequestUpdateExtent
int RequestUpdateExtent(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Append contribution from each input.
vtkMultiBlockDataSetAlgorithm
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
Definition: vtkMultiBlockDataSetAlgorithm.h:25
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkMultiBlockDataSetAlgorithm.h
VTK_DOUBLE_MAX
#define VTK_DOUBLE_MAX
Definition: vtkType.h:154