VTK  9.5.20250903
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#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
55
56VTK_ABI_NAMESPACE_BEGIN
57class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkVectorNorm : public vtkDataSetAlgorithm
58{
59public:
61 void PrintSelf(ostream& os, vtkIndent indent) override;
62
66 static vtkVectorNorm* New();
67
68 // Specify whether to normalize scalar values. If the data is normalized,
69 // then it will fall in the range [0,1].
70 vtkSetMacro(Normalize, vtkTypeBool);
71 vtkGetMacro(Normalize, vtkTypeBool);
72 vtkBooleanMacro(Normalize, vtkTypeBool);
73
75
84 vtkSetMacro(AttributeMode, int);
85 vtkGetMacro(AttributeMode, int);
86 void SetAttributeModeToDefault() { this->SetAttributeMode(VTK_ATTRIBUTE_MODE_DEFAULT); }
88 {
89 this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_POINT_DATA);
90 }
94
95protected:
97 ~vtkVectorNorm() override = default;
98
100
101 vtkTypeBool Normalize; // normalize 0<=n<=1 if true.
102 int AttributeMode; // control whether to use point or cell data, or both
103
104private:
105 vtkVectorNorm(const vtkVectorNorm&) = delete;
106 void operator=(const vtkVectorNorm&) = delete;
107};
108
109VTK_ABI_NAMESPACE_END
110#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
#define VTK_MARSHALAUTO