VTK  9.3.20240423
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
55VTK_ABI_NAMESPACE_BEGIN
56class VTKFILTERSCORE_EXPORT vtkVectorNorm : public vtkDataSetAlgorithm
57{
58public:
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 }
93
94protected:
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
103private:
104 vtkVectorNorm(const vtkVectorNorm&) = delete;
105 void operator=(const vtkVectorNorm&) = delete;
106};
107
108VTK_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
vtkTypeBool Normalize
void SetAttributeModeToUsePointData()
Control how the filter works to generate scalar data from the input vector data.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
const char * GetAttributeModeAsString()
Control how the filter works to generate scalar data from the input vector data.
void SetAttributeModeToUseCellData()
Control how the filter works to generate scalar data from the input vector data.
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.
static vtkVectorNorm * New()
Construct with normalize flag off.
~vtkVectorNorm() override=default
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_ATTRIBUTE_MODE_USE_POINT_DATA
#define VTK_ATTRIBUTE_MODE_DEFAULT
#define VTK_ATTRIBUTE_MODE_USE_CELL_DATA