VTK: Filters/Hybrid/vtkImplicitModeller.h Source File

| VTK 9.3.1

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
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 VTK_ABI_NAMESPACE_BEGIN
98 class vtkDataArray;
99 class vtkExtractGeometry;
100 class vtkMultiThreader;
101
102 class VTKFILTERSHYBRID_EXPORT vtkImplicitModeller : public vtkImageAlgorithm
103 {
104 public:
105 vtkTypeMacro(vtkImplicitModeller, vtkImageAlgorithm);
106 void PrintSelf(ostream& os, vtkIndent indent) override;
107
113 static vtkImplicitModeller* New();
114
119 double ComputeModelBounds(vtkDataSet* input = nullptr);
120
122
125 vtkGetVectorMacro(SampleDimensions, int, 3);
126 void SetSampleDimensions(int i, int j, int k);
127 void SetSampleDimensions(int dim[3]);
129
131
137 vtkSetClampMacro(MaximumDistance, double, 0.0, 1.0);
138 vtkGetMacro(MaximumDistance, double);
140
142
146 vtkSetVector6Macro(ModelBounds, double);
147 vtkGetVectorMacro(ModelBounds, double, 6);
149
151
157 vtkSetMacro(AdjustBounds, vtkTypeBool);
158 vtkGetMacro(AdjustBounds, vtkTypeBool);
159 vtkBooleanMacro(AdjustBounds, vtkTypeBool);
161
163
168 vtkSetClampMacro(AdjustDistance, double, -1.0, 1.0);
169 vtkGetMacro(AdjustDistance, double);
171
173
177 vtkSetMacro(Capping, vtkTypeBool);
178 vtkGetMacro(Capping, vtkTypeBool);
179 vtkBooleanMacro(Capping, vtkTypeBool);
181
183
187 void SetCapValue(double value);
188 vtkGetMacro(CapValue, double);
190
192
202 vtkSetMacro(ScaleToMaximumDistance, vtkTypeBool);
203 vtkGetMacro(ScaleToMaximumDistance, vtkTypeBool);
204 vtkBooleanMacro(ScaleToMaximumDistance, vtkTypeBool);
206
208
215 vtkSetClampMacro(ProcessMode, int, 0, 1);
216 vtkGetMacro(ProcessMode, int);
217 void SetProcessModeToPerVoxel() { this->SetProcessMode(VTK_VOXEL_MODE); }
218 void SetProcessModeToPerCell() { this->SetProcessMode(VTK_CELL_MODE); }
219 const char* GetProcessModeAsString();
221
223
227 vtkSetMacro(LocatorMaxLevel, int);
228 vtkGetMacro(LocatorMaxLevel, int);
230
232
235 vtkSetClampMacro(NumberOfThreads, int, 1, VTK_MAX_THREADS);
236 vtkGetMacro(NumberOfThreads, int);
238
240
243 void SetOutputScalarType(int type);
244 vtkGetMacro(OutputScalarType, int);
245 void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
246 void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
247 void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
248 void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
249 void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
250 void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
251 void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
252 void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
253 void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
254 void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
256
263 void StartAppend();
264
272 void Append(vtkDataSet* input);
273
277 void EndAppend();
278
279 // See the vtkAlgorithm for a description of what these do
280 vtkTypeBool ProcessRequest(
281 vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
282
283 protected:
284 vtkImplicitModeller();
285 ~vtkImplicitModeller() override;
286
287 double GetScalarTypeMax(int type);
288
289 int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
290 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
291
292 void StartAppend(int internal);
293 void Cap(vtkDataArray* s);
294
295 vtkMultiThreader* Threader;
296 int NumberOfThreads;
297
298 int SampleDimensions[3];
299 double MaximumDistance;
300 double ModelBounds[6];
301 vtkTypeBool Capping;
302 double CapValue;
303 int DataAppended;
304 vtkTypeBool AdjustBounds;
305 double AdjustDistance;
306 int ProcessMode;
307 int LocatorMaxLevel;
308 int OutputScalarType;
309 vtkTypeBool ScaleToMaximumDistance;
310
311 // flag to limit to one ComputeModelBounds per StartAppend
312 int BoundsComputed;
313
314 // the max distance computed during that one call
315 double InternalMaxDistance;
316
317 int FillInputPortInformation(int, vtkInformation*) override;
318
319 private:
320 vtkImplicitModeller(const vtkImplicitModeller&) = delete;
321 void operator=(const vtkImplicitModeller&) = delete;
322 };
323
324 VTK_ABI_NAMESPACE_END
325 #endif
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkExtractGeometry
extract cells that lie either entirely inside or outside of a specified implicit function
Definition: vtkExtractGeometry.h:53
vtkImageAlgorithm
Generic algorithm superclass for image algs.
Definition: vtkImageAlgorithm.h:39
vtkImplicitModeller
compute distance from input geometry on structured point dataset
Definition: vtkImplicitModeller.h:103
vtkImplicitModeller::SetOutputScalarTypeToDouble
void SetOutputScalarTypeToDouble()
Set the desired output scalar type.
Definition: vtkImplicitModeller.h:246
vtkImplicitModeller::LocatorMaxLevel
int LocatorMaxLevel
Definition: vtkImplicitModeller.h:307
vtkImplicitModeller::BoundsComputed
int BoundsComputed
Definition: vtkImplicitModeller.h:312
vtkImplicitModeller::NumberOfThreads
int NumberOfThreads
Definition: vtkImplicitModeller.h:296
vtkImplicitModeller::GetProcessModeAsString
const char * GetProcessModeAsString()
Specify whether to visit each cell once per append or each voxel once per append.
vtkImplicitModeller::StartAppend
void StartAppend()
Initialize the filter for appending data.
vtkImplicitModeller::New
static vtkImplicitModeller * New()
Construct with sample dimensions=(50,50,50), and so that model bounds are automatically computed from...
vtkImplicitModeller::InternalMaxDistance
double InternalMaxDistance
Definition: vtkImplicitModeller.h:315
vtkImplicitModeller::GetScalarTypeMax
double GetScalarTypeMax(int type)
vtkImplicitModeller::SetOutputScalarTypeToChar
void SetOutputScalarTypeToChar()
Set the desired output scalar type.
Definition: vtkImplicitModeller.h:254
vtkImplicitModeller::ComputeModelBounds
double ComputeModelBounds(vtkDataSet *input=nullptr)
Compute ModelBounds from input geometry.
vtkImplicitModeller::Threader
vtkMultiThreader * Threader
Definition: vtkImplicitModeller.h:295
vtkImplicitModeller::Cap
void Cap(vtkDataArray *s)
vtkImplicitModeller::FillInputPortInformation
int FillInputPortInformation(int, vtkInformation *) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
vtkImplicitModeller::StartAppend
void StartAppend(int internal)
vtkImplicitModeller::SetOutputScalarTypeToUnsignedShort
void SetOutputScalarTypeToUnsignedShort()
Set the desired output scalar type.
Definition: vtkImplicitModeller.h:252
vtkImplicitModeller::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkImplicitModeller::ScaleToMaximumDistance
vtkTypeBool ScaleToMaximumDistance
Definition: vtkImplicitModeller.h:309
vtkImplicitModeller::SetOutputScalarTypeToUnsignedInt
void SetOutputScalarTypeToUnsignedInt()
Set the desired output scalar type.
Definition: vtkImplicitModeller.h:248
vtkImplicitModeller::ProcessRequest
vtkTypeBool ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Process a request from the executive.
vtkImplicitModeller::EndAppend
void EndAppend()
Method completes the append process.
vtkImplicitModeller::SetSampleDimensions
void SetSampleDimensions(int i, int j, int k)
Set/Get the i-j-k dimensions on which to sample distance function.
vtkImplicitModeller::SetSampleDimensions
void SetSampleDimensions(int dim[3])
Set/Get the i-j-k dimensions on which to sample distance function.
vtkImplicitModeller::~vtkImplicitModeller
~vtkImplicitModeller() override
vtkImplicitModeller::SetOutputScalarTypeToUnsignedChar
void SetOutputScalarTypeToUnsignedChar()
Set the desired output scalar type.
Definition: vtkImplicitModeller.h:253
vtkImplicitModeller::OutputScalarType
int OutputScalarType
Definition: vtkImplicitModeller.h:308
vtkImplicitModeller::SetOutputScalarTypeToUnsignedLong
void SetOutputScalarTypeToUnsignedLong()
Set the desired output scalar type.
Definition: vtkImplicitModeller.h:250
vtkImplicitModeller::SetOutputScalarTypeToLong
void SetOutputScalarTypeToLong()
Set the desired output scalar type.
Definition: vtkImplicitModeller.h:249
vtkImplicitModeller::ProcessMode
int ProcessMode
Definition: vtkImplicitModeller.h:306
vtkImplicitModeller::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called in response to a REQUEST_DATA request from the executive.
vtkImplicitModeller::SetOutputScalarTypeToInt
void SetOutputScalarTypeToInt()
Set the desired output scalar type.
Definition: vtkImplicitModeller.h:247
vtkImplicitModeller::Capping
vtkTypeBool Capping
Definition: vtkImplicitModeller.h:301
vtkImplicitModeller::SetCapValue
void SetCapValue(double value)
Specify the capping value to use.
vtkImplicitModeller::AdjustDistance
double AdjustDistance
Definition: vtkImplicitModeller.h:305
vtkImplicitModeller::SetOutputScalarTypeToShort
void SetOutputScalarTypeToShort()
Set the desired output scalar type.
Definition: vtkImplicitModeller.h:251
vtkImplicitModeller::SetOutputScalarTypeToFloat
void SetOutputScalarTypeToFloat()
Set the desired output scalar type.
Definition: vtkImplicitModeller.h:245
vtkImplicitModeller::MaximumDistance
double MaximumDistance
Definition: vtkImplicitModeller.h:299
vtkImplicitModeller::AdjustBounds
vtkTypeBool AdjustBounds
Definition: vtkImplicitModeller.h:304
vtkImplicitModeller::Append
void Append(vtkDataSet *input)
Append a data set to the existing output.
vtkImplicitModeller::vtkImplicitModeller
vtkImplicitModeller()
vtkImplicitModeller::DataAppended
int DataAppended
Definition: vtkImplicitModeller.h:303
vtkImplicitModeller::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImplicitModeller::SetProcessModeToPerCell
void SetProcessModeToPerCell()
Specify whether to visit each cell once per append or each voxel once per append.
Definition: vtkImplicitModeller.h:218
vtkImplicitModeller::SetOutputScalarType
void SetOutputScalarType(int type)
Set the desired output scalar type.
vtkImplicitModeller::SetProcessModeToPerVoxel
void SetProcessModeToPerVoxel()
Specify whether to visit each cell once per append or each voxel once per append.
Definition: vtkImplicitModeller.h:217
vtkImplicitModeller::CapValue
double CapValue
Definition: vtkImplicitModeller.h:302
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkMultiThreader
A class for performing multithreaded execution.
Definition: vtkMultiThreader.h:72
vtkX3D::value
@ value
Definition: vtkX3D.h:220
vtkX3D::type
@ type
Definition: vtkX3D.h:516
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkImageAlgorithm.h
VTK_VOXEL_MODE
#define VTK_VOXEL_MODE
Definition: vtkImplicitModeller.h:94
VTK_CELL_MODE
#define VTK_CELL_MODE
Definition: vtkImplicitModeller.h:95
VTK_SHORT
#define VTK_SHORT
Definition: vtkType.h:36
VTK_UNSIGNED_INT
#define VTK_UNSIGNED_INT
Definition: vtkType.h:39
VTK_DOUBLE
#define VTK_DOUBLE
Definition: vtkType.h:43
VTK_UNSIGNED_CHAR
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:35
VTK_UNSIGNED_SHORT
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:37
VTK_INT
#define VTK_INT
Definition: vtkType.h:38
VTK_FLOAT
#define VTK_FLOAT
Definition: vtkType.h:42
VTK_CHAR
#define VTK_CHAR
Definition: vtkType.h:33
VTK_UNSIGNED_LONG
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:41
VTK_LONG
#define VTK_LONG
Definition: vtkType.h:40