VTK  9.3.1
vtkSampleFunction.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
21 #ifndef vtkSampleFunction_h
22 #define vtkSampleFunction_h
23 
24 #include "vtkImageAlgorithm.h"
25 #include "vtkImagingHybridModule.h" // For export macro
26 
27 VTK_ABI_NAMESPACE_BEGIN
29 class vtkDataArray;
30 
31 class VTKIMAGINGHYBRID_EXPORT vtkSampleFunction : public vtkImageAlgorithm
32 {
33 public:
35  void PrintSelf(ostream& os, vtkIndent indent) override;
36 
41  static vtkSampleFunction* New();
42 
44 
47  virtual void SetImplicitFunction(vtkImplicitFunction*);
48  vtkGetObjectMacro(ImplicitFunction, vtkImplicitFunction);
50 
52 
55  vtkSetMacro(OutputScalarType, int);
56  vtkGetMacro(OutputScalarType, int);
57  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
58  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
59  void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
60  void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
61  void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
62  void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
63  void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
64  void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
65  void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
66  void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
68 
72  void SetSampleDimensions(int i, int j, int k);
73 
75 
78  void SetSampleDimensions(int dim[3]);
79  vtkGetVectorMacro(SampleDimensions, int, 3);
81 
83 
87  void SetModelBounds(const double bounds[6]);
88  void SetModelBounds(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax);
89  vtkGetVectorMacro(ModelBounds, double, 6);
91 
93 
98  vtkSetMacro(Capping, vtkTypeBool);
99  vtkGetMacro(Capping, vtkTypeBool);
100  vtkBooleanMacro(Capping, vtkTypeBool);
102 
104 
107  vtkSetMacro(CapValue, double);
108  vtkGetMacro(CapValue, double);
110 
112 
115  vtkSetMacro(ComputeNormals, vtkTypeBool);
116  vtkGetMacro(ComputeNormals, vtkTypeBool);
117  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
119 
121 
125  vtkSetStringMacro(ScalarArrayName);
126  vtkGetStringMacro(ScalarArrayName);
128 
130 
134  vtkSetStringMacro(NormalArrayName);
135  vtkGetStringMacro(NormalArrayName);
137 
141  vtkMTimeType GetMTime() override;
142 
143 protected:
152 
153  ~vtkSampleFunction() override;
154 
155  void ReportReferences(vtkGarbageCollector*) override;
156 
159  void Cap(vtkDataArray* s);
160 
162  int SampleDimensions[3];
163  double ModelBounds[6];
165  double CapValue;
170 
171 private:
172  vtkSampleFunction(const vtkSampleFunction&) = delete;
173  void operator=(const vtkSampleFunction&) = delete;
174 };
175 
176 VTK_ABI_NAMESPACE_END
177 #endif
abstract interface for implicit functions
sample an implicit function over a structured point set
#define VTK_UNSIGNED_INT
Definition: vtkType.h:39
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:37
void ReportReferences(vtkGarbageCollector *) override
virtual void ExecuteDataWithInformation(vtkDataObject *output, vtkInformation *outInfo)
This is a convenience method that is implemented in many subclasses instead of RequestData.
Detect and break reference loops.
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_DOUBLE
Definition: vtkType.h:43
void SetOutputScalarTypeToShort()
Set what type of scalar data this source should generate.
#define VTK_FLOAT
Definition: vtkType.h:42
void SetOutputScalarTypeToUnsignedShort()
Set what type of scalar data this source should generate.
void SetOutputScalarTypeToDouble()
Set what type of scalar data this source should generate.
vtkTypeBool ComputeNormals
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
virtual vtkMTimeType GetMTime()
Return this object's modified time.
#define VTK_SHORT
Definition: vtkType.h:36
void SetOutputScalarTypeToLong()
Set what type of scalar data this source should generate.
#define VTK_CHAR
Definition: vtkType.h:33
#define VTK_LONG
Definition: vtkType.h:40
void SetOutputScalarTypeToInt()
Set what type of scalar data this source should generate.
void SetOutputScalarTypeToUnsignedLong()
Set what type of scalar data this source should generate.
vtkImplicitFunction * ImplicitFunction
void SetOutputScalarTypeToUnsignedChar()
Set what type of scalar data this source should generate.
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:35
Generic algorithm superclass for image algs.
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:41
void SetOutputScalarTypeToFloat()
Set what type of scalar data this source should generate.
general representation of visualization data
Definition: vtkDataObject.h:54
void SetOutputScalarTypeToUnsignedInt()
Set what type of scalar data this source should generate.
#define VTK_INT
Definition: vtkType.h:38
void SetOutputScalarTypeToChar()
Set what type of scalar data this source should generate.