VTK  9.3.1
vtkVectorNorm.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
26 #ifndef vtkVectorNorm_h
27 #define vtkVectorNorm_h
28 
29 #define VTK_ATTRIBUTE_MODE_DEFAULT 0
30 #define VTK_ATTRIBUTE_MODE_USE_POINT_DATA 1
31 #define VTK_ATTRIBUTE_MODE_USE_CELL_DATA 2
32 
33 #include "vtkDataSetAlgorithm.h"
34 #include "vtkFiltersCoreModule.h" // For export macro
35 
36 VTK_ABI_NAMESPACE_BEGIN
37 class VTKFILTERSCORE_EXPORT vtkVectorNorm : public vtkDataSetAlgorithm
38 {
39 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
46  static vtkVectorNorm* New();
47 
48  // Specify whether to normalize scalar values. If the data is normalized,
49  // then it will fall in the range [0,1].
50  vtkSetMacro(Normalize, vtkTypeBool);
51  vtkGetMacro(Normalize, vtkTypeBool);
52  vtkBooleanMacro(Normalize, vtkTypeBool);
53 
55 
64  vtkSetMacro(AttributeMode, int);
65  vtkGetMacro(AttributeMode, int);
66  void SetAttributeModeToDefault() { this->SetAttributeMode(VTK_ATTRIBUTE_MODE_DEFAULT); }
68  {
69  this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_POINT_DATA);
70  }
72  const char* GetAttributeModeAsString();
74 
75 protected:
76  vtkVectorNorm();
77  ~vtkVectorNorm() override = default;
78 
80 
81  vtkTypeBool Normalize; // normalize 0<=n<=1 if true.
82  int AttributeMode; // control whether to use point or cell data, or both
83 
84 private:
85  vtkVectorNorm(const vtkVectorNorm&) = delete;
86  void operator=(const vtkVectorNorm&) = delete;
87 };
88 
89 VTK_ABI_NAMESPACE_END
90 #endif
void SetAttributeModeToUsePointData()
Control how the filter works to generate scalar data from the input vector data.
Definition: vtkVectorNorm.h:67
void SetAttributeModeToUseCellData()
Control how the filter works to generate scalar data from the input vector data.
Definition: vtkVectorNorm.h:71
Store vtkAlgorithm input/output information.
#define VTK_ATTRIBUTE_MODE_USE_CELL_DATA
Definition: vtkVectorNorm.h:31
#define VTK_ATTRIBUTE_MODE_USE_POINT_DATA
Definition: vtkVectorNorm.h:30
generate scalars from Euclidean norm of vectors
Definition: vtkVectorNorm.h:37
#define VTK_ATTRIBUTE_MODE_DEFAULT
Definition: vtkVectorNorm.h:29
int vtkTypeBool
Definition: vtkABI.h:64
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
Store zero or more vtkInformation instances.
vtkTypeBool Normalize
Definition: vtkVectorNorm.h:81
Superclass for algorithms that produce output of the same type as input.
static vtkDataSetAlgorithm * New()
void SetAttributeModeToDefault()
Control how the filter works to generate scalar data from the input vector data.
Definition: vtkVectorNorm.h:66