VTK  9.7.1
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 
62 VTK_ABI_NAMESPACE_BEGIN
64 class vtkDataSet;
65 class vtkFieldData;
66 
67 class VTKFILTERSTEMPORAL_EXPORT vtkCriticalTime : public vtkPassInputTypeAlgorithm
68 {
69 public:
71 
75 #ifndef __VTK_WRAP__
76 #undef vtkPassInputTypeAlgorithm
77 #endif
78  static vtkCriticalTime* New();
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 
175 protected:
176  vtkCriticalTime();
177  ~vtkCriticalTime() override = default;
178 
179  int FillInputPortInformation(int port, vtkInformation* info) override;
180 
181  int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
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 
191 private:
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 
205 VTK_ABI_NAMESPACE_END
206 #endif //_vtkCriticalTime_h
void SetThresholdCriterionToUpper()
Get/Set the threshold criterion, defining which threshold bounds to use.
#define vtkCreateWrappedTemporalAlgorithmInterface()
Superclass for algorithms that produce output of the same type as input.
Store vtkAlgorithm input/output information.
void SetComponentModeToUseAll()
Control how the decision of in / out is made with multi-component data.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
ThresholdType
Possible values for the threshold criterion:
#define VTK_INT_MAX
Definition: vtkType.h:192
void SetThresholdCriterionToLower()
Get/Set the threshold criterion, defining which threshold bounds to use.
abstract superclass for composite (multi-block or AMR) datasets
a simple class to control print indentation
Definition: vtkIndent.h:28
void SetThresholdCriterionToBetween()
Get/Set the threshold criterion, defining which threshold bounds to use.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
virtual int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called within ProcessRequest when a request asks the algorithm to create empty output data ob...
Compute time step at which a threshold value has been reached.
void SetComponentModeToUseSelected()
Control how the decision of in / out is made with multi-component data.
void SetComponentModeToUseAny()
Control how the decision of in / out is made with multi-component data.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Store zero or more vtkInformation instances.
static vtkPassInputTypeAlgorithm * New()
Represents and manipulates a collection of data arrays.
Definition: vtkFieldData.h:51