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 =========================================================================*/
156 #ifndef vtkImplicitModeller_h
157 #define vtkImplicitModeller_h
158 
159 #include "vtkFiltersHybridModule.h" // For export macro
160 #include "vtkImageAlgorithm.h"
161 #include "vtkThreads.h" // for VTK_MAX_THREADS
162 
163 #define VTK_VOXEL_MODE 0
164 #define VTK_CELL_MODE 1
165 
166 class vtkDataArray;
167 class vtkExtractGeometry;
168 class vtkMultiThreader;
169 
170 class VTKFILTERSHYBRID_EXPORT vtkImplicitModeller : public vtkImageAlgorithm
171 {
172 public:
174  void PrintSelf(ostream& os, vtkIndent indent) override;
175 
182 
187  double ComputeModelBounds(vtkDataSet* input = nullptr);
188 
190 
193  vtkGetVectorMacro(SampleDimensions, int, 3);
194  void SetSampleDimensions(int i, int j, int k);
195  void SetSampleDimensions(int dim[3]);
197 
199 
205  vtkSetClampMacro(MaximumDistance, double, 0.0, 1.0);
206  vtkGetMacro(MaximumDistance, double);
208 
210 
214  vtkSetVector6Macro(ModelBounds, double);
215  vtkGetVectorMacro(ModelBounds, double, 6);
217 
219 
225  vtkSetMacro(AdjustBounds, vtkTypeBool);
226  vtkGetMacro(AdjustBounds, vtkTypeBool);
227  vtkBooleanMacro(AdjustBounds, vtkTypeBool);
229 
231 
236  vtkSetClampMacro(AdjustDistance, double, -1.0, 1.0);
237  vtkGetMacro(AdjustDistance, double);
239 
241 
245  vtkSetMacro(Capping, vtkTypeBool);
246  vtkGetMacro(Capping, vtkTypeBool);
247  vtkBooleanMacro(Capping, vtkTypeBool);
249 
251 
255  void SetCapValue(double value);
256  vtkGetMacro(CapValue, double);
258 
260 
270  vtkSetMacro(ScaleToMaximumDistance, vtkTypeBool);
271  vtkGetMacro(ScaleToMaximumDistance, vtkTypeBool);
272  vtkBooleanMacro(ScaleToMaximumDistance, vtkTypeBool);
274 
276 
283  vtkSetClampMacro(ProcessMode, int, 0, 1);
284  vtkGetMacro(ProcessMode, int);
285  void SetProcessModeToPerVoxel() { this->SetProcessMode(VTK_VOXEL_MODE); }
286  void SetProcessModeToPerCell() { this->SetProcessMode(VTK_CELL_MODE); }
287  const char* GetProcessModeAsString(void);
289 
291 
295  vtkSetMacro(LocatorMaxLevel, int);
296  vtkGetMacro(LocatorMaxLevel, int);
298 
300 
303  vtkSetClampMacro(NumberOfThreads, int, 1, VTK_MAX_THREADS);
304  vtkGetMacro(NumberOfThreads, int);
306 
308 
312  vtkGetMacro(OutputScalarType, int);
313  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
314  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
315  void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
316  void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
317  void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
318  void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
319  void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
320  void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
321  void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
322  void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
324 
331  void StartAppend();
332 
340  void Append(vtkDataSet* input);
341 
345  void EndAppend();
346 
347  // See the vtkAlgorithm for a description of what these do
350 
351 protected:
354 
355  double GetScalarTypeMax(int type);
356 
359 
360  void StartAppend(int internal);
361  void Cap(vtkDataArray* s);
362 
365 
366  int SampleDimensions[3];
368  double ModelBounds[6];
370  double CapValue;
378 
379  // flag to limit to one ComputeModelBounds per StartAppend
381 
382  // the max distance computed during that one call
384 
386 
387 private:
388  vtkImplicitModeller(const vtkImplicitModeller&) = delete;
389  void operator=(const vtkImplicitModeller&) = delete;
390 };
391 
392 #endif
vtkImplicitModeller::SetOutputScalarTypeToUnsignedLong
void SetOutputScalarTypeToUnsignedLong()
Set the desired output scalar type.
Definition: vtkImplicitModeller.h:318
vtkImplicitModeller::SetOutputScalarTypeToChar
void SetOutputScalarTypeToChar()
Set the desired output scalar type.
Definition: vtkImplicitModeller.h:322
vtkImplicitModeller::InternalMaxDistance
double InternalMaxDistance
Definition: vtkImplicitModeller.h:383
vtkX3D::value
@ value
Definition: vtkX3D.h:226
vtkImplicitModeller::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called in response to a REQUEST_DATA request from the executive.
vtkX3D::type
@ type
Definition: vtkX3D.h:522
VTK_UNSIGNED_INT
#define VTK_UNSIGNED_INT
Definition: vtkType.h:51
vtkImplicitModeller::SetCapValue
void SetCapValue(double value)
Specify the capping value to use.
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
VTK_UNSIGNED_SHORT
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:49
vtkImplicitModeller::StartAppend
void StartAppend(int internal)
vtkImplicitModeller::~vtkImplicitModeller
~vtkImplicitModeller() override
vtkImplicitModeller::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkImageAlgorithm.h
vtkImplicitModeller::GetScalarTypeMax
double GetScalarTypeMax(int type)
vtkImplicitModeller::GetProcessModeAsString
const char * GetProcessModeAsString(void)
Specify whether to visit each cell once per append or each voxel once per append.
vtkImplicitModeller::FillInputPortInformation
int FillInputPortInformation(int, vtkInformation *) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:159
vtkImageAlgorithm
Generic algorithm superclass for image algs.
Definition: vtkImageAlgorithm.h:57
vtkImplicitModeller::Append
void Append(vtkDataSet *input)
Append a data set to the existing output.
vtkImplicitModeller::StartAppend
void StartAppend()
Initialize the filter for appending data.
vtkImplicitModeller::SetOutputScalarTypeToLong
void SetOutputScalarTypeToLong()
Set the desired output scalar type.
Definition: vtkImplicitModeller.h:317
vtkImplicitModeller::CapValue
double CapValue
Definition: vtkImplicitModeller.h:370
vtkExtractGeometry
extract cells that lie either entirely inside or outside of a specified implicit function
Definition: vtkExtractGeometry.h:107
vtkImplicitModeller::NumberOfThreads
int NumberOfThreads
Definition: vtkImplicitModeller.h:364
vtkMultiThreader
A class for performing multithreaded execution.
Definition: vtkMultiThreader.h:77
vtkImplicitModeller
compute distance from input geometry on structured point dataset
Definition: vtkImplicitModeller.h:171
vtkImplicitModeller::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
VTK_CHAR
#define VTK_CHAR
Definition: vtkType.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkImplicitModeller::SetOutputScalarTypeToUnsignedShort
void SetOutputScalarTypeToUnsignedShort()
Set the desired output scalar type.
Definition: vtkImplicitModeller.h:320
vtkImplicitModeller::ComputeModelBounds
double ComputeModelBounds(vtkDataSet *input=nullptr)
Compute ModelBounds from input geometry.
vtkImplicitModeller::ProcessMode
int ProcessMode
Definition: vtkImplicitModeller.h:374
VTK_FLOAT
#define VTK_FLOAT
Definition: vtkType.h:54
VTK_DOUBLE
#define VTK_DOUBLE
Definition: vtkType.h:55
vtkImplicitModeller::AdjustDistance
double AdjustDistance
Definition: vtkImplicitModeller.h:373
vtkImplicitModeller::Cap
void Cap(vtkDataArray *s)
vtkImplicitModeller::DataAppended
int DataAppended
Definition: vtkImplicitModeller.h:371
vtkImplicitModeller::SetOutputScalarType
void SetOutputScalarType(int type)
Set the desired output scalar type.
vtkImplicitModeller::MaximumDistance
double MaximumDistance
Definition: vtkImplicitModeller.h:367
VTK_UNSIGNED_CHAR
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:47
VTK_VOXEL_MODE
#define VTK_VOXEL_MODE
Definition: vtkImplicitModeller.h:163
VTK_LONG
#define VTK_LONG
Definition: vtkType.h:52
vtkImplicitModeller::OutputScalarType
int OutputScalarType
Definition: vtkImplicitModeller.h:376
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
vtkImplicitModeller::ScaleToMaximumDistance
vtkTypeBool ScaleToMaximumDistance
Definition: vtkImplicitModeller.h:377
VTK_UNSIGNED_LONG
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:53
vtkImplicitModeller::SetOutputScalarTypeToDouble
void SetOutputScalarTypeToDouble()
Set the desired output scalar type.
Definition: vtkImplicitModeller.h:314
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkImplicitModeller::SetSampleDimensions
void SetSampleDimensions(int dim[3])
Set/Get the i-j-k dimensions on which to sample distance function.
VTK_SHORT
#define VTK_SHORT
Definition: vtkType.h:48
vtkImplicitModeller::SetOutputScalarTypeToUnsignedChar
void SetOutputScalarTypeToUnsignedChar()
Set the desired output scalar type.
Definition: vtkImplicitModeller.h:321
vtkImplicitModeller::ProcessRequest
vtkTypeBool ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Process a request from the executive.
vtkImplicitModeller::vtkImplicitModeller
vtkImplicitModeller()
vtkImplicitModeller::LocatorMaxLevel
int LocatorMaxLevel
Definition: vtkImplicitModeller.h:375
vtkImplicitModeller::Threader
vtkMultiThreader * Threader
Definition: vtkImplicitModeller.h:363
vtkImplicitModeller::SetProcessModeToPerCell
void SetProcessModeToPerCell()
Specify whether to visit each cell once per append or each voxel once per append.
Definition: vtkImplicitModeller.h:286
vtkImplicitModeller::SetOutputScalarTypeToShort
void SetOutputScalarTypeToShort()
Set the desired output scalar type.
Definition: vtkImplicitModeller.h:319
vtkImplicitModeller::Capping
vtkTypeBool Capping
Definition: vtkImplicitModeller.h:369
vtkImplicitModeller::New
static vtkImplicitModeller * New()
Construct with sample dimensions=(50,50,50), and so that model bounds are automatically computed from...
VTK_CELL_MODE
#define VTK_CELL_MODE
Definition: vtkImplicitModeller.h:164
vtkImplicitModeller::SetOutputScalarTypeToUnsignedInt
void SetOutputScalarTypeToUnsignedInt()
Set the desired output scalar type.
Definition: vtkImplicitModeller.h:316
vtkImplicitModeller::AdjustBounds
vtkTypeBool AdjustBounds
Definition: vtkImplicitModeller.h:372
VTK_INT
#define VTK_INT
Definition: vtkType.h:50
vtkImplicitModeller::EndAppend
void EndAppend()
Method completes the append process.
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkImplicitModeller::SetSampleDimensions
void SetSampleDimensions(int i, int j, int k)
Set/Get the i-j-k dimensions on which to sample distance function.
vtkImplicitModeller::SetOutputScalarTypeToInt
void SetOutputScalarTypeToInt()
Set the desired output scalar type.
Definition: vtkImplicitModeller.h:315
vtkImplicitModeller::BoundsComputed
int BoundsComputed
Definition: vtkImplicitModeller.h:380
vtkImplicitModeller::SetProcessModeToPerVoxel
void SetProcessModeToPerVoxel()
Specify whether to visit each cell once per append or each voxel once per append.
Definition: vtkImplicitModeller.h:285
vtkImplicitModeller::SetOutputScalarTypeToFloat
void SetOutputScalarTypeToFloat()
Set the desired output scalar type.
Definition: vtkImplicitModeller.h:313