VTK  9.1.0
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 =========================================================================*/
54 #ifndef vtkVectorNorm_h
55 #define vtkVectorNorm_h
56 
57 #define VTK_ATTRIBUTE_MODE_DEFAULT 0
58 #define VTK_ATTRIBUTE_MODE_USE_POINT_DATA 1
59 #define VTK_ATTRIBUTE_MODE_USE_CELL_DATA 2
60 
61 #include "vtkDataSetAlgorithm.h"
62 #include "vtkFiltersCoreModule.h" // For export macro
63 
64 class VTKFILTERSCORE_EXPORT vtkVectorNorm : public vtkDataSetAlgorithm
65 {
66 public:
68  void PrintSelf(ostream& os, vtkIndent indent) override;
69 
73  static vtkVectorNorm* New();
74 
75  // Specify whether to normalize scalar values. If the data is normalized,
76  // then it will fall in the range [0,1].
77  vtkSetMacro(Normalize, vtkTypeBool);
78  vtkGetMacro(Normalize, vtkTypeBool);
79  vtkBooleanMacro(Normalize, vtkTypeBool);
80 
82 
91  vtkSetMacro(AttributeMode, int);
92  vtkGetMacro(AttributeMode, int);
93  void SetAttributeModeToDefault() { this->SetAttributeMode(VTK_ATTRIBUTE_MODE_DEFAULT); }
95  {
96  this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_POINT_DATA);
97  }
99  const char* GetAttributeModeAsString();
101 
102 protected:
104  ~vtkVectorNorm() override = default;
105 
107 
108  vtkTypeBool Normalize; // normalize 0<=n<=1 if true.
109  int AttributeMode; // control whether to use point or cell data, or both
110 
111 private:
112  vtkVectorNorm(const vtkVectorNorm&) = delete;
113  void operator=(const vtkVectorNorm&) = delete;
114 };
115 
116 #endif
vtkVectorNorm::AttributeMode
int AttributeMode
Definition: vtkVectorNorm.h:109
vtkVectorNorm::SetAttributeModeToDefault
void SetAttributeModeToDefault()
Control how the filter works to generate scalar data from the input vector data.
Definition: vtkVectorNorm.h:93
VTK_ATTRIBUTE_MODE_USE_CELL_DATA
#define VTK_ATTRIBUTE_MODE_USE_CELL_DATA
Definition: vtkVectorNorm.h:59
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
VTK_ATTRIBUTE_MODE_USE_POINT_DATA
#define VTK_ATTRIBUTE_MODE_USE_POINT_DATA
Definition: vtkVectorNorm.h:58
vtkVectorNorm::SetAttributeModeToUseCellData
void SetAttributeModeToUseCellData()
Control how the filter works to generate scalar data from the input vector data.
Definition: vtkVectorNorm.h:98
vtkVectorNorm::~vtkVectorNorm
~vtkVectorNorm() override=default
vtkVectorNorm::SetAttributeModeToUsePointData
void SetAttributeModeToUsePointData()
Control how the filter works to generate scalar data from the input vector data.
Definition: vtkVectorNorm.h:94
vtkDataSetAlgorithm
Superclass for algorithms that produce output of the same type as input.
Definition: vtkDataSetAlgorithm.h:49
VTK_ATTRIBUTE_MODE_DEFAULT
#define VTK_ATTRIBUTE_MODE_DEFAULT
Definition: vtkVectorNorm.h:57
vtkVectorNorm::GetAttributeModeAsString
const char * GetAttributeModeAsString()
Control how the filter works to generate scalar data from the input vector data.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkVectorNorm::New
static vtkVectorNorm * New()
Construct with normalize flag off.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkDataSetAlgorithm.h
vtkVectorNorm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkVectorNorm::vtkVectorNorm
vtkVectorNorm()
vtkVectorNorm
generate scalars from Euclidean norm of vectors
Definition: vtkVectorNorm.h:65
vtkVectorNorm::Normalize
vtkTypeBool Normalize
Definition: vtkVectorNorm.h:108
vtkVectorNorm::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69