VTK  9.3.20240327
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
45 #ifndef vtkVectorNorm_h
46 #define vtkVectorNorm_h
47 
48 #define VTK_ATTRIBUTE_MODE_DEFAULT 0
49 #define VTK_ATTRIBUTE_MODE_USE_POINT_DATA 1
50 #define VTK_ATTRIBUTE_MODE_USE_CELL_DATA 2
51 
52 #include "vtkDataSetAlgorithm.h"
53 #include "vtkFiltersCoreModule.h" // For export macro
54 
55 VTK_ABI_NAMESPACE_BEGIN
56 class VTKFILTERSCORE_EXPORT vtkVectorNorm : public vtkDataSetAlgorithm
57 {
58 public:
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
65  static vtkVectorNorm* New();
66 
67  // Specify whether to normalize scalar values. If the data is normalized,
68  // then it will fall in the range [0,1].
69  vtkSetMacro(Normalize, vtkTypeBool);
70  vtkGetMacro(Normalize, vtkTypeBool);
71  vtkBooleanMacro(Normalize, vtkTypeBool);
72 
74 
83  vtkSetMacro(AttributeMode, int);
84  vtkGetMacro(AttributeMode, int);
85  void SetAttributeModeToDefault() { this->SetAttributeMode(VTK_ATTRIBUTE_MODE_DEFAULT); }
87  {
88  this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_POINT_DATA);
89  }
91  const char* GetAttributeModeAsString();
93 
94 protected:
96  ~vtkVectorNorm() override = default;
97 
99 
100  vtkTypeBool Normalize; // normalize 0<=n<=1 if true.
101  int AttributeMode; // control whether to use point or cell data, or both
102 
103 private:
104  vtkVectorNorm(const vtkVectorNorm&) = delete;
105  void operator=(const vtkVectorNorm&) = delete;
106 };
107 
108 VTK_ABI_NAMESPACE_END
109 #endif
Superclass for algorithms that produce output of the same type as input.
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
generate scalars from Euclidean norm of vectors
Definition: vtkVectorNorm.h:57
vtkTypeBool Normalize
void SetAttributeModeToUsePointData()
Control how the filter works to generate scalar data from the input vector data.
Definition: vtkVectorNorm.h:86
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
static vtkVectorNorm * New()
Construct with normalize flag off.
void SetAttributeModeToUseCellData()
Control how the filter works to generate scalar data from the input vector data.
Definition: vtkVectorNorm.h:90
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetAttributeModeToDefault()
Control how the filter works to generate scalar data from the input vector data.
Definition: vtkVectorNorm.h:85
const char * GetAttributeModeAsString()
Control how the filter works to generate scalar data from the input vector data.
~vtkVectorNorm() override=default
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_ATTRIBUTE_MODE_USE_POINT_DATA
Definition: vtkVectorNorm.h:49
#define VTK_ATTRIBUTE_MODE_DEFAULT
Definition: vtkVectorNorm.h:48
#define VTK_ATTRIBUTE_MODE_USE_CELL_DATA
Definition: vtkVectorNorm.h:50