VTK
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 =========================================================================*/
36 #ifndef vtkSampleFunction_h
37 #define vtkSampleFunction_h
38 
39 #include "vtkImagingHybridModule.h" // For export macro
40 #include "vtkImageAlgorithm.h"
41 
43 class vtkDataArray;
44 
45 class VTKIMAGINGHYBRID_EXPORT vtkSampleFunction : public vtkImageAlgorithm
46 {
47 public:
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
55  static vtkSampleFunction *New();
56 
58 
61  virtual void SetImplicitFunction(vtkImplicitFunction*);
62  vtkGetObjectMacro(ImplicitFunction,vtkImplicitFunction);
64 
66 
69  vtkSetMacro(OutputScalarType,int);
70  vtkGetMacro(OutputScalarType,int);
72  {this->SetOutputScalarType(VTK_DOUBLE);}
74  {this->SetOutputScalarType(VTK_FLOAT);}
76  {this->SetOutputScalarType(VTK_LONG);}
78  {this->SetOutputScalarType(VTK_UNSIGNED_LONG);};
80  {this->SetOutputScalarType(VTK_INT);}
82  {this->SetOutputScalarType(VTK_UNSIGNED_INT);}
84  {this->SetOutputScalarType(VTK_SHORT);}
86  {this->SetOutputScalarType(VTK_UNSIGNED_SHORT);}
88  {this->SetOutputScalarType(VTK_CHAR);}
90  {this->SetOutputScalarType(VTK_UNSIGNED_CHAR);}
92 
96  void SetSampleDimensions(int i, int j, int k);
97 
99 
102  void SetSampleDimensions(int dim[3]);
103  vtkGetVectorMacro(SampleDimensions,int,3);
105 
107 
111  void SetModelBounds(const double bounds[6]);
112  void SetModelBounds(double xMin, double xMax,
113  double yMin, double yMax,
114  double zMin, double zMax);
115  vtkGetVectorMacro(ModelBounds,double,6);
117 
119 
124  vtkSetMacro(Capping,vtkTypeBool);
125  vtkGetMacro(Capping,vtkTypeBool);
126  vtkBooleanMacro(Capping,vtkTypeBool);
128 
130 
133  vtkSetMacro(CapValue,double);
134  vtkGetMacro(CapValue,double);
136 
138 
141  vtkSetMacro(ComputeNormals,vtkTypeBool);
142  vtkGetMacro(ComputeNormals,vtkTypeBool);
143  vtkBooleanMacro(ComputeNormals,vtkTypeBool);
145 
147 
151  vtkSetStringMacro(ScalarArrayName);
152  vtkGetStringMacro(ScalarArrayName);
154 
156 
160  vtkSetStringMacro(NormalArrayName);
161  vtkGetStringMacro(NormalArrayName);
163 
167  vtkMTimeType GetMTime() override;
168 
169 protected:
178 
179  ~vtkSampleFunction() override;
180 
181  void ReportReferences(vtkGarbageCollector*) override;
182 
186  vtkInformationVector *) override;
187  void Cap(vtkDataArray *s);
188 
190  int SampleDimensions[3];
191  double ModelBounds[6];
193  double CapValue;
198 
199 private:
200  vtkSampleFunction(const vtkSampleFunction&) = delete;
201  void operator=(const vtkSampleFunction&) = delete;
202 };
203 
204 #endif
205 
206 
abstract interface for implicit functions
sample an implicit function over a structured point set
#define VTK_UNSIGNED_INT
Definition: vtkType.h:55
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:53
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:59
void SetOutputScalarTypeToShort()
Set what type of scalar data this source should generate.
#define VTK_FLOAT
Definition: vtkType.h:58
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:54
virtual vtkMTimeType GetMTime()
Return this object's modified time.
#define VTK_SHORT
Definition: vtkType.h:52
void SetOutputScalarTypeToLong()
Set what type of scalar data this source should generate.
#define VTK_CHAR
Definition: vtkType.h:49
#define VTK_LONG
Definition: vtkType.h:56
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:51
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:57
void SetOutputScalarTypeToFloat()
Set what type of scalar data this source should generate.
general representation of visualization data
Definition: vtkDataObject.h:64
void SetOutputScalarTypeToUnsignedInt()
Set what type of scalar data this source should generate.
#define VTK_INT
Definition: vtkType.h:54
void SetOutputScalarTypeToChar()
Set what type of scalar data this source should generate.