VTK  9.3.0
vtkImplicitModeller.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
78#ifndef vtkImplicitModeller_h
79#define vtkImplicitModeller_h
80
81#include "vtkFiltersHybridModule.h" // For export macro
82#include "vtkImageAlgorithm.h"
83#include "vtkThreads.h" // for VTK_MAX_THREADS
84
85#define VTK_VOXEL_MODE 0
86#define VTK_CELL_MODE 1
87
88VTK_ABI_NAMESPACE_BEGIN
89class vtkDataArray;
92
93class VTKFILTERSHYBRID_EXPORT vtkImplicitModeller : public vtkImageAlgorithm
94{
95public:
97 void PrintSelf(ostream& os, vtkIndent indent) override;
98
105
110 double ComputeModelBounds(vtkDataSet* input = nullptr);
111
113
116 vtkGetVectorMacro(SampleDimensions, int, 3);
117 void SetSampleDimensions(int i, int j, int k);
118 void SetSampleDimensions(int dim[3]);
120
122
128 vtkSetClampMacro(MaximumDistance, double, 0.0, 1.0);
129 vtkGetMacro(MaximumDistance, double);
131
133
137 vtkSetVector6Macro(ModelBounds, double);
138 vtkGetVectorMacro(ModelBounds, double, 6);
140
142
148 vtkSetMacro(AdjustBounds, vtkTypeBool);
149 vtkGetMacro(AdjustBounds, vtkTypeBool);
150 vtkBooleanMacro(AdjustBounds, vtkTypeBool);
152
154
159 vtkSetClampMacro(AdjustDistance, double, -1.0, 1.0);
160 vtkGetMacro(AdjustDistance, double);
162
164
168 vtkSetMacro(Capping, vtkTypeBool);
169 vtkGetMacro(Capping, vtkTypeBool);
170 vtkBooleanMacro(Capping, vtkTypeBool);
172
174
178 void SetCapValue(double value);
179 vtkGetMacro(CapValue, double);
181
183
193 vtkSetMacro(ScaleToMaximumDistance, vtkTypeBool);
194 vtkGetMacro(ScaleToMaximumDistance, vtkTypeBool);
195 vtkBooleanMacro(ScaleToMaximumDistance, vtkTypeBool);
197
199
206 vtkSetClampMacro(ProcessMode, int, 0, 1);
207 vtkGetMacro(ProcessMode, int);
208 void SetProcessModeToPerVoxel() { this->SetProcessMode(VTK_VOXEL_MODE); }
209 void SetProcessModeToPerCell() { this->SetProcessMode(VTK_CELL_MODE); }
212
214
218 vtkSetMacro(LocatorMaxLevel, int);
219 vtkGetMacro(LocatorMaxLevel, int);
221
223
226 vtkSetClampMacro(NumberOfThreads, int, 1, VTK_MAX_THREADS);
227 vtkGetMacro(NumberOfThreads, int);
229
231
234 void SetOutputScalarType(int type);
235 vtkGetMacro(OutputScalarType, int);
236 void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
237 void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
238 void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
239 void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
240 void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
241 void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
242 void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
243 void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
244 void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
245 void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
247
255
263 void Append(vtkDataSet* input);
264
268 void EndAppend();
269
270 // See the vtkAlgorithm for a description of what these do
273
274protected:
277
278 double GetScalarTypeMax(int type);
279
282
285
288
289 int SampleDimensions[3];
291 double ModelBounds[6];
293 double CapValue;
301
302 // flag to limit to one ComputeModelBounds per StartAppend
304
305 // the max distance computed during that one call
307
309
310private:
312 void operator=(const vtkImplicitModeller&) = delete;
313};
314
315VTK_ABI_NAMESPACE_END
316#endif
abstract superclass for arrays of numeric data
abstract class to specify dataset behavior
Definition vtkDataSet.h:53
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.
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...
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.
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.
const char * GetProcessModeAsString()
Specify whether to visit each cell once per append or each voxel once per append.
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.
static vtkImplicitModeller * New()
Construct with sample dimensions=(50,50,50), and so that model bounds are automatically computed from...
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:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
A class for performing multithreaded execution.
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_VOXEL_MODE
#define VTK_CELL_MODE
#define VTK_SHORT
Definition vtkType.h:36
#define VTK_UNSIGNED_INT
Definition vtkType.h:39
#define VTK_DOUBLE
Definition vtkType.h:43
#define VTK_UNSIGNED_CHAR
Definition vtkType.h:35
#define VTK_UNSIGNED_SHORT
Definition vtkType.h:37
#define VTK_INT
Definition vtkType.h:38
#define VTK_FLOAT
Definition vtkType.h:42
#define VTK_CHAR
Definition vtkType.h:33
#define VTK_UNSIGNED_LONG
Definition vtkType.h:41
#define VTK_LONG
Definition vtkType.h:40