VTK
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 
93 #define VTK_VOXEL_MODE 0
94 #define VTK_CELL_MODE 1
95 
96 class vtkDataArray;
97 class vtkExtractGeometry;
98 class vtkMultiThreader;
99 
100 class VTKFILTERSHYBRID_EXPORT vtkImplicitModeller : public vtkImageAlgorithm
101 {
102 public:
104  void PrintSelf(ostream& os, vtkIndent indent) override;
105 
111  static vtkImplicitModeller* New();
112 
117  double ComputeModelBounds(vtkDataSet* input = nullptr);
118 
120 
123  vtkGetVectorMacro(SampleDimensions, int, 3);
124  void SetSampleDimensions(int i, int j, int k);
125  void SetSampleDimensions(int dim[3]);
127 
129 
135  vtkSetClampMacro(MaximumDistance, double, 0.0, 1.0);
136  vtkGetMacro(MaximumDistance, double);
138 
140 
144  vtkSetVector6Macro(ModelBounds, double);
145  vtkGetVectorMacro(ModelBounds, double, 6);
147 
149 
155  vtkSetMacro(AdjustBounds, vtkTypeBool);
156  vtkGetMacro(AdjustBounds, vtkTypeBool);
157  vtkBooleanMacro(AdjustBounds, vtkTypeBool);
159 
161 
166  vtkSetClampMacro(AdjustDistance, double, -1.0, 1.0);
167  vtkGetMacro(AdjustDistance, double);
169 
171 
175  vtkSetMacro(Capping, vtkTypeBool);
176  vtkGetMacro(Capping, vtkTypeBool);
177  vtkBooleanMacro(Capping, vtkTypeBool);
179 
181 
185  void SetCapValue(double value);
186  vtkGetMacro(CapValue, double);
188 
190 
200  vtkSetMacro(ScaleToMaximumDistance, vtkTypeBool);
201  vtkGetMacro(ScaleToMaximumDistance, vtkTypeBool);
202  vtkBooleanMacro(ScaleToMaximumDistance, vtkTypeBool);
204 
206 
213  vtkSetClampMacro(ProcessMode, int, 0, 1);
214  vtkGetMacro(ProcessMode, int);
215  void SetProcessModeToPerVoxel() { this->SetProcessMode(VTK_VOXEL_MODE); }
216  void SetProcessModeToPerCell() { this->SetProcessMode(VTK_CELL_MODE); }
217  const char* GetProcessModeAsString(void);
219 
221 
225  vtkSetMacro(LocatorMaxLevel, int);
226  vtkGetMacro(LocatorMaxLevel, int);
228 
230 
233  vtkSetClampMacro(NumberOfThreads, int, 1, VTK_MAX_THREADS);
234  vtkGetMacro(NumberOfThreads, int);
236 
238 
241  void SetOutputScalarType(int type);
242  vtkGetMacro(OutputScalarType, int);
243  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
244  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
245  void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
246  void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
247  void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
248  void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
249  void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
250  void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
251  void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
252  void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
254 
261  void StartAppend();
262 
270  void Append(vtkDataSet* input);
271 
275  void EndAppend();
276 
277  // See the vtkAlgorithm for a description of what these do
280 
281 protected:
283  ~vtkImplicitModeller() override;
284 
285  double GetScalarTypeMax(int type);
286 
289 
290  void StartAppend(int internal);
291  void Cap(vtkDataArray* s);
292 
295 
296  int SampleDimensions[3];
298  double ModelBounds[6];
300  double CapValue;
308 
309  // flag to limit to one ComputeModelBounds per StartAppend
311 
312  // the max distance computed during that one call
314 
315  int FillInputPortInformation(int, vtkInformation*) override;
316 
317 private:
318  vtkImplicitModeller(const vtkImplicitModeller&) = delete;
319  void operator=(const vtkImplicitModeller&) = delete;
320 };
321 
322 #endif
vtkImageAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called in response to a REQUEST_DATA request from the executive.
vtkImplicitModeller::SetOutputScalarTypeToUnsignedLong
void SetOutputScalarTypeToUnsignedLong()
Definition: vtkImplicitModeller.h:248
vtkImplicitModeller::SetOutputScalarTypeToChar
void SetOutputScalarTypeToChar()
Definition: vtkImplicitModeller.h:252
vtkImplicitModeller::InternalMaxDistance
double InternalMaxDistance
Definition: vtkImplicitModeller.h:313
vtkX3D::value
Definition: vtkX3D.h:226
vtkX3D::type
Definition: vtkX3D.h:522
VTK_UNSIGNED_INT
#define VTK_UNSIGNED_INT
Definition: vtkType.h:55
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
VTK_UNSIGNED_SHORT
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:53
vtkImageAlgorithm.h
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:49
vtkImageAlgorithm
Generic algorithm superclass for image algs.
Definition: vtkImageAlgorithm.h:37
vtkImplicitModeller::SetOutputScalarTypeToLong
void SetOutputScalarTypeToLong()
Definition: vtkImplicitModeller.h:247
vtkImplicitModeller::CapValue
double CapValue
Definition: vtkImplicitModeller.h:300
vtkExtractGeometry
extract cells that lie either entirely inside or outside of a specified implicit function
Definition: vtkExtractGeometry.h:47
vtkImplicitModeller::NumberOfThreads
int NumberOfThreads
Definition: vtkImplicitModeller.h:294
vtkMultiThreader
A class for performing multithreaded execution.
Definition: vtkMultiThreader.h:77
vtkImplicitModeller
compute distance from input geometry on structured point dataset
Definition: vtkImplicitModeller.h:100
vtkImageAlgorithm::RequestInformation
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
VTK_CHAR
#define VTK_CHAR
Definition: vtkType.h:49
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkImplicitModeller::SetOutputScalarTypeToUnsignedShort
void SetOutputScalarTypeToUnsignedShort()
Definition: vtkImplicitModeller.h:250
vtkImplicitModeller::ProcessMode
int ProcessMode
Definition: vtkImplicitModeller.h:304
VTK_FLOAT
#define VTK_FLOAT
Definition: vtkType.h:58
VTK_DOUBLE
#define VTK_DOUBLE
Definition: vtkType.h:59
vtkImplicitModeller::AdjustDistance
double AdjustDistance
Definition: vtkImplicitModeller.h:303
vtkImplicitModeller::DataAppended
int DataAppended
Definition: vtkImplicitModeller.h:301
vtkImplicitModeller::MaximumDistance
double MaximumDistance
Definition: vtkImplicitModeller.h:297
VTK_UNSIGNED_CHAR
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:51
VTK_VOXEL_MODE
#define VTK_VOXEL_MODE
Definition: vtkImplicitModeller.h:93
VTK_LONG
#define VTK_LONG
Definition: vtkType.h:56
vtkImplicitModeller::OutputScalarType
int OutputScalarType
Definition: vtkImplicitModeller.h:306
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
vtkImplicitModeller::ScaleToMaximumDistance
vtkTypeBool ScaleToMaximumDistance
Definition: vtkImplicitModeller.h:307
VTK_UNSIGNED_LONG
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:57
vtkImplicitModeller::SetOutputScalarTypeToDouble
void SetOutputScalarTypeToDouble()
Definition: vtkImplicitModeller.h:244
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:64
vtkImageAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAlgorithm::New
static vtkAlgorithm * New()
VTK_SHORT
#define VTK_SHORT
Definition: vtkType.h:52
vtkImplicitModeller::SetOutputScalarTypeToUnsignedChar
void SetOutputScalarTypeToUnsignedChar()
Definition: vtkImplicitModeller.h:251
vtkImplicitModeller::LocatorMaxLevel
int LocatorMaxLevel
Definition: vtkImplicitModeller.h:305
vtkImplicitModeller::Threader
vtkMultiThreader * Threader
Definition: vtkImplicitModeller.h:293
vtkImplicitModeller::SetProcessModeToPerCell
void SetProcessModeToPerCell()
Definition: vtkImplicitModeller.h:216
vtkImplicitModeller::SetOutputScalarTypeToShort
void SetOutputScalarTypeToShort()
Definition: vtkImplicitModeller.h:249
vtkImplicitModeller::Capping
vtkTypeBool Capping
Definition: vtkImplicitModeller.h:299
vtkImageAlgorithm::ProcessRequest
vtkTypeBool ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Process a request from the executive.
VTK_CELL_MODE
#define VTK_CELL_MODE
Definition: vtkImplicitModeller.h:94
vtkImplicitModeller::SetOutputScalarTypeToUnsignedInt
void SetOutputScalarTypeToUnsignedInt()
Definition: vtkImplicitModeller.h:246
vtkImplicitModeller::AdjustBounds
vtkTypeBool AdjustBounds
Definition: vtkImplicitModeller.h:302
VTK_INT
#define VTK_INT
Definition: vtkType.h:54
vtkImageAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkImplicitModeller::SetOutputScalarTypeToInt
void SetOutputScalarTypeToInt()
Definition: vtkImplicitModeller.h:245
vtkImplicitModeller::BoundsComputed
int BoundsComputed
Definition: vtkImplicitModeller.h:310
vtkImplicitModeller::SetProcessModeToPerVoxel
void SetProcessModeToPerVoxel()
Definition: vtkImplicitModeller.h:215
vtkImplicitModeller::SetOutputScalarTypeToFloat
void SetOutputScalarTypeToFloat()
Definition: vtkImplicitModeller.h:243