VTK: Imaging/Hybrid/vtkSampleFunction.h Source File

| 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
30 #ifndef vtkSampleFunction_h
31 #define vtkSampleFunction_h
32
33 #include "vtkImageAlgorithm.h"
34 #include "vtkImagingHybridModule.h" // For export macro
35
36 VTK_ABI_NAMESPACE_BEGIN
37 class vtkImplicitFunction;
38 class vtkDataArray;
39
40 class VTKIMAGINGHYBRID_EXPORT vtkSampleFunction : public vtkImageAlgorithm
41 {
42 public:
43 vtkTypeMacro(vtkSampleFunction, vtkImageAlgorithm);
44 void PrintSelf(ostream& os, vtkIndent indent) override;
45
50 static vtkSampleFunction* New();
51
53
56 virtual void SetImplicitFunction(vtkImplicitFunction*);
57 vtkGetObjectMacro(ImplicitFunction, vtkImplicitFunction);
59
61
64 vtkSetMacro(OutputScalarType, int);
65 vtkGetMacro(OutputScalarType, int);
66 void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
67 void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
68 void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
69 void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
70 void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
71 void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
72 void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
73 void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
74 void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
75 void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
77
81 void SetSampleDimensions(int i, int j, int k);
82
84
87 void SetSampleDimensions(int dim[3]);
88 vtkGetVectorMacro(SampleDimensions, int, 3);
90
92
96 void SetModelBounds(const double bounds[6]);
97 void SetModelBounds(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax);
98 vtkGetVectorMacro(ModelBounds, double, 6);
100
102
107 vtkSetMacro(Capping, vtkTypeBool);
108 vtkGetMacro(Capping, vtkTypeBool);
109 vtkBooleanMacro(Capping, vtkTypeBool);
111
113
116 vtkSetMacro(CapValue, double);
117 vtkGetMacro(CapValue, double);
119
121
124 vtkSetMacro(ComputeNormals, vtkTypeBool);
125 vtkGetMacro(ComputeNormals, vtkTypeBool);
126 vtkBooleanMacro(ComputeNormals, vtkTypeBool);
128
130
134 vtkSetStringMacro(ScalarArrayName);
135 vtkGetStringMacro(ScalarArrayName);
137
139
143 vtkSetStringMacro(NormalArrayName);
144 vtkGetStringMacro(NormalArrayName);
146
150 vtkMTimeType GetMTime() override;
151
152 protected:
160 vtkSampleFunction();
161
162 ~vtkSampleFunction() override;
163
164 void ReportReferences(vtkGarbageCollector*) override;
165
166 void ExecuteDataWithInformation(vtkDataObject*, vtkInformation*) override;
167 int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
168 void Cap(vtkDataArray* s);
169
170 int OutputScalarType;
171 int SampleDimensions[3];
172 double ModelBounds[6];
173 vtkTypeBool Capping;
174 double CapValue;
175 vtkImplicitFunction* ImplicitFunction;
176 vtkTypeBool ComputeNormals;
177 char* ScalarArrayName;
178 char* NormalArrayName;
179
180 private:
181 vtkSampleFunction(const vtkSampleFunction&) = delete;
182 void operator=(const vtkSampleFunction&) = delete;
183 };
184
185 VTK_ABI_NAMESPACE_END
186 #endif
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:64
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:80
vtkImageAlgorithm
Generic algorithm superclass for image algs.
Definition: vtkImageAlgorithm.h:39
vtkImplicitFunction
abstract interface for implicit functions
Definition: vtkImplicitFunction.h:59
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkSampleFunction
sample an implicit function over a structured point set
Definition: vtkSampleFunction.h:41
vtkSampleFunction::SetImplicitFunction
virtual void SetImplicitFunction(vtkImplicitFunction *)
Specify the implicit function to use to generate data.
vtkSampleFunction::SetOutputScalarTypeToShort
void SetOutputScalarTypeToShort()
Set what type of scalar data this source should generate.
Definition: vtkSampleFunction.h:72
vtkSampleFunction::SetOutputScalarTypeToUnsignedInt
void SetOutputScalarTypeToUnsignedInt()
Set what type of scalar data this source should generate.
Definition: vtkSampleFunction.h:71
vtkSampleFunction::SetOutputScalarTypeToUnsignedLong
void SetOutputScalarTypeToUnsignedLong()
Set what type of scalar data this source should generate.
Definition: vtkSampleFunction.h:69
vtkSampleFunction::SetOutputScalarTypeToUnsignedShort
void SetOutputScalarTypeToUnsignedShort()
Set what type of scalar data this source should generate.
Definition: vtkSampleFunction.h:73
vtkSampleFunction::New
static vtkSampleFunction * New()
Construct with ModelBounds=(-1,1,-1,1,-1,1), SampleDimensions=(50,50,50), Capping turned off,...
vtkSampleFunction::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSampleFunction::GetMTime
vtkMTimeType GetMTime() override
Return the MTime also considering the implicit function.
vtkSampleFunction::SetSampleDimensions
void SetSampleDimensions(int i, int j, int k)
Specify the dimensions of the data on which to sample.
vtkSampleFunction::Capping
vtkTypeBool Capping
Definition: vtkSampleFunction.h:173
vtkSampleFunction::ExecuteDataWithInformation
void ExecuteDataWithInformation(vtkDataObject *, vtkInformation *) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
vtkSampleFunction::CapValue
double CapValue
Definition: vtkSampleFunction.h:174
vtkSampleFunction::vtkSampleFunction
vtkSampleFunction()
Default constructor.
vtkSampleFunction::OutputScalarType
int OutputScalarType
Definition: vtkSampleFunction.h:170
vtkSampleFunction::SetOutputScalarTypeToChar
void SetOutputScalarTypeToChar()
Set what type of scalar data this source should generate.
Definition: vtkSampleFunction.h:74
vtkSampleFunction::ImplicitFunction
vtkImplicitFunction * ImplicitFunction
Definition: vtkSampleFunction.h:175
vtkSampleFunction::ScalarArrayName
char * ScalarArrayName
Definition: vtkSampleFunction.h:177
vtkSampleFunction::SetSampleDimensions
void SetSampleDimensions(int dim[3])
Specify the dimensions of the data on which to sample.
vtkSampleFunction::SetModelBounds
void SetModelBounds(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax)
Specify the region in space over which the sampling occurs.
vtkSampleFunction::NormalArrayName
char * NormalArrayName
Definition: vtkSampleFunction.h:178
vtkSampleFunction::ReportReferences
void ReportReferences(vtkGarbageCollector *) override
vtkSampleFunction::SetOutputScalarTypeToLong
void SetOutputScalarTypeToLong()
Set what type of scalar data this source should generate.
Definition: vtkSampleFunction.h:68
vtkSampleFunction::~vtkSampleFunction
~vtkSampleFunction() override
vtkSampleFunction::SetOutputScalarTypeToDouble
void SetOutputScalarTypeToDouble()
Set what type of scalar data this source should generate.
Definition: vtkSampleFunction.h:66
vtkSampleFunction::ComputeNormals
vtkTypeBool ComputeNormals
Definition: vtkSampleFunction.h:176
vtkSampleFunction::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkSampleFunction::SetOutputScalarTypeToInt
void SetOutputScalarTypeToInt()
Set what type of scalar data this source should generate.
Definition: vtkSampleFunction.h:70
vtkSampleFunction::SetOutputScalarTypeToFloat
void SetOutputScalarTypeToFloat()
Set what type of scalar data this source should generate.
Definition: vtkSampleFunction.h:67
vtkSampleFunction::Cap
void Cap(vtkDataArray *s)
vtkSampleFunction::SetModelBounds
void SetModelBounds(const double bounds[6])
Specify the region in space over which the sampling occurs.
vtkSampleFunction::SetOutputScalarTypeToUnsignedChar
void SetOutputScalarTypeToUnsignedChar()
Set what type of scalar data this source should generate.
Definition: vtkSampleFunction.h:75
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkImageAlgorithm.h
VTK_SHORT
#define VTK_SHORT
Definition: vtkType.h:36
VTK_UNSIGNED_INT
#define VTK_UNSIGNED_INT
Definition: vtkType.h:39
VTK_DOUBLE
#define VTK_DOUBLE
Definition: vtkType.h:43
VTK_UNSIGNED_CHAR
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:35
VTK_UNSIGNED_SHORT
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:37
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
VTK_INT
#define VTK_INT
Definition: vtkType.h:38
VTK_FLOAT
#define VTK_FLOAT
Definition: vtkType.h:42
VTK_CHAR
#define VTK_CHAR
Definition: vtkType.h:33
VTK_UNSIGNED_LONG
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:41
VTK_LONG
#define VTK_LONG
Definition: vtkType.h:40