VTK  9.4.20250131
vtkCriticalTime.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
48#ifndef vtkCriticalTime_h
49#define vtkCriticalTime_h
50
51#include "vtkFiltersTemporalModule.h" // For export macro
53#include "vtkTemporalAlgorithm.h" // For temporal algorithm
54
55#include <limits> // For std::numeric_limits<>::infinity()
56#include <memory> // For unique_pointer
57
58#ifndef __VTK_WRAP__
59#define vtkPassInputTypeAlgorithm vtkTemporalAlgorithm<vtkPassInputTypeAlgorithm>
60#endif
61
62VTK_ABI_NAMESPACE_BEGIN
64class vtkDataSet;
65class vtkFieldData;
66
67class VTKFILTERSTEMPORAL_EXPORT vtkCriticalTime : public vtkPassInputTypeAlgorithm
68{
69public:
71
75#ifndef __VTK_WRAP__
76#undef vtkPassInputTypeAlgorithm
77#endif
79 void PrintSelf(ostream& os, vtkIndent indent) override;
81
82#if defined(__VTK_WRAP__) || defined(__WRAP_GCCXML)
84#endif
85
87
90 vtkGetMacro(LowerThreshold, double);
91 vtkSetMacro(LowerThreshold, double);
93
95
99 vtkGetMacro(UpperThreshold, double);
100 vtkSetMacro(UpperThreshold, double);
102
110 {
111 THRESHOLD_BETWEEN = 0,
113 THRESHOLD_UPPER
114 };
115
117
123 vtkSetClampMacro(ThresholdCriterion, int, THRESHOLD_BETWEEN, THRESHOLD_UPPER);
124 vtkGetMacro(ThresholdCriterion, int);
125 void SetThresholdCriterionToBetween() { this->SetComponentMode(THRESHOLD_BETWEEN); }
126 void SetThresholdCriterionToLower() { this->SetComponentMode(THRESHOLD_LOWER); }
127 void SetThresholdCriterionToUpper() { this->SetComponentMode(THRESHOLD_UPPER); }
129
133 std::string GetThresholdFunctionAsString() const;
134
136 {
137 COMPONENT_MODE_USE_SELECTED = 0,
139 COMPONENT_MODE_USE_ANY
140 };
141
143
152 vtkSetClampMacro(ComponentMode, int, COMPONENT_MODE_USE_SELECTED, COMPONENT_MODE_USE_ANY);
153 vtkGetMacro(ComponentMode, int);
154 void SetComponentModeToUseSelected() { this->SetComponentMode(COMPONENT_MODE_USE_SELECTED); }
155 void SetComponentModeToUseAll() { this->SetComponentMode(COMPONENT_MODE_USE_ALL); }
156 void SetComponentModeToUseAny() { this->SetComponentMode(COMPONENT_MODE_USE_ANY); }
158
162 std::string GetComponentModeAsString() const;
163
165
171 vtkSetClampMacro(SelectedComponent, int, 0, VTK_INT_MAX);
172 vtkGetMacro(SelectedComponent, int);
174
175protected:
177 ~vtkCriticalTime() override = default;
178
179 int FillInputPortInformation(int port, vtkInformation* info) override;
180
182 vtkInformationVector* outputVector) override;
183
184 int Initialize(vtkInformation* request, vtkInformationVector** inputVector,
185 vtkInformationVector* outputVector) override;
186 int Execute(vtkInformation* request, vtkInformationVector** inputVector,
187 vtkInformationVector* outputVector) override;
188 int Finalize(vtkInformation* request, vtkInformationVector** inputVector,
189 vtkInformationVector* outputVector) override;
190
191private:
192 vtkCriticalTime(const vtkCriticalTime&) = delete;
193 void operator=(const vtkCriticalTime&) = delete;
194
195 double LowerThreshold = -std::numeric_limits<double>::infinity();
196 double UpperThreshold = std::numeric_limits<double>::infinity();
197 int ThresholdCriterion = THRESHOLD_BETWEEN;
198 int ComponentMode = COMPONENT_MODE_USE_SELECTED;
199 int SelectedComponent = 0;
200
201 struct vtkCriticalTimeInternals;
202 std::unique_ptr<vtkCriticalTimeInternals> Internals;
203};
204
205VTK_ABI_NAMESPACE_END
206#endif //_vtkCriticalTime_h
abstract superclass for composite (multi-block or AMR) datasets
Compute time step at which a threshold value has been reached.
ThresholdType
Possible values for the threshold criterion:
void SetComponentModeToUseSelected()
Control how the decision of in / out is made with multi-component data.
static vtkCriticalTime * New()
Standard methods for instantiation, type information, and printing.
int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called within ProcessRequest when a request asks the algorithm to create empty output data ob...
void SetComponentModeToUseAny()
Control how the decision of in / out is made with multi-component data.
int Initialize(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
void SetThresholdCriterionToLower()
Get/Set the threshold criterion, defining which threshold bounds to use.
int Execute(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
void SetComponentModeToUseAll()
Control how the decision of in / out is made with multi-component data.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
std::string GetComponentModeAsString() const
Return a string representation of the component mode.
std::string GetThresholdFunctionAsString() const
Return a string representation of the threshold criterion.
~vtkCriticalTime() override=default
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instantiation, type information, and printing.
void SetThresholdCriterionToBetween()
Get/Set the threshold criterion, defining which threshold bounds to use.
void SetThresholdCriterionToUpper()
Get/Set the threshold criterion, defining which threshold bounds to use.
int Finalize(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
abstract class to specify dataset behavior
Definition vtkDataSet.h:165
represent and manipulate fields of data
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce output of the same type as input.
#define vtkCreateWrappedTemporalAlgorithmInterface()
#define VTK_INT_MAX
Definition vtkType.h:144