VTK  9.3.0
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
36VTK_ABI_NAMESPACE_BEGIN
37class VTKFILTERSCORE_EXPORT vtkVectorNorm : public vtkDataSetAlgorithm
38{
39public:
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 }
74
75protected:
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
84private:
85 vtkVectorNorm(const vtkVectorNorm&) = delete;
86 void operator=(const vtkVectorNorm&) = delete;
87};
88
89VTK_ABI_NAMESPACE_END
90#endif
Superclass for algorithms that produce output of the same type as input.
a simple class to control print indentation
Definition vtkIndent.h:29
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