VTK: Imaging/Hybrid/vtkVoxelModeller.h Source File

| 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
31 #ifndef vtkVoxelModeller_h
32 #define vtkVoxelModeller_h
33
34 #include "vtkImageAlgorithm.h"
35 #include "vtkImagingHybridModule.h" // For export macro
36
37 VTK_ABI_NAMESPACE_BEGIN
38 class VTKIMAGINGHYBRID_EXPORT vtkVoxelModeller : public vtkImageAlgorithm
39 {
40 public:
41 vtkTypeMacro(vtkVoxelModeller, vtkImageAlgorithm);
42 void PrintSelf(ostream& os, vtkIndent indent) override;
43
51 static vtkVoxelModeller* New();
52
56 double ComputeModelBounds(double origin[3], double spacing[3]);
57
59
63 void SetSampleDimensions(int i, int j, int k);
64 void SetSampleDimensions(int dim[3]);
65 vtkGetVectorMacro(SampleDimensions, int, 3);
67
69
73 vtkSetClampMacro(MaximumDistance, double, 0.0, 1.0);
74 vtkGetMacro(MaximumDistance, double);
76
78
82 void SetModelBounds(const double bounds[6]);
83 void SetModelBounds(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax);
84 vtkGetVectorMacro(ModelBounds, double, 6);
86
88
94 vtkSetMacro(ScalarType, int);
95 void SetScalarTypeToFloat() { this->SetScalarType(VTK_FLOAT); }
96 void SetScalarTypeToDouble() { this->SetScalarType(VTK_DOUBLE); }
97 void SetScalarTypeToInt() { this->SetScalarType(VTK_INT); }
98 void SetScalarTypeToUnsignedInt() { this->SetScalarType(VTK_UNSIGNED_INT); }
99 void SetScalarTypeToLong() { this->SetScalarType(VTK_LONG); }
100 void SetScalarTypeToUnsignedLong() { this->SetScalarType(VTK_UNSIGNED_LONG); }
101 void SetScalarTypeToShort() { this->SetScalarType(VTK_SHORT); }
102 void SetScalarTypeToUnsignedShort() { this->SetScalarType(VTK_UNSIGNED_SHORT); }
103 void SetScalarTypeToUnsignedChar() { this->SetScalarType(VTK_UNSIGNED_CHAR); }
104 void SetScalarTypeToChar() { this->SetScalarType(VTK_CHAR); }
105 void SetScalarTypeToBit() { this->SetScalarType(VTK_BIT); }
106 vtkGetMacro(ScalarType, int);
108
110
117 vtkSetMacro(ForegroundValue, double);
118 vtkGetMacro(ForegroundValue, double);
119 vtkSetMacro(BackgroundValue, double);
120 vtkGetMacro(BackgroundValue, double);
122
123 protected:
124 vtkVoxelModeller();
125 ~vtkVoxelModeller() override = default;
126
127 int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
128
129 // see vtkAlgorithm for details
130 int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
131 vtkInformationVector* outputVector) override;
132
133 // see algorithm for more info
134 int FillInputPortInformation(int port, vtkInformation* info) override;
135
136 int SampleDimensions[3];
137 double MaximumDistance;
138 double ModelBounds[6];
139 double ForegroundValue;
140 double BackgroundValue;
141 int ScalarType;
142
143 private:
144 vtkVoxelModeller(const vtkVoxelModeller&) = delete;
145 void operator=(const vtkVoxelModeller&) = delete;
146 };
147
148 VTK_ABI_NAMESPACE_END
149 #endif
vtkImageAlgorithm
Generic algorithm superclass for image algs.
Definition: vtkImageAlgorithm.h:39
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkVoxelModeller
convert an arbitrary dataset to a voxel representation
Definition: vtkVoxelModeller.h:39
vtkVoxelModeller::SetModelBounds
void SetModelBounds(const double bounds[6])
Specify the position in space to perform the voxelization.
vtkVoxelModeller::vtkVoxelModeller
vtkVoxelModeller()
vtkVoxelModeller::SetScalarTypeToBit
void SetScalarTypeToBit()
Control the scalar type of the output image.
Definition: vtkVoxelModeller.h:105
vtkVoxelModeller::BackgroundValue
double BackgroundValue
Definition: vtkVoxelModeller.h:140
vtkVoxelModeller::SetSampleDimensions
void SetSampleDimensions(int i, int j, int k)
Set the i-j-k dimensions on which to sample the distance function.
vtkVoxelModeller::SetScalarTypeToUnsignedShort
void SetScalarTypeToUnsignedShort()
Control the scalar type of the output image.
Definition: vtkVoxelModeller.h:102
vtkVoxelModeller::New
static vtkVoxelModeller * New()
Construct an instance of vtkVoxelModeller with its sample dimensions set to (50,50,...
vtkVoxelModeller::ForegroundValue
double ForegroundValue
Definition: vtkVoxelModeller.h:139
vtkVoxelModeller::RequestData
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called in response to a REQUEST_DATA request from the executive.
vtkVoxelModeller::SetScalarTypeToInt
void SetScalarTypeToInt()
Control the scalar type of the output image.
Definition: vtkVoxelModeller.h:97
vtkVoxelModeller::SetScalarTypeToDouble
void SetScalarTypeToDouble()
Control the scalar type of the output image.
Definition: vtkVoxelModeller.h:96
vtkVoxelModeller::SetSampleDimensions
void SetSampleDimensions(int dim[3])
Set the i-j-k dimensions on which to sample the distance function.
vtkVoxelModeller::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkVoxelModeller::~vtkVoxelModeller
~vtkVoxelModeller() override=default
vtkVoxelModeller::ScalarType
int ScalarType
Definition: vtkVoxelModeller.h:141
vtkVoxelModeller::MaximumDistance
double MaximumDistance
Definition: vtkVoxelModeller.h:137
vtkVoxelModeller::SetScalarTypeToShort
void SetScalarTypeToShort()
Control the scalar type of the output image.
Definition: vtkVoxelModeller.h:101
vtkVoxelModeller::SetScalarTypeToChar
void SetScalarTypeToChar()
Control the scalar type of the output image.
Definition: vtkVoxelModeller.h:104
vtkVoxelModeller::SetScalarTypeToUnsignedInt
void SetScalarTypeToUnsignedInt()
Control the scalar type of the output image.
Definition: vtkVoxelModeller.h:98
vtkVoxelModeller::SetScalarTypeToUnsignedChar
void SetScalarTypeToUnsignedChar()
Control the scalar type of the output image.
Definition: vtkVoxelModeller.h:103
vtkVoxelModeller::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkVoxelModeller::ComputeModelBounds
double ComputeModelBounds(double origin[3], double spacing[3])
Compute the ModelBounds based on the input geometry.
vtkVoxelModeller::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
vtkVoxelModeller::SetModelBounds
void SetModelBounds(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
Specify the position in space to perform the voxelization.
vtkVoxelModeller::SetScalarTypeToFloat
void SetScalarTypeToFloat()
Control the scalar type of the output image.
Definition: vtkVoxelModeller.h:95
vtkVoxelModeller::SetScalarTypeToUnsignedLong
void SetScalarTypeToUnsignedLong()
Control the scalar type of the output image.
Definition: vtkVoxelModeller.h:100
vtkVoxelModeller::SetScalarTypeToLong
void SetScalarTypeToLong()
Control the scalar type of the output image.
Definition: vtkVoxelModeller.h:99
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkX3D::spacing
@ spacing
Definition: vtkX3D.h:481
vtkImageAlgorithm.h
VTK_SHORT
#define VTK_SHORT
Definition: vtkType.h:36
VTK_UNSIGNED_INT
#define VTK_UNSIGNED_INT
Definition: vtkType.h:39
VTK_DOUBLE
#define VTK_DOUBLE
Definition: vtkType.h:43
VTK_UNSIGNED_CHAR
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:35
VTK_UNSIGNED_SHORT
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:37
VTK_INT
#define VTK_INT
Definition: vtkType.h:38
VTK_FLOAT
#define VTK_FLOAT
Definition: vtkType.h:42
VTK_CHAR
#define VTK_CHAR
Definition: vtkType.h:33
VTK_UNSIGNED_LONG
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:41
VTK_BIT
#define VTK_BIT
Definition: vtkType.h:32
VTK_LONG
#define VTK_LONG
Definition: vtkType.h:40