VTK  9.1.0
vtkSampleFunction.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkSampleFunction.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
39#ifndef vtkSampleFunction_h
40#define vtkSampleFunction_h
41
42#include "vtkImageAlgorithm.h"
43#include "vtkImagingHybridModule.h" // For export macro
44
46class vtkDataArray;
47
48class VTKIMAGINGHYBRID_EXPORT vtkSampleFunction : public vtkImageAlgorithm
49{
50public:
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
59
61
65 vtkGetObjectMacro(ImplicitFunction, vtkImplicitFunction);
67
69
72 vtkSetMacro(OutputScalarType, int);
73 vtkGetMacro(OutputScalarType, int);
74 void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
75 void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
76 void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
77 void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
78 void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
79 void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
80 void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
81 void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
82 void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
83 void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
85
89 void SetSampleDimensions(int i, int j, int k);
90
92
95 void SetSampleDimensions(int dim[3]);
96 vtkGetVectorMacro(SampleDimensions, int, 3);
98
100
104 void SetModelBounds(const double bounds[6]);
105 void SetModelBounds(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax);
106 vtkGetVectorMacro(ModelBounds, double, 6);
108
110
115 vtkSetMacro(Capping, vtkTypeBool);
116 vtkGetMacro(Capping, vtkTypeBool);
117 vtkBooleanMacro(Capping, vtkTypeBool);
119
121
124 vtkSetMacro(CapValue, double);
125 vtkGetMacro(CapValue, double);
127
129
132 vtkSetMacro(ComputeNormals, vtkTypeBool);
133 vtkGetMacro(ComputeNormals, vtkTypeBool);
134 vtkBooleanMacro(ComputeNormals, vtkTypeBool);
136
138
142 vtkSetStringMacro(ScalarArrayName);
143 vtkGetStringMacro(ScalarArrayName);
145
147
151 vtkSetStringMacro(NormalArrayName);
152 vtkGetStringMacro(NormalArrayName);
154
159
160protected:
169
171
173
177
179 int SampleDimensions[3];
180 double ModelBounds[6];
182 double CapValue;
187
188private:
189 vtkSampleFunction(const vtkSampleFunction&) = delete;
190 void operator=(const vtkSampleFunction&) = delete;
191};
192
193#endif
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:59
general representation of visualization data
Definition: vtkDataObject.h:69
Detect and break reference loops.
Generic algorithm superclass for image algs.
abstract interface for implicit functions
a simple class to control print indentation
Definition: vtkIndent.h:43
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
sample an implicit function over a structured point set
virtual void SetImplicitFunction(vtkImplicitFunction *)
Specify the implicit function to use to generate data.
void SetOutputScalarTypeToShort()
Set what type of scalar data this source should generate.
void SetOutputScalarTypeToUnsignedInt()
Set what type of scalar data this source should generate.
void SetOutputScalarTypeToUnsignedLong()
Set what type of scalar data this source should generate.
void SetOutputScalarTypeToUnsignedShort()
Set what type of scalar data this source should generate.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMTimeType GetMTime() override
Return the MTime also considering the implicit function.
void SetSampleDimensions(int i, int j, int k)
Specify the dimensions of the data on which to sample.
void ExecuteDataWithInformation(vtkDataObject *, vtkInformation *) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
vtkSampleFunction()
Default constructor.
void SetOutputScalarTypeToChar()
Set what type of scalar data this source should generate.
vtkImplicitFunction * ImplicitFunction
void SetSampleDimensions(int dim[3])
Specify the dimensions of the data on which to sample.
static vtkSampleFunction * New()
Construct with ModelBounds=(-1,1,-1,1,-1,1), SampleDimensions=(50,50,50), Capping turned off,...
void SetModelBounds(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax)
Specify the region in space over which the sampling occurs.
void ReportReferences(vtkGarbageCollector *) override
void SetOutputScalarTypeToLong()
Set what type of scalar data this source should generate.
~vtkSampleFunction() override
void SetOutputScalarTypeToDouble()
Set what type of scalar data this source should generate.
vtkTypeBool ComputeNormals
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
void SetOutputScalarTypeToInt()
Set what type of scalar data this source should generate.
void SetOutputScalarTypeToFloat()
Set what type of scalar data this source should generate.
void Cap(vtkDataArray *s)
void SetModelBounds(const double bounds[6])
Specify the region in space over which the sampling occurs.
void SetOutputScalarTypeToUnsignedChar()
Set what type of scalar data this source should generate.
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_SHORT
Definition: vtkType.h:48
#define VTK_UNSIGNED_INT
Definition: vtkType.h:51
#define VTK_DOUBLE
Definition: vtkType.h:55
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:47
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:49
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
#define VTK_INT
Definition: vtkType.h:50
#define VTK_FLOAT
Definition: vtkType.h:54
#define VTK_CHAR
Definition: vtkType.h:45
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:53
#define VTK_LONG
Definition: vtkType.h:52