VTK  9.2.6
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 =========================================================================*/
42 #ifndef vtkSampleFunction_h
43 #define vtkSampleFunction_h
44 
45 #include "vtkImageAlgorithm.h"
46 #include "vtkImagingHybridModule.h" // For export macro
47 
49 class vtkDataArray;
50 
51 class VTKIMAGINGHYBRID_EXPORT vtkSampleFunction : public vtkImageAlgorithm
52 {
53 public:
55  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
62 
64 
68  vtkGetObjectMacro(ImplicitFunction, vtkImplicitFunction);
70 
72 
75  vtkSetMacro(OutputScalarType, int);
76  vtkGetMacro(OutputScalarType, int);
77  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
78  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
79  void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
80  void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
81  void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
82  void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
83  void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
84  void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
85  void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
86  void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
88 
92  void SetSampleDimensions(int i, int j, int k);
93 
95 
98  void SetSampleDimensions(int dim[3]);
99  vtkGetVectorMacro(SampleDimensions, int, 3);
101 
103 
107  void SetModelBounds(const double bounds[6]);
108  void SetModelBounds(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax);
109  vtkGetVectorMacro(ModelBounds, double, 6);
111 
113 
118  vtkSetMacro(Capping, vtkTypeBool);
119  vtkGetMacro(Capping, vtkTypeBool);
120  vtkBooleanMacro(Capping, vtkTypeBool);
122 
124 
127  vtkSetMacro(CapValue, double);
128  vtkGetMacro(CapValue, double);
130 
132 
135  vtkSetMacro(ComputeNormals, vtkTypeBool);
136  vtkGetMacro(ComputeNormals, vtkTypeBool);
137  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
139 
141 
145  vtkSetStringMacro(ScalarArrayName);
146  vtkGetStringMacro(ScalarArrayName);
148 
150 
154  vtkSetStringMacro(NormalArrayName);
155  vtkGetStringMacro(NormalArrayName);
157 
161  vtkMTimeType GetMTime() override;
162 
163 protected:
172 
173  ~vtkSampleFunction() override;
174 
176 
179  void Cap(vtkDataArray* s);
180 
182  int SampleDimensions[3];
183  double ModelBounds[6];
185  double CapValue;
190 
191 private:
192  vtkSampleFunction(const vtkSampleFunction&) = delete;
193  void operator=(const vtkSampleFunction&) = delete;
194 };
195 
196 #endif
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:65
general representation of visualization data
Definition: vtkDataObject.h:75
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:49
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.
static vtkSampleFunction * New()
Construct with ModelBounds=(-1,1,-1,1,-1,1), SampleDimensions=(50,50,50), Capping turned off,...
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.
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