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 
43 class VTKFILTERSGENERAL_EXPORT vtkMergeTimeFilter : public vtkMultiBlockDataSetAlgorithm
44 {
45 public:
46  static vtkMergeTimeFilter* New();
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 
81 protected:
82  vtkMergeTimeFilter() = default;
83  ~vtkMergeTimeFilter() override = default;
84 
88  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
89  vtkInformationVector* outputVector) override;
90 
94  int RequestUpdateExtent(vtkInformation* request, vtkInformationVector** inputVector,
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 
137 private:
138  vtkMergeTimeFilter(const vtkMergeTimeFilter&) = delete;
139  void operator=(const vtkMergeTimeFilter&) = delete;
140 };
141 
142 #endif
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165
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:39
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.