VTK  9.3.1
vtkVoxelModeller.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
22 #ifndef vtkVoxelModeller_h
23 #define vtkVoxelModeller_h
24 
25 #include "vtkImageAlgorithm.h"
26 #include "vtkImagingHybridModule.h" // For export macro
27 
28 VTK_ABI_NAMESPACE_BEGIN
29 class VTKIMAGINGHYBRID_EXPORT vtkVoxelModeller : public vtkImageAlgorithm
30 {
31 public:
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
42  static vtkVoxelModeller* New();
43 
47  double ComputeModelBounds(double origin[3], double spacing[3]);
48 
50 
54  void SetSampleDimensions(int i, int j, int k);
55  void SetSampleDimensions(int dim[3]);
56  vtkGetVectorMacro(SampleDimensions, int, 3);
58 
60 
64  vtkSetClampMacro(MaximumDistance, double, 0.0, 1.0);
65  vtkGetMacro(MaximumDistance, double);
67 
69 
73  void SetModelBounds(const double bounds[6]);
74  void SetModelBounds(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax);
75  vtkGetVectorMacro(ModelBounds, double, 6);
77 
79 
85  vtkSetMacro(ScalarType, int);
86  void SetScalarTypeToFloat() { this->SetScalarType(VTK_FLOAT); }
87  void SetScalarTypeToDouble() { this->SetScalarType(VTK_DOUBLE); }
88  void SetScalarTypeToInt() { this->SetScalarType(VTK_INT); }
89  void SetScalarTypeToUnsignedInt() { this->SetScalarType(VTK_UNSIGNED_INT); }
90  void SetScalarTypeToLong() { this->SetScalarType(VTK_LONG); }
91  void SetScalarTypeToUnsignedLong() { this->SetScalarType(VTK_UNSIGNED_LONG); }
92  void SetScalarTypeToShort() { this->SetScalarType(VTK_SHORT); }
93  void SetScalarTypeToUnsignedShort() { this->SetScalarType(VTK_UNSIGNED_SHORT); }
94  void SetScalarTypeToUnsignedChar() { this->SetScalarType(VTK_UNSIGNED_CHAR); }
95  void SetScalarTypeToChar() { this->SetScalarType(VTK_CHAR); }
96  void SetScalarTypeToBit() { this->SetScalarType(VTK_BIT); }
97  vtkGetMacro(ScalarType, int);
99 
101 
108  vtkSetMacro(ForegroundValue, double);
109  vtkGetMacro(ForegroundValue, double);
110  vtkSetMacro(BackgroundValue, double);
111  vtkGetMacro(BackgroundValue, double);
113 
114 protected:
116  ~vtkVoxelModeller() override = default;
117 
119 
120  // see vtkAlgorithm for details
121  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
122  vtkInformationVector* outputVector) override;
123 
124  // see algorithm for more info
125  int FillInputPortInformation(int port, vtkInformation* info) override;
126 
127  int SampleDimensions[3];
129  double ModelBounds[6];
133 
134 private:
135  vtkVoxelModeller(const vtkVoxelModeller&) = delete;
136  void operator=(const vtkVoxelModeller&) = delete;
137 };
138 
139 VTK_ABI_NAMESPACE_END
140 #endif
#define VTK_UNSIGNED_INT
Definition: vtkType.h:39
Store vtkAlgorithm input/output information.
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:37
void SetScalarTypeToChar()
Control the scalar type of the output image.
void SetScalarTypeToFloat()
Control the scalar type of the output image.
void SetScalarTypeToInt()
Control the scalar type of the output image.
void SetScalarTypeToDouble()
Control the scalar type of the output image.
void SetScalarTypeToLong()
Control the scalar type of the output image.
void SetScalarTypeToUnsignedInt()
Control the scalar type of the output image.
#define VTK_DOUBLE
Definition: vtkType.h:43
#define VTK_FLOAT
Definition: vtkType.h:42
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
void SetScalarTypeToBit()
Control the scalar type of the output image.
#define VTK_SHORT
Definition: vtkType.h:36
#define VTK_CHAR
Definition: vtkType.h:33
#define VTK_LONG
Definition: vtkType.h:40
convert an arbitrary dataset to a voxel representation
void SetScalarTypeToShort()
Control the scalar type of the output image.
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:35
#define VTK_BIT
Definition: vtkType.h:32
int FillInputPortInformation(int port, vtkInformation *info) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
void SetScalarTypeToUnsignedShort()
Control the scalar type of the output image.
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:41
void SetScalarTypeToUnsignedLong()
Control the scalar type of the output image.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called in response to a REQUEST_DATA request from the executive.
void SetScalarTypeToUnsignedChar()
Control the scalar type of the output image.
#define VTK_INT
Definition: vtkType.h:38