VTK  9.2.5
vtkVoxelModeller.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkVoxelModeller.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 =========================================================================*/
53 #ifndef vtkVoxelModeller_h
54 #define vtkVoxelModeller_h
55 
56 #include "vtkImageAlgorithm.h"
57 #include "vtkImagingHybridModule.h" // For export macro
58 
59 class VTKIMAGINGHYBRID_EXPORT vtkVoxelModeller : public vtkImageAlgorithm
60 {
61 public:
63  void PrintSelf(ostream& os, vtkIndent indent) override;
64 
72  static vtkVoxelModeller* New();
73 
77  double ComputeModelBounds(double origin[3], double spacing[3]);
78 
80 
84  void SetSampleDimensions(int i, int j, int k);
85  void SetSampleDimensions(int dim[3]);
86  vtkGetVectorMacro(SampleDimensions, int, 3);
88 
90 
94  vtkSetClampMacro(MaximumDistance, double, 0.0, 1.0);
95  vtkGetMacro(MaximumDistance, double);
97 
99 
103  void SetModelBounds(const double bounds[6]);
104  void SetModelBounds(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax);
105  vtkGetVectorMacro(ModelBounds, double, 6);
107 
109 
115  vtkSetMacro(ScalarType, int);
116  void SetScalarTypeToFloat() { this->SetScalarType(VTK_FLOAT); }
117  void SetScalarTypeToDouble() { this->SetScalarType(VTK_DOUBLE); }
118  void SetScalarTypeToInt() { this->SetScalarType(VTK_INT); }
119  void SetScalarTypeToUnsignedInt() { this->SetScalarType(VTK_UNSIGNED_INT); }
120  void SetScalarTypeToLong() { this->SetScalarType(VTK_LONG); }
121  void SetScalarTypeToUnsignedLong() { this->SetScalarType(VTK_UNSIGNED_LONG); }
122  void SetScalarTypeToShort() { this->SetScalarType(VTK_SHORT); }
123  void SetScalarTypeToUnsignedShort() { this->SetScalarType(VTK_UNSIGNED_SHORT); }
124  void SetScalarTypeToUnsignedChar() { this->SetScalarType(VTK_UNSIGNED_CHAR); }
125  void SetScalarTypeToChar() { this->SetScalarType(VTK_CHAR); }
126  void SetScalarTypeToBit() { this->SetScalarType(VTK_BIT); }
127  vtkGetMacro(ScalarType, int);
129 
131 
138  vtkSetMacro(ForegroundValue, double);
139  vtkGetMacro(ForegroundValue, double);
140  vtkSetMacro(BackgroundValue, double);
141  vtkGetMacro(BackgroundValue, double);
143 
144 protected:
146  ~vtkVoxelModeller() override = default;
147 
149 
150  // see vtkAlgorithm for details
151  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
152  vtkInformationVector* outputVector) override;
153 
154  // see algorithm for more info
156 
157  int SampleDimensions[3];
159  double ModelBounds[6];
163 
164 private:
165  vtkVoxelModeller(const vtkVoxelModeller&) = delete;
166  void operator=(const vtkVoxelModeller&) = delete;
167 };
168 
169 #endif
Generic algorithm superclass for image algs.
a simple class to control print indentation
Definition: vtkIndent.h:119
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.
static vtkVoxelModeller * New()
Construct an instance of vtkVoxelModeller with its sample dimensions set to (50,50,...
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.
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.
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
@ spacing
Definition: vtkX3D.h:487
#define VTK_SHORT
Definition: vtkType.h:48
#define VTK_UNSIGNED_INT
Definition: vtkType.h:51
#define VTK_DOUBLE
Definition: vtkType.h:55
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:47
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:49
#define VTK_INT
Definition: vtkType.h:50
#define VTK_FLOAT
Definition: vtkType.h:54
#define VTK_CHAR
Definition: vtkType.h:45
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:53
#define VTK_BIT
Definition: vtkType.h:44
#define VTK_LONG
Definition: vtkType.h:52