VTK  9.3.0
vtkThresholdTextureCoords.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
38 #ifndef vtkThresholdTextureCoords_h
39 #define vtkThresholdTextureCoords_h
40 
41 #include "vtkDataSetAlgorithm.h"
42 #include "vtkFiltersTextureModule.h" // For export macro
43 
44 VTK_ABI_NAMESPACE_BEGIN
45 class VTKFILTERSTEXTURE_EXPORT vtkThresholdTextureCoords : public vtkDataSetAlgorithm
46 {
47 public:
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
55  void ThresholdByLower(double lower);
56 
60  void ThresholdByUpper(double upper);
61 
65  void ThresholdBetween(double lower, double upper);
66 
68 
71  vtkGetMacro(UpperThreshold, double);
72  vtkGetMacro(LowerThreshold, double);
74 
76 
79  vtkSetClampMacro(TextureDimension, int, 1, 3);
80  vtkGetMacro(TextureDimension, int);
82 
84 
87  vtkSetVector3Macro(InTextureCoord, double);
88  vtkGetVectorMacro(InTextureCoord, double, 3);
90 
92 
96  vtkSetVector3Macro(OutTextureCoord, double);
97  vtkGetVectorMacro(OutTextureCoord, double, 3);
99 
100 protected:
102  ~vtkThresholdTextureCoords() override = default;
103 
104  // Usual data generation method
106 
109 
111 
112  double InTextureCoord[3];
113  double OutTextureCoord[3];
114 
115  int (vtkThresholdTextureCoords::*ThresholdFunction)(double s);
116 
117  int Lower(double s) { return (s <= this->LowerThreshold ? 1 : 0); }
118  int Upper(double s) { return (s >= this->UpperThreshold ? 1 : 0); }
119  int Between(double s)
120  {
121  return (s >= this->LowerThreshold ? (s <= this->UpperThreshold ? 1 : 0) : 0);
122  }
123 
124 private:
126  void operator=(const vtkThresholdTextureCoords&) = delete;
127 };
128 
129 VTK_ABI_NAMESPACE_END
130 #endif
Superclass for algorithms that produce output of the same type as input.
a simple class to control print indentation
Definition: vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
compute 1D, 2D, or 3D texture coordinates based on scalar threshold
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ThresholdBetween(double lower, double upper)
Criterion is cells whose scalars are between lower and upper thresholds.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
static vtkThresholdTextureCoords * New()
void ThresholdByLower(double lower)
Criterion is cells whose scalars are less than lower threshold.
void ThresholdByUpper(double upper)
Criterion is cells whose scalars are less than upper threshold.
~vtkThresholdTextureCoords() override=default