VTK  9.1.0
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 =========================================================================*/
50 #ifndef vtkVoxelModeller_h
51 #define vtkVoxelModeller_h
52 
53 #include "vtkImageAlgorithm.h"
54 #include "vtkImagingHybridModule.h" // For export macro
55 
56 class VTKIMAGINGHYBRID_EXPORT vtkVoxelModeller : public vtkImageAlgorithm
57 {
58 public:
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
69  static vtkVoxelModeller* New();
70 
74  double ComputeModelBounds(double origin[3], double spacing[3]);
75 
77 
81  void SetSampleDimensions(int i, int j, int k);
82  void SetSampleDimensions(int dim[3]);
83  vtkGetVectorMacro(SampleDimensions, int, 3);
85 
87 
91  vtkSetClampMacro(MaximumDistance, double, 0.0, 1.0);
92  vtkGetMacro(MaximumDistance, double);
94 
96 
100  void SetModelBounds(const double bounds[6]);
101  void SetModelBounds(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax);
102  vtkGetVectorMacro(ModelBounds, double, 6);
104 
106 
112  vtkSetMacro(ScalarType, int);
113  void SetScalarTypeToFloat() { this->SetScalarType(VTK_FLOAT); }
114  void SetScalarTypeToDouble() { this->SetScalarType(VTK_DOUBLE); }
115  void SetScalarTypeToInt() { this->SetScalarType(VTK_INT); }
116  void SetScalarTypeToUnsignedInt() { this->SetScalarType(VTK_UNSIGNED_INT); }
117  void SetScalarTypeToLong() { this->SetScalarType(VTK_LONG); }
118  void SetScalarTypeToUnsignedLong() { this->SetScalarType(VTK_UNSIGNED_LONG); }
119  void SetScalarTypeToShort() { this->SetScalarType(VTK_SHORT); }
120  void SetScalarTypeToUnsignedShort() { this->SetScalarType(VTK_UNSIGNED_SHORT); }
121  void SetScalarTypeToUnsignedChar() { this->SetScalarType(VTK_UNSIGNED_CHAR); }
122  void SetScalarTypeToChar() { this->SetScalarType(VTK_CHAR); }
123  void SetScalarTypeToBit() { this->SetScalarType(VTK_BIT); }
124  vtkGetMacro(ScalarType, int);
126 
128 
135  vtkSetMacro(ForegroundValue, double);
136  vtkGetMacro(ForegroundValue, double);
137  vtkSetMacro(BackgroundValue, double);
138  vtkGetMacro(BackgroundValue, double);
140 
141 protected:
143  ~vtkVoxelModeller() override = default;
144 
146 
147  // see vtkAlgorithm for details
148  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
149  vtkInformationVector* outputVector) override;
150 
151  // see algorithm for more info
153 
154  int SampleDimensions[3];
156  double ModelBounds[6];
160 
161 private:
162  vtkVoxelModeller(const vtkVoxelModeller&) = delete;
163  void operator=(const vtkVoxelModeller&) = delete;
164 };
165 
166 #endif
vtkVoxelModeller::SetModelBounds
void SetModelBounds(const double bounds[6])
Specify the position in space to perform the voxelization.
vtkVoxelModeller::SetScalarTypeToUnsignedInt
void SetScalarTypeToUnsignedInt()
Control the scalar type of the output image.
Definition: vtkVoxelModeller.h:116
vtkVoxelModeller::ScalarType
int ScalarType
Definition: vtkVoxelModeller.h:159
vtkVoxelModeller::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
VTK_UNSIGNED_INT
#define VTK_UNSIGNED_INT
Definition: vtkType.h:51
vtkVoxelModeller::SetScalarTypeToUnsignedShort
void SetScalarTypeToUnsignedShort()
Control the scalar type of the output image.
Definition: vtkVoxelModeller.h:120
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkVoxelModeller::SetScalarTypeToShort
void SetScalarTypeToShort()
Control the scalar type of the output image.
Definition: vtkVoxelModeller.h:119
VTK_UNSIGNED_SHORT
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:49
vtkVoxelModeller::vtkVoxelModeller
vtkVoxelModeller()
vtkVoxelModeller::SetScalarTypeToBit
void SetScalarTypeToBit()
Control the scalar type of the output image.
Definition: vtkVoxelModeller.h:123
vtkImageAlgorithm.h
vtkImageAlgorithm
Generic algorithm superclass for image algs.
Definition: vtkImageAlgorithm.h:57
vtkVoxelModeller::BackgroundValue
double BackgroundValue
Definition: vtkVoxelModeller.h:158
vtkVoxelModeller::ComputeModelBounds
double ComputeModelBounds(double origin[3], double spacing[3])
Compute the ModelBounds based on the input geometry.
vtkX3D::port
@ port
Definition: vtkX3D.h:453
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::SetScalarTypeToUnsignedLong
void SetScalarTypeToUnsignedLong()
Control the scalar type of the output image.
Definition: vtkVoxelModeller.h:118
vtkVoxelModeller::SetScalarTypeToUnsignedChar
void SetScalarTypeToUnsignedChar()
Control the scalar type of the output image.
Definition: vtkVoxelModeller.h:121
VTK_CHAR
#define VTK_CHAR
Definition: vtkType.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
VTK_FLOAT
#define VTK_FLOAT
Definition: vtkType.h:54
vtkVoxelModeller::RequestData
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called in response to a REQUEST_DATA request from the executive.
VTK_DOUBLE
#define VTK_DOUBLE
Definition: vtkType.h:55
VTK_UNSIGNED_CHAR
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:47
VTK_LONG
#define VTK_LONG
Definition: vtkType.h:52
vtkVoxelModeller::ForegroundValue
double ForegroundValue
Definition: vtkVoxelModeller.h:157
vtkVoxelModeller::SetScalarTypeToChar
void SetScalarTypeToChar()
Control the scalar type of the output image.
Definition: vtkVoxelModeller.h:122
vtkX3D::spacing
@ spacing
Definition: vtkX3D.h:487
vtkVoxelModeller::SetScalarTypeToDouble
void SetScalarTypeToDouble()
Control the scalar type of the output image.
Definition: vtkVoxelModeller.h:114
VTK_UNSIGNED_LONG
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:53
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkX3D::info
@ info
Definition: vtkX3D.h:382
VTK_SHORT
#define VTK_SHORT
Definition: vtkType.h:48
vtkVoxelModeller::~vtkVoxelModeller
~vtkVoxelModeller() override=default
vtkVoxelModeller::New
static vtkVoxelModeller * New()
Construct an instance of vtkVoxelModeller with its sample dimensions set to (50,50,...
vtkVoxelModeller::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
VTK_BIT
#define VTK_BIT
Definition: vtkType.h:44
vtkVoxelModeller::SetScalarTypeToFloat
void SetScalarTypeToFloat()
Control the scalar type of the output image.
Definition: vtkVoxelModeller.h:113
VTK_INT
#define VTK_INT
Definition: vtkType.h:50
vtkVoxelModeller::SetScalarTypeToLong
void SetScalarTypeToLong()
Control the scalar type of the output image.
Definition: vtkVoxelModeller.h:117
vtkVoxelModeller::SetSampleDimensions
void SetSampleDimensions(int dim[3])
Set the i-j-k dimensions on which to sample the distance function.
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::SetScalarTypeToInt
void SetScalarTypeToInt()
Control the scalar type of the output image.
Definition: vtkVoxelModeller.h:115
vtkVoxelModeller
convert an arbitrary dataset to a voxel representation
Definition: vtkVoxelModeller.h:57
vtkVoxelModeller::MaximumDistance
double MaximumDistance
Definition: vtkVoxelModeller.h:155
vtkVoxelModeller::SetSampleDimensions
void SetSampleDimensions(int i, int j, int k)
Set the i-j-k dimensions on which to sample the distance function.