VTK  9.2.6
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 =========================================================================*/
90 #ifndef vtkImplicitModeller_h
91 #define vtkImplicitModeller_h
92 
93 #include "vtkFiltersHybridModule.h" // For export macro
94 #include "vtkImageAlgorithm.h"
95 #include "vtkThreads.h" // for VTK_MAX_THREADS
96 
97 #define VTK_VOXEL_MODE 0
98 #define VTK_CELL_MODE 1
99 
100 class vtkDataArray;
101 class vtkExtractGeometry;
102 class vtkMultiThreader;
103 
104 class VTKFILTERSHYBRID_EXPORT vtkImplicitModeller : public vtkImageAlgorithm
105 {
106 public:
108  void PrintSelf(ostream& os, vtkIndent indent) override;
109 
115  static vtkImplicitModeller* New();
116 
121  double ComputeModelBounds(vtkDataSet* input = nullptr);
122 
124 
127  vtkGetVectorMacro(SampleDimensions, int, 3);
128  void SetSampleDimensions(int i, int j, int k);
129  void SetSampleDimensions(int dim[3]);
131 
133 
139  vtkSetClampMacro(MaximumDistance, double, 0.0, 1.0);
140  vtkGetMacro(MaximumDistance, double);
142 
144 
148  vtkSetVector6Macro(ModelBounds, double);
149  vtkGetVectorMacro(ModelBounds, double, 6);
151 
153 
159  vtkSetMacro(AdjustBounds, vtkTypeBool);
160  vtkGetMacro(AdjustBounds, vtkTypeBool);
161  vtkBooleanMacro(AdjustBounds, vtkTypeBool);
163 
165 
170  vtkSetClampMacro(AdjustDistance, double, -1.0, 1.0);
171  vtkGetMacro(AdjustDistance, double);
173 
175 
179  vtkSetMacro(Capping, vtkTypeBool);
180  vtkGetMacro(Capping, vtkTypeBool);
181  vtkBooleanMacro(Capping, vtkTypeBool);
183 
185 
189  void SetCapValue(double value);
190  vtkGetMacro(CapValue, double);
192 
194 
204  vtkSetMacro(ScaleToMaximumDistance, vtkTypeBool);
205  vtkGetMacro(ScaleToMaximumDistance, vtkTypeBool);
206  vtkBooleanMacro(ScaleToMaximumDistance, vtkTypeBool);
208 
210 
217  vtkSetClampMacro(ProcessMode, int, 0, 1);
218  vtkGetMacro(ProcessMode, int);
219  void SetProcessModeToPerVoxel() { this->SetProcessMode(VTK_VOXEL_MODE); }
220  void SetProcessModeToPerCell() { this->SetProcessMode(VTK_CELL_MODE); }
221  const char* GetProcessModeAsString(void);
223 
225 
229  vtkSetMacro(LocatorMaxLevel, int);
230  vtkGetMacro(LocatorMaxLevel, int);
232 
234 
237  vtkSetClampMacro(NumberOfThreads, int, 1, VTK_MAX_THREADS);
238  vtkGetMacro(NumberOfThreads, int);
240 
242 
245  void SetOutputScalarType(int type);
246  vtkGetMacro(OutputScalarType, int);
247  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
248  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
249  void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
250  void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
251  void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
252  void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
253  void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
254  void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
255  void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
256  void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
258 
265  void StartAppend();
266 
274  void Append(vtkDataSet* input);
275 
279  void EndAppend();
280 
281  // See the vtkAlgorithm for a description of what these do
284 
285 protected:
287  ~vtkImplicitModeller() override;
288 
289  double GetScalarTypeMax(int type);
290 
293 
294  void StartAppend(int internal);
295  void Cap(vtkDataArray* s);
296 
299 
300  int SampleDimensions[3];
302  double ModelBounds[6];
304  double CapValue;
312 
313  // flag to limit to one ComputeModelBounds per StartAppend
315 
316  // the max distance computed during that one call
318 
319  int FillInputPortInformation(int, vtkInformation*) override;
320 
321 private:
322  vtkImplicitModeller(const vtkImplicitModeller&) = delete;
323  void operator=(const vtkImplicitModeller&) = delete;
324 };
325 
326 #endif
#define VTK_UNSIGNED_INT
Definition: vtkType.h:51
compute distance from input geometry on structured point dataset
Store vtkAlgorithm input/output information.
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:49
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
A class for performing multithreaded execution.
vtkTypeBool ScaleToMaximumDistance
void SetProcessModeToPerCell()
Specify whether to visit each cell once per append or each voxel once per append. ...
void SetOutputScalarTypeToDouble()
Set the desired output scalar type.
void SetOutputScalarTypeToUnsignedChar()
Set the desired output scalar type.
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_DOUBLE
Definition: vtkType.h:55
void SetOutputScalarTypeToUnsignedShort()
Set the desired output scalar type.
#define VTK_FLOAT
Definition: vtkType.h:54
void SetOutputScalarTypeToInt()
Set the desired output scalar type.
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
void SetOutputScalarTypeToChar()
Set the desired output scalar type.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
void SetOutputScalarTypeToShort()
Set the desired output scalar type.
#define VTK_SHORT
Definition: vtkType.h:48
void SetOutputScalarTypeToFloat()
Set the desired output scalar type.
#define VTK_CHAR
Definition: vtkType.h:45
#define VTK_LONG
Definition: vtkType.h:52
#define VTK_VOXEL_MODE
vtkMultiThreader * Threader
#define VTK_CELL_MODE
void SetOutputScalarTypeToUnsignedInt()
Set the desired output scalar type.
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:47
void SetProcessModeToPerVoxel()
Specify whether to visit each cell once per append or each voxel once per append. ...
void SetOutputScalarTypeToLong()
Set the desired output scalar type.
int FillInputPortInformation(int port, vtkInformation *info) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
Generic algorithm superclass for image algs.
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:53
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called in response to a REQUEST_DATA request from the executive.
extract cells that lie either entirely inside or outside of a specified implicit function ...
vtkTypeBool ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Process a request from the executive.
#define VTK_INT
Definition: vtkType.h:50
void SetOutputScalarTypeToUnsignedLong()
Set the desired output scalar type.