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 =========================================================================*/
93 #ifndef vtkImplicitModeller_h
94 #define vtkImplicitModeller_h
95 
96 #include "vtkFiltersHybridModule.h" // For export macro
97 #include "vtkImageAlgorithm.h"
98 
99 #define VTK_VOXEL_MODE 0
100 #define VTK_CELL_MODE 1
101 
102 class vtkDataArray;
103 class vtkExtractGeometry;
104 class vtkMultiThreader;
105 
106 class VTKFILTERSHYBRID_EXPORT vtkImplicitModeller : public vtkImageAlgorithm
107 {
108 public:
110  void PrintSelf(ostream& os, vtkIndent indent) override;
111 
117  static vtkImplicitModeller *New();
118 
123  double ComputeModelBounds(vtkDataSet *input = nullptr);
124 
126 
129  vtkGetVectorMacro(SampleDimensions,int,3);
130  void SetSampleDimensions(int i, int j, int k);
131  void SetSampleDimensions(int dim[3]);
133 
135 
141  vtkSetClampMacro(MaximumDistance,double,0.0,1.0);
142  vtkGetMacro(MaximumDistance,double);
144 
146 
150  vtkSetVector6Macro(ModelBounds,double);
151  vtkGetVectorMacro(ModelBounds,double,6);
153 
155 
161  vtkSetMacro(AdjustBounds,vtkTypeBool);
162  vtkGetMacro(AdjustBounds,vtkTypeBool);
163  vtkBooleanMacro(AdjustBounds,vtkTypeBool);
165 
167 
172  vtkSetClampMacro(AdjustDistance,double,-1.0,1.0);
173  vtkGetMacro(AdjustDistance,double);
175 
177 
181  vtkSetMacro(Capping,vtkTypeBool);
182  vtkGetMacro(Capping,vtkTypeBool);
183  vtkBooleanMacro(Capping,vtkTypeBool);
185 
187 
191  void SetCapValue(double value);
192  vtkGetMacro(CapValue,double);
194 
196 
206  vtkSetMacro(ScaleToMaximumDistance, vtkTypeBool);
207  vtkGetMacro(ScaleToMaximumDistance, vtkTypeBool);
208  vtkBooleanMacro(ScaleToMaximumDistance,vtkTypeBool);
210 
212 
219  vtkSetClampMacro(ProcessMode, int, 0, 1);
220  vtkGetMacro(ProcessMode, int);
221  void SetProcessModeToPerVoxel() {this->SetProcessMode(VTK_VOXEL_MODE);}
222  void SetProcessModeToPerCell() {this->SetProcessMode(VTK_CELL_MODE);}
223  const char *GetProcessModeAsString(void);
225 
227 
231  vtkSetMacro(LocatorMaxLevel,int);
232  vtkGetMacro(LocatorMaxLevel,int);
234 
236 
239  vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS );
240  vtkGetMacro( NumberOfThreads, int );
242 
244 
247  void SetOutputScalarType(int type);
248  vtkGetMacro(OutputScalarType,int);
249  void SetOutputScalarTypeToFloat(){this->SetOutputScalarType(VTK_FLOAT);};
250  void SetOutputScalarTypeToDouble(){this->SetOutputScalarType(VTK_DOUBLE);};
251  void SetOutputScalarTypeToInt(){this->SetOutputScalarType(VTK_INT);};
253  {this->SetOutputScalarType(VTK_UNSIGNED_INT);};
254  void SetOutputScalarTypeToLong(){this->SetOutputScalarType(VTK_LONG);};
256  {this->SetOutputScalarType(VTK_UNSIGNED_LONG);};
257  void SetOutputScalarTypeToShort(){this->SetOutputScalarType(VTK_SHORT);};
259  {this->SetOutputScalarType(VTK_UNSIGNED_SHORT);};
261  {this->SetOutputScalarType(VTK_UNSIGNED_CHAR);};
263  {this->SetOutputScalarType(VTK_CHAR);};
265 
272  void StartAppend();
273 
281  void Append(vtkDataSet *input);
282 
286  void EndAppend();
287 
288  // See the vtkAlgorithm for a description of what these do
291  vtkInformationVector*) override;
292 
293 protected:
295  ~vtkImplicitModeller() override;
296 
297  double GetScalarTypeMax(int type);
298 
301  vtkInformationVector *) override;
304 
305  void StartAppend(int internal);
306  void Cap(vtkDataArray *s);
307 
310 
311  int SampleDimensions[3];
313  double ModelBounds[6];
315  double CapValue;
323 
324  // flag to limit to one ComputeModelBounds per StartAppend
326 
327  // the max distance computed during that one call
329 
330  int FillInputPortInformation(int, vtkInformation*) override;
331 
332 private:
333  vtkImplicitModeller(const vtkImplicitModeller&) = delete;
334  void operator=(const vtkImplicitModeller&) = delete;
335 };
336 
337 #endif
338 
339 
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:255
vtkImplicitModeller::SetOutputScalarTypeToChar
void SetOutputScalarTypeToChar()
Definition: vtkImplicitModeller.h:262
vtkImplicitModeller::InternalMaxDistance
double InternalMaxDistance
Definition: vtkImplicitModeller.h:328
vtkX3D::value
Definition: vtkX3D.h:220
vtkX3D::type
Definition: vtkX3D.h:516
VTK_UNSIGNED_INT
#define VTK_UNSIGNED_INT
Definition: vtkType.h:55
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
VTK_UNSIGNED_SHORT
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:53
vtkImageAlgorithm.h
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkImageAlgorithm
Generic algorithm superclass for image algs.
Definition: vtkImageAlgorithm.h:40
vtkImplicitModeller::SetOutputScalarTypeToLong
void SetOutputScalarTypeToLong()
Definition: vtkImplicitModeller.h:254
vtkImplicitModeller::CapValue
double CapValue
Definition: vtkImplicitModeller.h:315
vtkExtractGeometry
extract cells that lie either entirely inside or outside of a specified implicit function
Definition: vtkExtractGeometry.h:52
vtkImplicitModeller::NumberOfThreads
int NumberOfThreads
Definition: vtkImplicitModeller.h:309
vtkMultiThreader
A class for performing multithreaded execution.
Definition: vtkMultiThreader.h:83
vtkImplicitModeller
compute distance from input geometry on structured point dataset
Definition: vtkImplicitModeller.h:106
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:39
vtkImplicitModeller::SetOutputScalarTypeToUnsignedShort
void SetOutputScalarTypeToUnsignedShort()
Definition: vtkImplicitModeller.h:258
vtkImplicitModeller::ProcessMode
int ProcessMode
Definition: vtkImplicitModeller.h:319
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:318
vtkImplicitModeller::DataAppended
int DataAppended
Definition: vtkImplicitModeller.h:316
vtkImplicitModeller::MaximumDistance
double MaximumDistance
Definition: vtkImplicitModeller.h:312
VTK_UNSIGNED_CHAR
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:51
vtkImageAlgorithm::ProcessRequest
int ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Process a request from the executive.
VTK_VOXEL_MODE
#define VTK_VOXEL_MODE
Definition: vtkImplicitModeller.h:99
VTK_LONG
#define VTK_LONG
Definition: vtkType.h:56
vtkImplicitModeller::OutputScalarType
int OutputScalarType
Definition: vtkImplicitModeller.h:321
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkImplicitModeller::ScaleToMaximumDistance
vtkTypeBool ScaleToMaximumDistance
Definition: vtkImplicitModeller.h:322
VTK_UNSIGNED_LONG
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:57
vtkImplicitModeller::SetOutputScalarTypeToDouble
void SetOutputScalarTypeToDouble()
Definition: vtkImplicitModeller.h:250
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
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:260
vtkImplicitModeller::LocatorMaxLevel
int LocatorMaxLevel
Definition: vtkImplicitModeller.h:320
vtkImplicitModeller::Threader
vtkMultiThreader * Threader
Definition: vtkImplicitModeller.h:308
vtkImplicitModeller::SetProcessModeToPerCell
void SetProcessModeToPerCell()
Definition: vtkImplicitModeller.h:222
vtkImplicitModeller::SetOutputScalarTypeToShort
void SetOutputScalarTypeToShort()
Definition: vtkImplicitModeller.h:257
vtkImplicitModeller::Capping
vtkTypeBool Capping
Definition: vtkImplicitModeller.h:314
VTK_CELL_MODE
#define VTK_CELL_MODE
Definition: vtkImplicitModeller.h:100
vtkImplicitModeller::SetOutputScalarTypeToUnsignedInt
void SetOutputScalarTypeToUnsignedInt()
Definition: vtkImplicitModeller.h:252
vtkImplicitModeller::AdjustBounds
vtkTypeBool AdjustBounds
Definition: vtkImplicitModeller.h:317
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:251
vtkImplicitModeller::BoundsComputed
int BoundsComputed
Definition: vtkImplicitModeller.h:325
vtkImplicitModeller::SetProcessModeToPerVoxel
void SetProcessModeToPerVoxel()
Definition: vtkImplicitModeller.h:221
vtkImplicitModeller::SetOutputScalarTypeToFloat
void SetOutputScalarTypeToFloat()
Definition: vtkImplicitModeller.h:249