VTK  9.2.6
vtkVectorNorm.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkVectorNorm.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
57#ifndef vtkVectorNorm_h
58#define vtkVectorNorm_h
59
60#define VTK_ATTRIBUTE_MODE_DEFAULT 0
61#define VTK_ATTRIBUTE_MODE_USE_POINT_DATA 1
62#define VTK_ATTRIBUTE_MODE_USE_CELL_DATA 2
63
64#include "vtkDataSetAlgorithm.h"
65#include "vtkFiltersCoreModule.h" // For export macro
66
67class VTKFILTERSCORE_EXPORT vtkVectorNorm : public vtkDataSetAlgorithm
68{
69public:
71 void PrintSelf(ostream& os, vtkIndent indent) override;
72
76 static vtkVectorNorm* New();
77
78 // Specify whether to normalize scalar values. If the data is normalized,
79 // then it will fall in the range [0,1].
80 vtkSetMacro(Normalize, vtkTypeBool);
81 vtkGetMacro(Normalize, vtkTypeBool);
82 vtkBooleanMacro(Normalize, vtkTypeBool);
83
85
94 vtkSetMacro(AttributeMode, int);
95 vtkGetMacro(AttributeMode, int);
96 void SetAttributeModeToDefault() { this->SetAttributeMode(VTK_ATTRIBUTE_MODE_DEFAULT); }
98 {
99 this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_POINT_DATA);
100 }
104
105protected:
107 ~vtkVectorNorm() override = default;
108
110
111 vtkTypeBool Normalize; // normalize 0<=n<=1 if true.
112 int AttributeMode; // control whether to use point or cell data, or both
113
114private:
115 vtkVectorNorm(const vtkVectorNorm&) = delete;
116 void operator=(const vtkVectorNorm&) = delete;
117};
118
119#endif
Superclass for algorithms that produce output of the same type as input.
a simple class to control print indentation
Definition: vtkIndent.h:119
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
generate scalars from Euclidean norm of vectors
Definition: vtkVectorNorm.h:68
vtkTypeBool Normalize
void SetAttributeModeToUsePointData()
Control how the filter works to generate scalar data from the input vector data.
Definition: vtkVectorNorm.h:97
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.
Definition: vtkVectorNorm.h:96
static vtkVectorNorm * New()
Construct with normalize flag off.
~vtkVectorNorm() override=default
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_ATTRIBUTE_MODE_USE_POINT_DATA
Definition: vtkVectorNorm.h:61
#define VTK_ATTRIBUTE_MODE_DEFAULT
Definition: vtkVectorNorm.h:60
#define VTK_ATTRIBUTE_MODE_USE_CELL_DATA
Definition: vtkVectorNorm.h:62