VTK  9.1.0
vtkImplicitModeller.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImplicitModeller.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 =========================================================================*/
87 #ifndef vtkImplicitModeller_h
88 #define vtkImplicitModeller_h
89 
90 #include "vtkFiltersHybridModule.h" // For export macro
91 #include "vtkImageAlgorithm.h"
92 #include "vtkThreads.h" // for VTK_MAX_THREADS
93 
94 #define VTK_VOXEL_MODE 0
95 #define VTK_CELL_MODE 1
96 
97 class vtkDataArray;
98 class vtkExtractGeometry;
99 class vtkMultiThreader;
100 
101 class VTKFILTERSHYBRID_EXPORT vtkImplicitModeller : public vtkImageAlgorithm
102 {
103 public:
105  void PrintSelf(ostream& os, vtkIndent indent) override;
106 
113 
118  double ComputeModelBounds(vtkDataSet* input = nullptr);
119 
121 
124  vtkGetVectorMacro(SampleDimensions, int, 3);
125  void SetSampleDimensions(int i, int j, int k);
126  void SetSampleDimensions(int dim[3]);
128 
130 
136  vtkSetClampMacro(MaximumDistance, double, 0.0, 1.0);
137  vtkGetMacro(MaximumDistance, double);
139 
141 
145  vtkSetVector6Macro(ModelBounds, double);
146  vtkGetVectorMacro(ModelBounds, double, 6);
148 
150 
156  vtkSetMacro(AdjustBounds, vtkTypeBool);
157  vtkGetMacro(AdjustBounds, vtkTypeBool);
158  vtkBooleanMacro(AdjustBounds, vtkTypeBool);
160 
162 
167  vtkSetClampMacro(AdjustDistance, double, -1.0, 1.0);
168  vtkGetMacro(AdjustDistance, double);
170 
172 
176  vtkSetMacro(Capping, vtkTypeBool);
177  vtkGetMacro(Capping, vtkTypeBool);
178  vtkBooleanMacro(Capping, vtkTypeBool);
180 
182 
186  void SetCapValue(double value);
187  vtkGetMacro(CapValue, double);
189 
191 
201  vtkSetMacro(ScaleToMaximumDistance, vtkTypeBool);
202  vtkGetMacro(ScaleToMaximumDistance, vtkTypeBool);
203  vtkBooleanMacro(ScaleToMaximumDistance, vtkTypeBool);
205 
207 
214  vtkSetClampMacro(ProcessMode, int, 0, 1);
215  vtkGetMacro(ProcessMode, int);
216  void SetProcessModeToPerVoxel() { this->SetProcessMode(VTK_VOXEL_MODE); }
217  void SetProcessModeToPerCell() { this->SetProcessMode(VTK_CELL_MODE); }
218  const char* GetProcessModeAsString(void);
220 
222 
226  vtkSetMacro(LocatorMaxLevel, int);
227  vtkGetMacro(LocatorMaxLevel, int);
229 
231 
234  vtkSetClampMacro(NumberOfThreads, int, 1, VTK_MAX_THREADS);
235  vtkGetMacro(NumberOfThreads, int);
237 
239 
243  vtkGetMacro(OutputScalarType, int);
244  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
245  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
246  void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
247  void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
248  void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
249  void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
250  void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
251  void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
252  void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
253  void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
255 
262  void StartAppend();
263 
271  void Append(vtkDataSet* input);
272 
276  void EndAppend();
277 
278  // See the vtkAlgorithm for a description of what these do
281 
282 protected:
285 
286  double GetScalarTypeMax(int type);
287 
290 
291  void StartAppend(int internal);
292  void Cap(vtkDataArray* s);
293 
296 
297  int SampleDimensions[3];
299  double ModelBounds[6];
301  double CapValue;
309 
310  // flag to limit to one ComputeModelBounds per StartAppend
312 
313  // the max distance computed during that one call
315 
317 
318 private:
319  vtkImplicitModeller(const vtkImplicitModeller&) = delete;
320  void operator=(const vtkImplicitModeller&) = delete;
321 };
322 
323 #endif
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:50
abstract class to specify dataset behavior
Definition: vtkDataSet.h:57
extract cells that lie either entirely inside or outside of a specified implicit function
Generic algorithm superclass for image algs.
compute distance from input geometry on structured point dataset
void SetOutputScalarTypeToDouble()
Set the desired output scalar type.
void StartAppend()
Initialize the filter for appending data.
static vtkImplicitModeller * New()
Construct with sample dimensions=(50,50,50), and so that model bounds are automatically computed from...
double GetScalarTypeMax(int type)
void SetOutputScalarTypeToChar()
Set the desired output scalar type.
double ComputeModelBounds(vtkDataSet *input=nullptr)
Compute ModelBounds from input geometry.
vtkMultiThreader * Threader
void Cap(vtkDataArray *s)
int FillInputPortInformation(int, vtkInformation *) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
void StartAppend(int internal)
void SetOutputScalarTypeToUnsignedShort()
Set the desired output scalar type.
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkTypeBool ScaleToMaximumDistance
void SetOutputScalarTypeToUnsignedInt()
Set the desired output scalar type.
vtkTypeBool ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Process a request from the executive.
void EndAppend()
Method completes the append process.
void SetSampleDimensions(int i, int j, int k)
Set/Get the i-j-k dimensions on which to sample distance function.
void SetSampleDimensions(int dim[3])
Set/Get the i-j-k dimensions on which to sample distance function.
~vtkImplicitModeller() override
void SetOutputScalarTypeToUnsignedChar()
Set the desired output scalar type.
void SetOutputScalarTypeToUnsignedLong()
Set the desired output scalar type.
void SetOutputScalarTypeToLong()
Set the desired output scalar type.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called in response to a REQUEST_DATA request from the executive.
void SetOutputScalarTypeToInt()
Set the desired output scalar type.
const char * GetProcessModeAsString(void)
Specify whether to visit each cell once per append or each voxel once per append.
void SetCapValue(double value)
Specify the capping value to use.
void SetOutputScalarTypeToShort()
Set the desired output scalar type.
void SetOutputScalarTypeToFloat()
Set the desired output scalar type.
void Append(vtkDataSet *input)
Append a data set to the existing output.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetProcessModeToPerCell()
Specify whether to visit each cell once per append or each voxel once per append.
void SetOutputScalarType(int type)
Set the desired output scalar type.
void SetProcessModeToPerVoxel()
Specify whether to visit each cell once per append or each voxel once per append.
a simple class to control print indentation
Definition: vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
A class for performing multithreaded execution.
@ value
Definition: vtkX3D.h:226
@ type
Definition: vtkX3D.h:522
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_VOXEL_MODE
#define VTK_CELL_MODE
#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_LONG
Definition: vtkType.h:52