VTK  9.1.0
vtkPointSmoothingFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPointSmoothingFilter.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 =========================================================================*/
95 #ifndef vtkPointSmoothingFilter_h
96 #define vtkPointSmoothingFilter_h
97 
98 #include "vtkFiltersPointsModule.h" // For export macro
99 #include "vtkPointSetAlgorithm.h"
100 
102 class vtkDataArray;
103 class vtkPlane;
104 
105 class VTKFILTERSPOINTS_EXPORT vtkPointSmoothingFilter : public vtkPointSetAlgorithm
106 {
107 public:
109 
115  void PrintSelf(ostream& os, vtkIndent indent) override;
117 
119 
123  vtkSetClampMacro(NeighborhoodSize, int, 4, 128);
124  vtkGetMacro(NeighborhoodSize, int);
126 
130  enum
131  {
132  DEFAULT_SMOOTHING = 0,
137  FRAME_FIELD_SMOOTHING
138  };
139 
141 
151  vtkSetClampMacro(SmoothingMode, int, DEFAULT_SMOOTHING, FRAME_FIELD_SMOOTHING);
152  vtkGetMacro(SmoothingMode, int);
153  void SetSmoothingModeToDefault() { this->SetSmoothingMode(DEFAULT_SMOOTHING); }
154  void SetSmoothingModeToGeometric() { this->SetSmoothingMode(GEOMETRIC_SMOOTHING); }
155  void SetSmoothingModeToUniform() { this->SetSmoothingMode(UNIFORM_SMOOTHING); }
156  void SetSmoothingModeToScalars() { this->SetSmoothingMode(SCALAR_SMOOTHING); }
157  void SetSmoothingModeToTensors() { this->SetSmoothingMode(TENSOR_SMOOTHING); }
158  void SetSmoothingModeToFrameField() { this->SetSmoothingMode(FRAME_FIELD_SMOOTHING); }
160 
162 
167  vtkGetObjectMacro(FrameFieldArray, vtkDataArray);
169 
171 
174  vtkSetClampMacro(NumberOfIterations, int, 0, VTK_INT_MAX);
175  vtkGetMacro(NumberOfIterations, int);
177 
179 
183  vtkSetClampMacro(NumberOfSubIterations, int, 1, VTK_INT_MAX);
184  vtkGetMacro(NumberOfSubIterations, int);
186 
188 
196  vtkSetClampMacro(MaximumStepSize, double, 0.0, VTK_DOUBLE_MAX);
197  vtkGetMacro(MaximumStepSize, double);
199 
201 
205  vtkSetClampMacro(Convergence, double, 0.0, 1.0);
206  vtkGetMacro(Convergence, double);
208 
210 
222  vtkSetMacro(EnableConstraints, bool);
223  vtkGetMacro(EnableConstraints, bool);
224  vtkBooleanMacro(EnableConstraints, bool);
225  vtkSetClampMacro(FixedAngle, double, 0, 90);
226  vtkGetMacro(FixedAngle, double);
227  vtkSetClampMacro(BoundaryAngle, double, 0, 120);
228  vtkGetMacro(BoundaryAngle, double);
230 
232 
236  vtkSetMacro(GenerateConstraintScalars, bool);
237  vtkGetMacro(GenerateConstraintScalars, bool);
238  vtkBooleanMacro(GenerateConstraintScalars, bool);
240 
242 
246  vtkSetMacro(GenerateConstraintNormals, bool);
247  vtkGetMacro(GenerateConstraintNormals, bool);
248  vtkBooleanMacro(GenerateConstraintNormals, bool);
250 
252 
258  vtkSetMacro(ComputePackingRadius, bool);
259  vtkGetMacro(ComputePackingRadius, bool);
260  vtkBooleanMacro(ComputePackingRadius, bool);
262 
264 
274  vtkSetClampMacro(PackingRadius, double, 0.0, VTK_DOUBLE_MAX);
275  vtkGetMacro(PackingRadius, double);
277 
279 
288  vtkSetClampMacro(PackingFactor, double, 0.1, 10.0);
289  vtkGetMacro(PackingFactor, double);
291 
293 
300  vtkSetClampMacro(AttractionFactor, double, 0.1, 10.0);
301  vtkGetMacro(AttractionFactor, double);
303 
307  enum
308  {
309  UNCONSTRAINED_MOTION = 0,
310  PLANE_MOTION
311  };
312 
314 
319  vtkSetMacro(MotionConstraint, int);
320  vtkGetMacro(MotionConstraint, int);
321  void SetMotionConstraintToUnconstrained() { this->SetMotionConstraint(UNCONSTRAINED_MOTION); }
322  void SetMotionConstraintToPlane() { this->SetMotionConstraint(PLANE_MOTION); }
324 
326 
331  vtkGetObjectMacro(Plane, vtkPlane);
333 
335 
341  vtkGetObjectMacro(Locator, vtkAbstractPointLocator);
343 
344 protected:
347 
348  // Control the smoothing
354  double Convergence;
356 
357  // Support the algorithm
359 
360  // Constraints
362  double FixedAngle;
366 
367  // Packing radius and related
372 
373  // Motion constraints
376 
377  // Pipeline support
380 
381 private:
383  void operator=(const vtkPointSmoothingFilter&) = delete;
384 };
385 
386 #endif
vtkPointSmoothingFilter::SetPlane
void SetPlane(vtkPlane *)
Specify the plane to which point motion is constrained.
vtkPointSmoothingFilter::NumberOfSubIterations
int NumberOfSubIterations
Definition: vtkPointSmoothingFilter.h:352
vtkPointSmoothingFilter::ComputePackingRadius
bool ComputePackingRadius
Definition: vtkPointSmoothingFilter.h:368
vtkPointSmoothingFilter::PackingFactor
double PackingFactor
Definition: vtkPointSmoothingFilter.h:370
vtkPointSmoothingFilter::SetSmoothingModeToUniform
void SetSmoothingModeToUniform()
Control how smoothing is to be performed.
Definition: vtkPointSmoothingFilter.h:155
vtkPointSmoothingFilter::Locator
vtkAbstractPointLocator * Locator
Definition: vtkPointSmoothingFilter.h:358
vtkPlane
perform various plane computations
Definition: vtkPlane.h:143
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:155
vtkPointSmoothingFilter::Convergence
double Convergence
Definition: vtkPointSmoothingFilter.h:354
vtkPointSmoothingFilter::PackingRadius
double PackingRadius
Definition: vtkPointSmoothingFilter.h:369
vtkPointSmoothingFilter::GenerateConstraintNormals
bool GenerateConstraintNormals
Definition: vtkPointSmoothingFilter.h:365
vtkPointSmoothingFilter::MotionConstraint
int MotionConstraint
Definition: vtkPointSmoothingFilter.h:374
vtkPointSetAlgorithm
Superclass for algorithms that produce output of the same type as input.
Definition: vtkPointSetAlgorithm.h:44
vtkPointSmoothingFilter
adjust point positions to form a pleasing, packed arrangement
Definition: vtkPointSmoothingFilter.h:106
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkPointSetAlgorithm.h
vtkPointSmoothingFilter::BoundaryAngle
double BoundaryAngle
Definition: vtkPointSmoothingFilter.h:363
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:159
vtkPointSmoothingFilter::SetSmoothingModeToDefault
void SetSmoothingModeToDefault()
Control how smoothing is to be performed.
Definition: vtkPointSmoothingFilter.h:153
vtkPointSmoothingFilter::UNIFORM_SMOOTHING
@ UNIFORM_SMOOTHING
Definition: vtkPointSmoothingFilter.h:134
vtkPointSmoothingFilter::SetSmoothingModeToScalars
void SetSmoothingModeToScalars()
Control how smoothing is to be performed.
Definition: vtkPointSmoothingFilter.h:156
vtkPointSmoothingFilter::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkPointSmoothingFilter::SmoothingMode
int SmoothingMode
Definition: vtkPointSmoothingFilter.h:350
vtkPointSmoothingFilter::SetFrameFieldArray
virtual void SetFrameFieldArray(vtkDataArray *)
Specify the name of the frame field to use for smoothing.
vtkPointSmoothingFilter::NeighborhoodSize
int NeighborhoodSize
Definition: vtkPointSmoothingFilter.h:349
vtkPointSmoothingFilter::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkPointSmoothingFilter::FrameFieldArray
vtkDataArray * FrameFieldArray
Definition: vtkPointSmoothingFilter.h:355
vtkPointSmoothingFilter::SetSmoothingModeToGeometric
void SetSmoothingModeToGeometric()
Control how smoothing is to be performed.
Definition: vtkPointSmoothingFilter.h:154
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkPointSmoothingFilter::SetMotionConstraintToUnconstrained
void SetMotionConstraintToUnconstrained()
Specify how to constrain the motion of points.
Definition: vtkPointSmoothingFilter.h:321
vtkPointSmoothingFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instantiation, obtaining type information, and printing information.
vtkPointSmoothingFilter::EnableConstraints
bool EnableConstraints
Definition: vtkPointSmoothingFilter.h:361
vtkPointSmoothingFilter::GEOMETRIC_SMOOTHING
@ GEOMETRIC_SMOOTHING
Definition: vtkPointSmoothingFilter.h:133
vtkPointSmoothingFilter::GenerateConstraintScalars
bool GenerateConstraintScalars
Definition: vtkPointSmoothingFilter.h:364
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkPointSmoothingFilter::SetSmoothingModeToTensors
void SetSmoothingModeToTensors()
Control how smoothing is to be performed.
Definition: vtkPointSmoothingFilter.h:157
vtkPointSmoothingFilter::NumberOfIterations
int NumberOfIterations
Definition: vtkPointSmoothingFilter.h:351
vtkPointSmoothingFilter::TENSOR_SMOOTHING
@ TENSOR_SMOOTHING
Definition: vtkPointSmoothingFilter.h:136
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkPointSmoothingFilter::New
static vtkPointSmoothingFilter * New()
Standard methods for instantiation, obtaining type information, and printing information.
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkPointSmoothingFilter::FixedAngle
double FixedAngle
Definition: vtkPointSmoothingFilter.h:362
vtkPointSmoothingFilter::AttractionFactor
double AttractionFactor
Definition: vtkPointSmoothingFilter.h:371
vtkPointSmoothingFilter::SetMotionConstraintToPlane
void SetMotionConstraintToPlane()
Specify how to constrain the motion of points.
Definition: vtkPointSmoothingFilter.h:322
vtkPointSmoothingFilter::SetLocator
void SetLocator(vtkAbstractPointLocator *locator)
Specify a point locator.
vtkAbstractPointLocator
abstract class to quickly locate points in 3-space
Definition: vtkAbstractPointLocator.h:39
vtkPointSmoothingFilter::vtkPointSmoothingFilter
vtkPointSmoothingFilter()
vtkPointSmoothingFilter::SetSmoothingModeToFrameField
void SetSmoothingModeToFrameField()
Control how smoothing is to be performed.
Definition: vtkPointSmoothingFilter.h:158
vtkPointSmoothingFilter::SCALAR_SMOOTHING
@ SCALAR_SMOOTHING
Definition: vtkPointSmoothingFilter.h:135
vtkPointSmoothingFilter::MaximumStepSize
double MaximumStepSize
Definition: vtkPointSmoothingFilter.h:353
vtkPointSmoothingFilter::Plane
vtkPlane * Plane
Definition: vtkPointSmoothingFilter.h:375
VTK_DOUBLE_MAX
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165
vtkPointSmoothingFilter::~vtkPointSmoothingFilter
~vtkPointSmoothingFilter() override