VTK  9.0.1
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 =========================================================================*/
31 #ifndef vtkVoxelModeller_h
32 #define vtkVoxelModeller_h
33 
34 #include "vtkImageAlgorithm.h"
35 #include "vtkImagingHybridModule.h" // For export macro
36 
37 class VTKIMAGINGHYBRID_EXPORT vtkVoxelModeller : public vtkImageAlgorithm
38 {
39 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
50  static vtkVoxelModeller* New();
51 
55  double ComputeModelBounds(double origin[3], double ar[3]);
56 
58 
62  void SetSampleDimensions(int i, int j, int k);
63  void SetSampleDimensions(int dim[3]);
64  vtkGetVectorMacro(SampleDimensions, int, 3);
66 
68 
72  vtkSetClampMacro(MaximumDistance, double, 0.0, 1.0);
73  vtkGetMacro(MaximumDistance, double);
75 
77 
81  void SetModelBounds(const double bounds[6]);
82  void SetModelBounds(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax);
83  vtkGetVectorMacro(ModelBounds, double, 6);
85 
87 
93  vtkSetMacro(ScalarType, int);
94  void SetScalarTypeToFloat() { this->SetScalarType(VTK_FLOAT); }
95  void SetScalarTypeToDouble() { this->SetScalarType(VTK_DOUBLE); }
96  void SetScalarTypeToInt() { this->SetScalarType(VTK_INT); }
97  void SetScalarTypeToUnsignedInt() { this->SetScalarType(VTK_UNSIGNED_INT); }
98  void SetScalarTypeToLong() { this->SetScalarType(VTK_LONG); }
99  void SetScalarTypeToUnsignedLong() { this->SetScalarType(VTK_UNSIGNED_LONG); }
100  void SetScalarTypeToShort() { this->SetScalarType(VTK_SHORT); }
101  void SetScalarTypeToUnsignedShort() { this->SetScalarType(VTK_UNSIGNED_SHORT); }
102  void SetScalarTypeToUnsignedChar() { this->SetScalarType(VTK_UNSIGNED_CHAR); }
103  void SetScalarTypeToChar() { this->SetScalarType(VTK_CHAR); }
104  void SetScalarTypeToBit() { this->SetScalarType(VTK_BIT); }
105  vtkGetMacro(ScalarType, int);
107 
109 
116  vtkSetMacro(ForegroundValue, double);
117  vtkGetMacro(ForegroundValue, double);
118  vtkSetMacro(BackgroundValue, double);
119  vtkGetMacro(BackgroundValue, double);
121 
122 protected:
124  ~vtkVoxelModeller() override {}
125 
127 
128  // see vtkAlgorithm for details
129  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
130  vtkInformationVector* outputVector) override;
131 
132  // see algorithm for more info
134 
135  int SampleDimensions[3];
137  double ModelBounds[6];
141 
142 private:
143  vtkVoxelModeller(const vtkVoxelModeller&) = delete;
144  void operator=(const vtkVoxelModeller&) = delete;
145 };
146 
147 #endif
vtkVoxelModeller::SetModelBounds
void SetModelBounds(const double bounds[6])
Specify the position in space to perform the voxelization.
vtkVoxelModeller::SetScalarTypeToUnsignedInt
void SetScalarTypeToUnsignedInt()
Definition: vtkVoxelModeller.h:97
vtkVoxelModeller::ScalarType
int ScalarType
Definition: vtkVoxelModeller.h:140
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:49
vtkVoxelModeller::SetScalarTypeToUnsignedShort
void SetScalarTypeToUnsignedShort()
Definition: vtkVoxelModeller.h:101
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:36
vtkVoxelModeller::SetScalarTypeToShort
void SetScalarTypeToShort()
Definition: vtkVoxelModeller.h:100
VTK_UNSIGNED_SHORT
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:47
vtkVoxelModeller::vtkVoxelModeller
vtkVoxelModeller()
vtkVoxelModeller::SetScalarTypeToBit
void SetScalarTypeToBit()
Definition: vtkVoxelModeller.h:104
vtkImageAlgorithm.h
vtkVoxelModeller::ComputeModelBounds
double ComputeModelBounds(double origin[3], double ar[3])
Compute the ModelBounds based on the input geometry.
vtkImageAlgorithm
Generic algorithm superclass for image algs.
Definition: vtkImageAlgorithm.h:38
vtkVoxelModeller::BackgroundValue
double BackgroundValue
Definition: vtkVoxelModeller.h:139
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkVoxelModeller::SetModelBounds
void SetModelBounds(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
vtkVoxelModeller::SetScalarTypeToUnsignedLong
void SetScalarTypeToUnsignedLong()
Definition: vtkVoxelModeller.h:99
vtkVoxelModeller::SetScalarTypeToUnsignedChar
void SetScalarTypeToUnsignedChar()
Definition: vtkVoxelModeller.h:102
vtkVoxelModeller::~vtkVoxelModeller
~vtkVoxelModeller() override
Definition: vtkVoxelModeller.h:124
VTK_CHAR
#define VTK_CHAR
Definition: vtkType.h:43
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
VTK_FLOAT
#define VTK_FLOAT
Definition: vtkType.h:52
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:53
VTK_UNSIGNED_CHAR
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:45
VTK_LONG
#define VTK_LONG
Definition: vtkType.h:50
vtkVoxelModeller::ForegroundValue
double ForegroundValue
Definition: vtkVoxelModeller.h:138
vtkVoxelModeller::SetScalarTypeToChar
void SetScalarTypeToChar()
Definition: vtkVoxelModeller.h:103
vtkVoxelModeller::SetScalarTypeToDouble
void SetScalarTypeToDouble()
Definition: vtkVoxelModeller.h:95
VTK_UNSIGNED_LONG
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:51
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:65
vtkX3D::info
@ info
Definition: vtkX3D.h:382
VTK_SHORT
#define VTK_SHORT
Definition: vtkType.h:46
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:42
vtkVoxelModeller::SetScalarTypeToFloat
void SetScalarTypeToFloat()
Definition: vtkVoxelModeller.h:94
VTK_INT
#define VTK_INT
Definition: vtkType.h:48
vtkVoxelModeller::SetScalarTypeToLong
void SetScalarTypeToLong()
Definition: vtkVoxelModeller.h:98
vtkVoxelModeller::SetSampleDimensions
void SetSampleDimensions(int dim[3])
vtkVoxelModeller::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkVoxelModeller::SetScalarTypeToInt
void SetScalarTypeToInt()
Definition: vtkVoxelModeller.h:96
vtkVoxelModeller
convert an arbitrary dataset to a voxel representation
Definition: vtkVoxelModeller.h:38
vtkVoxelModeller::MaximumDistance
double MaximumDistance
Definition: vtkVoxelModeller.h:136
vtkVoxelModeller::SetSampleDimensions
void SetSampleDimensions(int i, int j, int k)
Set the i-j-k dimensions on which to sample the distance function.