VTK  9.0.1
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 =========================================================================*/
30 #ifndef vtkSampleFunction_h
31 #define vtkSampleFunction_h
32 
33 #include "vtkImageAlgorithm.h"
34 #include "vtkImagingHybridModule.h" // For export macro
35 
37 class vtkDataArray;
38 
39 class VTKIMAGINGHYBRID_EXPORT vtkSampleFunction : public vtkImageAlgorithm
40 {
41 public:
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
50 
52 
56  vtkGetObjectMacro(ImplicitFunction, vtkImplicitFunction);
58 
60 
63  vtkSetMacro(OutputScalarType, int);
64  vtkGetMacro(OutputScalarType, int);
65  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
66  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
67  void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
68  void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
69  void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
70  void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
71  void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
72  void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
73  void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
74  void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
76 
80  void SetSampleDimensions(int i, int j, int k);
81 
83 
86  void SetSampleDimensions(int dim[3]);
87  vtkGetVectorMacro(SampleDimensions, int, 3);
89 
91 
95  void SetModelBounds(const double bounds[6]);
96  void SetModelBounds(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax);
97  vtkGetVectorMacro(ModelBounds, double, 6);
99 
101 
106  vtkSetMacro(Capping, vtkTypeBool);
107  vtkGetMacro(Capping, vtkTypeBool);
108  vtkBooleanMacro(Capping, vtkTypeBool);
110 
112 
115  vtkSetMacro(CapValue, double);
116  vtkGetMacro(CapValue, double);
118 
120 
123  vtkSetMacro(ComputeNormals, vtkTypeBool);
124  vtkGetMacro(ComputeNormals, vtkTypeBool);
125  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
127 
129 
133  vtkSetStringMacro(ScalarArrayName);
134  vtkGetStringMacro(ScalarArrayName);
136 
138 
142  vtkSetStringMacro(NormalArrayName);
143  vtkGetStringMacro(NormalArrayName);
145 
149  vtkMTimeType GetMTime() override;
150 
151 protected:
160 
161  ~vtkSampleFunction() override;
162 
164 
167  void Cap(vtkDataArray* s);
168 
170  int SampleDimensions[3];
171  double ModelBounds[6];
173  double CapValue;
178 
179 private:
180  vtkSampleFunction(const vtkSampleFunction&) = delete;
181  void operator=(const vtkSampleFunction&) = delete;
182 };
183 
184 #endif
vtkSampleFunction::SetOutputScalarTypeToFloat
void SetOutputScalarTypeToFloat()
Definition: vtkSampleFunction.h:66
vtkSampleFunction::~vtkSampleFunction
~vtkSampleFunction() override
vtkSampleFunction::SetModelBounds
void SetModelBounds(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax)
vtkSampleFunction::ExecuteDataWithInformation
void ExecuteDataWithInformation(vtkDataObject *, vtkInformation *) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
vtkSampleFunction::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
VTK_UNSIGNED_INT
#define VTK_UNSIGNED_INT
Definition: vtkType.h:49
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:36
VTK_UNSIGNED_SHORT
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:47
vtkSampleFunction::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageAlgorithm.h
vtkSampleFunction::Capping
vtkTypeBool Capping
Definition: vtkSampleFunction.h:172
vtkSampleFunction::SetOutputScalarTypeToShort
void SetOutputScalarTypeToShort()
Definition: vtkSampleFunction.h:71
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:50
vtkImageAlgorithm
Generic algorithm superclass for image algs.
Definition: vtkImageAlgorithm.h:38
vtkSampleFunction::ScalarArrayName
char * ScalarArrayName
Definition: vtkSampleFunction.h:176
vtkSampleFunction::SetOutputScalarTypeToDouble
void SetOutputScalarTypeToDouble()
Definition: vtkSampleFunction.h:65
vtkSampleFunction::OutputScalarType
int OutputScalarType
Definition: vtkSampleFunction.h:169
vtkImplicitFunction
abstract interface for implicit functions
Definition: vtkImplicitFunction.h:61
vtkSampleFunction::SetOutputScalarTypeToUnsignedShort
void SetOutputScalarTypeToUnsignedShort()
Definition: vtkSampleFunction.h:72
vtkSampleFunction::ComputeNormals
vtkTypeBool ComputeNormals
Definition: vtkSampleFunction.h:175
vtkSampleFunction::NormalArrayName
char * NormalArrayName
Definition: vtkSampleFunction.h:177
vtkSampleFunction::SetOutputScalarTypeToUnsignedLong
void SetOutputScalarTypeToUnsignedLong()
Definition: vtkSampleFunction.h:68
VTK_CHAR
#define VTK_CHAR
Definition: vtkType.h:43
vtkSampleFunction::CapValue
double CapValue
Definition: vtkSampleFunction.h:173
vtkSampleFunction
sample an implicit function over a structured point set
Definition: vtkSampleFunction.h:40
vtkSampleFunction::SetOutputScalarTypeToUnsignedChar
void SetOutputScalarTypeToUnsignedChar()
Definition: vtkSampleFunction.h:74
vtkSampleFunction::SetImplicitFunction
virtual void SetImplicitFunction(vtkImplicitFunction *)
Specify the implicit function to use to generate data.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkSampleFunction::ReportReferences
void ReportReferences(vtkGarbageCollector *) override
VTK_FLOAT
#define VTK_FLOAT
Definition: vtkType.h:52
VTK_DOUBLE
#define VTK_DOUBLE
Definition: vtkType.h:53
VTK_UNSIGNED_CHAR
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:45
vtkSampleFunction::GetMTime
vtkMTimeType GetMTime() override
Return the MTime also considering the implicit function.
vtkSampleFunction::SetOutputScalarTypeToLong
void SetOutputScalarTypeToLong()
Definition: vtkSampleFunction.h:67
VTK_LONG
#define VTK_LONG
Definition: vtkType.h:50
vtkSampleFunction::SetOutputScalarTypeToInt
void SetOutputScalarTypeToInt()
Definition: vtkSampleFunction.h:69
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:95
VTK_UNSIGNED_LONG
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:51
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:65
VTK_SHORT
#define VTK_SHORT
Definition: vtkType.h:46
vtkSampleFunction::Cap
void Cap(vtkDataArray *s)
vtkSampleFunction::SetSampleDimensions
void SetSampleDimensions(int dim[3])
Specify the dimensions of the data on which to sample.
vtkSampleFunction::ImplicitFunction
vtkImplicitFunction * ImplicitFunction
Definition: vtkSampleFunction.h:174
vtkSampleFunction::SetSampleDimensions
void SetSampleDimensions(int i, int j, int k)
Specify the dimensions of the data on which to sample.
vtkSampleFunction::SetOutputScalarTypeToChar
void SetOutputScalarTypeToChar()
Definition: vtkSampleFunction.h:73
vtkSampleFunction::SetOutputScalarTypeToUnsignedInt
void SetOutputScalarTypeToUnsignedInt()
Definition: vtkSampleFunction.h:70
VTK_INT
#define VTK_INT
Definition: vtkType.h:48
vtkSampleFunction::vtkSampleFunction
vtkSampleFunction()
Default constructor.
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:60
vtkSampleFunction::New
static vtkSampleFunction * New()
Construct with ModelBounds=(-1,1,-1,1,-1,1), SampleDimensions=(50,50,50), Capping turned off,...
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkSampleFunction::SetModelBounds
void SetModelBounds(const double bounds[6])
Specify the region in space over which the sampling occurs.
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293