VTK  9.3.1
vtkPointSmoothingFilter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
86 #ifndef vtkPointSmoothingFilter_h
87 #define vtkPointSmoothingFilter_h
88 
89 #include "vtkFiltersPointsModule.h" // For export macro
90 #include "vtkPointSetAlgorithm.h"
91 
92 VTK_ABI_NAMESPACE_BEGIN
94 class vtkDataArray;
95 class vtkPlane;
96 
97 class VTKFILTERSPOINTS_EXPORT vtkPointSmoothingFilter : public vtkPointSetAlgorithm
98 {
99 public:
101 
105  static vtkPointSmoothingFilter* New();
107  void PrintSelf(ostream& os, vtkIndent indent) override;
109 
111 
115  vtkSetClampMacro(NeighborhoodSize, int, 4, 128);
116  vtkGetMacro(NeighborhoodSize, int);
118 
122  enum
123  {
124  DEFAULT_SMOOTHING = 0,
129  FRAME_FIELD_SMOOTHING
130  };
131 
133 
143  vtkSetClampMacro(SmoothingMode, int, DEFAULT_SMOOTHING, FRAME_FIELD_SMOOTHING);
144  vtkGetMacro(SmoothingMode, int);
145  void SetSmoothingModeToDefault() { this->SetSmoothingMode(DEFAULT_SMOOTHING); }
146  void SetSmoothingModeToGeometric() { this->SetSmoothingMode(GEOMETRIC_SMOOTHING); }
147  void SetSmoothingModeToUniform() { this->SetSmoothingMode(UNIFORM_SMOOTHING); }
148  void SetSmoothingModeToScalars() { this->SetSmoothingMode(SCALAR_SMOOTHING); }
149  void SetSmoothingModeToTensors() { this->SetSmoothingMode(TENSOR_SMOOTHING); }
150  void SetSmoothingModeToFrameField() { this->SetSmoothingMode(FRAME_FIELD_SMOOTHING); }
152 
154 
158  virtual void SetFrameFieldArray(vtkDataArray*);
159  vtkGetObjectMacro(FrameFieldArray, vtkDataArray);
161 
163 
166  vtkSetClampMacro(NumberOfIterations, int, 0, VTK_INT_MAX);
167  vtkGetMacro(NumberOfIterations, int);
169 
171 
175  vtkSetClampMacro(NumberOfSubIterations, int, 1, VTK_INT_MAX);
176  vtkGetMacro(NumberOfSubIterations, int);
178 
180 
188  vtkSetClampMacro(MaximumStepSize, double, 0.0, VTK_DOUBLE_MAX);
189  vtkGetMacro(MaximumStepSize, double);
191 
193 
197  vtkSetClampMacro(Convergence, double, 0.0, 1.0);
198  vtkGetMacro(Convergence, double);
200 
202 
214  vtkSetMacro(EnableConstraints, bool);
215  vtkGetMacro(EnableConstraints, bool);
216  vtkBooleanMacro(EnableConstraints, bool);
217  vtkSetClampMacro(FixedAngle, double, 0, 90);
218  vtkGetMacro(FixedAngle, double);
219  vtkSetClampMacro(BoundaryAngle, double, 0, 120);
220  vtkGetMacro(BoundaryAngle, double);
222 
224 
228  vtkSetMacro(GenerateConstraintScalars, bool);
229  vtkGetMacro(GenerateConstraintScalars, bool);
230  vtkBooleanMacro(GenerateConstraintScalars, bool);
232 
234 
238  vtkSetMacro(GenerateConstraintNormals, bool);
239  vtkGetMacro(GenerateConstraintNormals, bool);
240  vtkBooleanMacro(GenerateConstraintNormals, bool);
242 
244 
250  vtkSetMacro(ComputePackingRadius, bool);
251  vtkGetMacro(ComputePackingRadius, bool);
252  vtkBooleanMacro(ComputePackingRadius, bool);
254 
256 
266  vtkSetClampMacro(PackingRadius, double, 0.0, VTK_DOUBLE_MAX);
267  vtkGetMacro(PackingRadius, double);
269 
271 
280  vtkSetClampMacro(PackingFactor, double, 0.1, 10.0);
281  vtkGetMacro(PackingFactor, double);
283 
285 
292  vtkSetClampMacro(AttractionFactor, double, 0.1, 10.0);
293  vtkGetMacro(AttractionFactor, double);
295 
299  enum
300  {
301  UNCONSTRAINED_MOTION = 0,
302  PLANE_MOTION
303  };
304 
306 
311  vtkSetMacro(MotionConstraint, int);
312  vtkGetMacro(MotionConstraint, int);
313  void SetMotionConstraintToUnconstrained() { this->SetMotionConstraint(UNCONSTRAINED_MOTION); }
314  void SetMotionConstraintToPlane() { this->SetMotionConstraint(PLANE_MOTION); }
316 
318 
322  void SetPlane(vtkPlane*);
323  vtkGetObjectMacro(Plane, vtkPlane);
325 
327 
332  void SetLocator(vtkAbstractPointLocator* locator);
333  vtkGetObjectMacro(Locator, vtkAbstractPointLocator);
335 
336 protected:
338  ~vtkPointSmoothingFilter() override;
339 
340  // Control the smoothing
346  double Convergence;
348 
349  // Support the algorithm
351 
352  // Constraints
354  double FixedAngle;
358 
359  // Packing radius and related
364 
365  // Motion constraints
368 
369  // Pipeline support
371  int FillInputPortInformation(int port, vtkInformation* info) override;
372 
373 private:
375  void operator=(const vtkPointSmoothingFilter&) = delete;
376 };
377 
378 VTK_ABI_NAMESPACE_END
379 #endif
void SetSmoothingModeToUniform()
Control how smoothing is to be performed.
#define VTK_DOUBLE_MAX
Definition: vtkType.h:154
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
Store vtkAlgorithm input/output information.
#define VTK_INT_MAX
Definition: vtkType.h:144
void SetSmoothingModeToDefault()
Control how smoothing is to be performed.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetSmoothingModeToScalars()
Control how smoothing is to be performed.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
void SetMotionConstraintToUnconstrained()
Specify how to constrain the motion of points.
void SetSmoothingModeToGeometric()
Control how smoothing is to be performed.
a simple class to control print indentation
Definition: vtkIndent.h:28
void SetSmoothingModeToTensors()
Control how smoothing is to be performed.
abstract class to quickly locate points in 3-space
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
Superclass for algorithms that produce output of the same type as input.
perform various plane computations
Definition: vtkPlane.h:25
adjust point positions to form a pleasing, packed arrangement
static vtkPointSetAlgorithm * New()
Store zero or more vtkInformation instances.
void SetMotionConstraintToPlane()
Specify how to constrain the motion of points.
void SetSmoothingModeToFrameField()
Control how smoothing is to be performed.
vtkAbstractPointLocator * Locator