VTK  9.3.20240424
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
41#ifndef vtkVoxelModeller_h
42#define vtkVoxelModeller_h
43
44#include "vtkImageAlgorithm.h"
45#include "vtkImagingHybridModule.h" // For export macro
46
47VTK_ABI_NAMESPACE_BEGIN
48class VTKIMAGINGHYBRID_EXPORT vtkVoxelModeller : public vtkImageAlgorithm
49{
50public:
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
62
66 double ComputeModelBounds(double origin[3], double spacing[3]);
67
69
73 void SetSampleDimensions(int i, int j, int k);
74 void SetSampleDimensions(int dim[3]);
75 vtkGetVectorMacro(SampleDimensions, int, 3);
77
79
83 vtkSetClampMacro(MaximumDistance, double, 0.0, 1.0);
84 vtkGetMacro(MaximumDistance, double);
86
88
92 void SetModelBounds(const double bounds[6]);
93 void SetModelBounds(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax);
94 vtkGetVectorMacro(ModelBounds, double, 6);
96
98
104 vtkSetMacro(ScalarType, int);
105 void SetScalarTypeToFloat() { this->SetScalarType(VTK_FLOAT); }
106 void SetScalarTypeToDouble() { this->SetScalarType(VTK_DOUBLE); }
107 void SetScalarTypeToInt() { this->SetScalarType(VTK_INT); }
108 void SetScalarTypeToUnsignedInt() { this->SetScalarType(VTK_UNSIGNED_INT); }
109 void SetScalarTypeToLong() { this->SetScalarType(VTK_LONG); }
110 void SetScalarTypeToUnsignedLong() { this->SetScalarType(VTK_UNSIGNED_LONG); }
111 void SetScalarTypeToShort() { this->SetScalarType(VTK_SHORT); }
112 void SetScalarTypeToUnsignedShort() { this->SetScalarType(VTK_UNSIGNED_SHORT); }
113 void SetScalarTypeToUnsignedChar() { this->SetScalarType(VTK_UNSIGNED_CHAR); }
114 void SetScalarTypeToChar() { this->SetScalarType(VTK_CHAR); }
115 void SetScalarTypeToBit() { this->SetScalarType(VTK_BIT); }
116 vtkGetMacro(ScalarType, int);
118
120
127 vtkSetMacro(ForegroundValue, double);
128 vtkGetMacro(ForegroundValue, double);
129 vtkSetMacro(BackgroundValue, double);
130 vtkGetMacro(BackgroundValue, double);
132
133protected:
135 ~vtkVoxelModeller() override = default;
136
138
139 // see vtkAlgorithm for details
141 vtkInformationVector* outputVector) override;
142
143 // see algorithm for more info
144 int FillInputPortInformation(int port, vtkInformation* info) override;
145
146 int SampleDimensions[3];
148 double ModelBounds[6];
152
153private:
154 vtkVoxelModeller(const vtkVoxelModeller&) = delete;
155 void operator=(const vtkVoxelModeller&) = delete;
156};
157
158VTK_ABI_NAMESPACE_END
159#endif
Generic algorithm superclass for image algs.
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
convert an arbitrary dataset to a voxel representation
void SetModelBounds(const double bounds[6])
Specify the position in space to perform the voxelization.
void SetScalarTypeToBit()
Control the scalar type of the output image.
void SetSampleDimensions(int i, int j, int k)
Set the i-j-k dimensions on which to sample the distance function.
void SetScalarTypeToUnsignedShort()
Control the scalar type of the output image.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called in response to a REQUEST_DATA request from the executive.
void SetScalarTypeToInt()
Control the scalar type of the output image.
void SetScalarTypeToDouble()
Control the scalar type of the output image.
void SetSampleDimensions(int dim[3])
Set the i-j-k dimensions on which to sample the distance function.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkVoxelModeller() override=default
void SetScalarTypeToShort()
Control the scalar type of the output image.
void SetScalarTypeToChar()
Control the scalar type of the output image.
void SetScalarTypeToUnsignedInt()
Control the scalar type of the output image.
void SetScalarTypeToUnsignedChar()
Control the scalar type of the output image.
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
double ComputeModelBounds(double origin[3], double spacing[3])
Compute the ModelBounds based on the input geometry.
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 SetModelBounds(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
Specify the position in space to perform the voxelization.
static vtkVoxelModeller * New()
Construct an instance of vtkVoxelModeller with its sample dimensions set to (50,50,...
void SetScalarTypeToFloat()
Control the scalar type of the output image.
void SetScalarTypeToUnsignedLong()
Control the scalar type of the output image.
void SetScalarTypeToLong()
Control the scalar type of the output image.
#define VTK_SHORT
Definition vtkType.h:36
#define VTK_UNSIGNED_INT
Definition vtkType.h:39
#define VTK_DOUBLE
Definition vtkType.h:43
#define VTK_UNSIGNED_CHAR
Definition vtkType.h:35
#define VTK_UNSIGNED_SHORT
Definition vtkType.h:37
#define VTK_INT
Definition vtkType.h:38
#define VTK_FLOAT
Definition vtkType.h:42
#define VTK_CHAR
Definition vtkType.h:33
#define VTK_UNSIGNED_LONG
Definition vtkType.h:41
#define VTK_BIT
Definition vtkType.h:32
#define VTK_LONG
Definition vtkType.h:40