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 =========================================================================*/
33 #ifndef vtkSampleFunction_h
34 #define vtkSampleFunction_h
35 
36 #include "vtkImageAlgorithm.h"
37 #include "vtkImagingHybridModule.h" // For export macro
38 
40 class vtkDataArray;
41 
42 class VTKIMAGINGHYBRID_EXPORT vtkSampleFunction : public vtkImageAlgorithm
43 {
44 public:
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
52  static vtkSampleFunction* New();
53 
55 
58  virtual void SetImplicitFunction(vtkImplicitFunction*);
59  vtkGetObjectMacro(ImplicitFunction, vtkImplicitFunction);
61 
63 
66  vtkSetMacro(OutputScalarType, int);
67  vtkGetMacro(OutputScalarType, int);
68  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
69  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
70  void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
71  void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
72  void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
73  void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
74  void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
75  void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
76  void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
77  void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
79 
83  void SetSampleDimensions(int i, int j, int k);
84 
86 
89  void SetSampleDimensions(int dim[3]);
90  vtkGetVectorMacro(SampleDimensions, int, 3);
92 
94 
98  void SetModelBounds(const double bounds[6]);
99  void SetModelBounds(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax);
100  vtkGetVectorMacro(ModelBounds, double, 6);
102 
104 
109  vtkSetMacro(Capping, vtkTypeBool);
110  vtkGetMacro(Capping, vtkTypeBool);
111  vtkBooleanMacro(Capping, vtkTypeBool);
113 
115 
118  vtkSetMacro(CapValue, double);
119  vtkGetMacro(CapValue, double);
121 
123 
126  vtkSetMacro(ComputeNormals, vtkTypeBool);
127  vtkGetMacro(ComputeNormals, vtkTypeBool);
128  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
130 
132 
136  vtkSetStringMacro(ScalarArrayName);
137  vtkGetStringMacro(ScalarArrayName);
139 
141 
145  vtkSetStringMacro(NormalArrayName);
146  vtkGetStringMacro(NormalArrayName);
148 
152  vtkMTimeType GetMTime() override;
153 
154 protected:
163 
164  ~vtkSampleFunction() override;
165 
166  void ReportReferences(vtkGarbageCollector*) override;
167 
170  void Cap(vtkDataArray* s);
171 
173  int SampleDimensions[3];
174  double ModelBounds[6];
176  double CapValue;
181 
182 private:
183  vtkSampleFunction(const vtkSampleFunction&) = delete;
184  void operator=(const vtkSampleFunction&) = delete;
185 };
186 
187 #endif
abstract interface for implicit functions
sample an implicit function over a structured point set
#define VTK_UNSIGNED_INT
Definition: vtkType.h:51
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:49
void ReportReferences(vtkGarbageCollector *) override
virtual void ExecuteDataWithInformation(vtkDataObject *output, vtkInformation *outInfo)
This is a convenience method that is implemented in many subclasses instead of RequestData.
Detect and break reference loops.
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_DOUBLE
Definition: vtkType.h:55
void SetOutputScalarTypeToShort()
Set what type of scalar data this source should generate.
#define VTK_FLOAT
Definition: vtkType.h:54
void SetOutputScalarTypeToUnsignedShort()
Set what type of scalar data this source should generate.
void SetOutputScalarTypeToDouble()
Set what type of scalar data this source should generate.
vtkTypeBool ComputeNormals
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
virtual vtkMTimeType GetMTime()
Return this object's modified time.
#define VTK_SHORT
Definition: vtkType.h:48
void SetOutputScalarTypeToLong()
Set what type of scalar data this source should generate.
#define VTK_CHAR
Definition: vtkType.h:45
#define VTK_LONG
Definition: vtkType.h:52
void SetOutputScalarTypeToInt()
Set what type of scalar data this source should generate.
void SetOutputScalarTypeToUnsignedLong()
Set what type of scalar data this source should generate.
vtkImplicitFunction * ImplicitFunction
void SetOutputScalarTypeToUnsignedChar()
Set what type of scalar data this source should generate.
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:47
Generic algorithm superclass for image algs.
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:53
void SetOutputScalarTypeToFloat()
Set what type of scalar data this source should generate.
general representation of visualization data
Definition: vtkDataObject.h:65
void SetOutputScalarTypeToUnsignedInt()
Set what type of scalar data this source should generate.
#define VTK_INT
Definition: vtkType.h:50
void SetOutputScalarTypeToChar()
Set what type of scalar data this source should generate.