VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
36 
37 VTK_ABI_NAMESPACE_BEGIN
38 class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkVectorNorm : public vtkDataSetAlgorithm
39 {
40 public:
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
47  static vtkVectorNorm* New();
48 
49  // Specify whether to normalize scalar values. If the data is normalized,
50  // then it will fall in the range [0,1].
51  vtkSetMacro(Normalize, vtkTypeBool);
52  vtkGetMacro(Normalize, vtkTypeBool);
53  vtkBooleanMacro(Normalize, vtkTypeBool);
54 
56 
65  vtkSetMacro(AttributeMode, int);
66  vtkGetMacro(AttributeMode, int);
67  void SetAttributeModeToDefault() { this->SetAttributeMode(VTK_ATTRIBUTE_MODE_DEFAULT); }
69  {
70  this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_POINT_DATA);
71  }
73  const char* GetAttributeModeAsString();
75 
76 protected:
77  vtkVectorNorm();
78  ~vtkVectorNorm() override = default;
79 
81 
82  vtkTypeBool Normalize; // normalize 0<=n<=1 if true.
83  int AttributeMode; // control whether to use point or cell data, or both
84 
85 private:
86  vtkVectorNorm(const vtkVectorNorm&) = delete;
87  void operator=(const vtkVectorNorm&) = delete;
88 };
89 
90 VTK_ABI_NAMESPACE_END
91 #endif
void SetAttributeModeToUsePointData()
Control how the filter works to generate scalar data from the input vector data.
Definition: vtkVectorNorm.h:68
void SetAttributeModeToUseCellData()
Control how the filter works to generate scalar data from the input vector data.
Definition: vtkVectorNorm.h:72
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:38
#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.
#define VTK_MARSHALAUTO
vtkTypeBool Normalize
Definition: vtkVectorNorm.h:82
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:67