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 =========================================================================*/
139 #ifndef vtkSampleFunction_h
140 #define vtkSampleFunction_h
141 
142 #include "vtkImageAlgorithm.h"
143 #include "vtkImagingHybridModule.h" // For export macro
144 
145 class vtkImplicitFunction;
146 class vtkDataArray;
147 
148 class VTKIMAGINGHYBRID_EXPORT vtkSampleFunction : public vtkImageAlgorithm
149 {
150 public:
152  void PrintSelf(ostream& os, vtkIndent indent) override;
153 
159 
161 
165  vtkGetObjectMacro(ImplicitFunction, vtkImplicitFunction);
167 
169 
172  vtkSetMacro(OutputScalarType, int);
173  vtkGetMacro(OutputScalarType, int);
174  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
175  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
176  void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
177  void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
178  void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
179  void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
180  void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
181  void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
182  void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
183  void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
185 
189  void SetSampleDimensions(int i, int j, int k);
190 
192 
195  void SetSampleDimensions(int dim[3]);
196  vtkGetVectorMacro(SampleDimensions, int, 3);
198 
200 
204  void SetModelBounds(const double bounds[6]);
205  void SetModelBounds(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax);
206  vtkGetVectorMacro(ModelBounds, double, 6);
208 
210 
215  vtkSetMacro(Capping, vtkTypeBool);
216  vtkGetMacro(Capping, vtkTypeBool);
217  vtkBooleanMacro(Capping, vtkTypeBool);
219 
221 
224  vtkSetMacro(CapValue, double);
225  vtkGetMacro(CapValue, double);
227 
229 
232  vtkSetMacro(ComputeNormals, vtkTypeBool);
233  vtkGetMacro(ComputeNormals, vtkTypeBool);
234  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
236 
238 
242  vtkSetStringMacro(ScalarArrayName);
243  vtkGetStringMacro(ScalarArrayName);
245 
247 
251  vtkSetStringMacro(NormalArrayName);
252  vtkGetStringMacro(NormalArrayName);
254 
258  vtkMTimeType GetMTime() override;
259 
260 protected:
269 
270  ~vtkSampleFunction() override;
271 
273 
276  void Cap(vtkDataArray* s);
277 
279  int SampleDimensions[3];
280  double ModelBounds[6];
282  double CapValue;
287 
288 private:
289  vtkSampleFunction(const vtkSampleFunction&) = delete;
290  void operator=(const vtkSampleFunction&) = delete;
291 };
292 
293 #endif
vtkSampleFunction::SetOutputScalarTypeToFloat
void SetOutputScalarTypeToFloat()
Set what type of scalar data this source should generate.
Definition: vtkSampleFunction.h:175
vtkSampleFunction::~vtkSampleFunction
~vtkSampleFunction() override
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::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:51
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
VTK_UNSIGNED_SHORT
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:49
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:281
vtkSampleFunction::SetOutputScalarTypeToShort
void SetOutputScalarTypeToShort()
Set what type of scalar data this source should generate.
Definition: vtkSampleFunction.h:180
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:159
vtkImageAlgorithm
Generic algorithm superclass for image algs.
Definition: vtkImageAlgorithm.h:57
vtkSampleFunction::ScalarArrayName
char * ScalarArrayName
Definition: vtkSampleFunction.h:285
vtkSampleFunction::SetOutputScalarTypeToDouble
void SetOutputScalarTypeToDouble()
Set what type of scalar data this source should generate.
Definition: vtkSampleFunction.h:174
vtkSampleFunction::OutputScalarType
int OutputScalarType
Definition: vtkSampleFunction.h:278
vtkImplicitFunction
abstract interface for implicit functions
Definition: vtkImplicitFunction.h:80
vtkSampleFunction::SetOutputScalarTypeToUnsignedShort
void SetOutputScalarTypeToUnsignedShort()
Set what type of scalar data this source should generate.
Definition: vtkSampleFunction.h:181
vtkSampleFunction::ComputeNormals
vtkTypeBool ComputeNormals
Definition: vtkSampleFunction.h:284
vtkSampleFunction::NormalArrayName
char * NormalArrayName
Definition: vtkSampleFunction.h:286
vtkSampleFunction::SetOutputScalarTypeToUnsignedLong
void SetOutputScalarTypeToUnsignedLong()
Set what type of scalar data this source should generate.
Definition: vtkSampleFunction.h:177
VTK_CHAR
#define VTK_CHAR
Definition: vtkType.h:45
vtkSampleFunction::CapValue
double CapValue
Definition: vtkSampleFunction.h:282
vtkSampleFunction
sample an implicit function over a structured point set
Definition: vtkSampleFunction.h:149
vtkSampleFunction::SetOutputScalarTypeToUnsignedChar
void SetOutputScalarTypeToUnsignedChar()
Set what type of scalar data this source should generate.
Definition: vtkSampleFunction.h:183
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:113
vtkSampleFunction::ReportReferences
void ReportReferences(vtkGarbageCollector *) override
VTK_FLOAT
#define VTK_FLOAT
Definition: vtkType.h:54
VTK_DOUBLE
#define VTK_DOUBLE
Definition: vtkType.h:55
VTK_UNSIGNED_CHAR
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:47
vtkSampleFunction::GetMTime
vtkMTimeType GetMTime() override
Return the MTime also considering the implicit function.
vtkSampleFunction::SetOutputScalarTypeToLong
void SetOutputScalarTypeToLong()
Set what type of scalar data this source should generate.
Definition: vtkSampleFunction.h:176
VTK_LONG
#define VTK_LONG
Definition: vtkType.h:52
vtkSampleFunction::SetOutputScalarTypeToInt
void SetOutputScalarTypeToInt()
Set what type of scalar data this source should generate.
Definition: vtkSampleFunction.h:178
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:95
VTK_UNSIGNED_LONG
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:53
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
VTK_SHORT
#define VTK_SHORT
Definition: vtkType.h:48
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:283
vtkSampleFunction::SetSampleDimensions
void SetSampleDimensions(int i, int j, int k)
Specify the dimensions of the data on which to sample.
vtkSampleFunction::SetOutputScalarTypeToChar
void SetOutputScalarTypeToChar()
Set what type of scalar data this source should generate.
Definition: vtkSampleFunction.h:182
vtkSampleFunction::SetOutputScalarTypeToUnsignedInt
void SetOutputScalarTypeToUnsignedInt()
Set what type of scalar data this source should generate.
Definition: vtkSampleFunction.h:179
VTK_INT
#define VTK_INT
Definition: vtkType.h:50
vtkSampleFunction::vtkSampleFunction
vtkSampleFunction()
Default constructor.
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:169
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:287