VTK
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 =========================================================================*/
38 #ifndef vtkVectorNorm_h
39 #define vtkVectorNorm_h
40 
41 #define VTK_ATTRIBUTE_MODE_DEFAULT 0
42 #define VTK_ATTRIBUTE_MODE_USE_POINT_DATA 1
43 #define VTK_ATTRIBUTE_MODE_USE_CELL_DATA 2
44 
45 #include "vtkFiltersCoreModule.h" // For export macro
46 #include "vtkDataSetAlgorithm.h"
47 
48 class vtkDataArray;
49 class vtkFloatArray;
50 
51 class VTKFILTERSCORE_EXPORT vtkVectorNorm : public vtkDataSetAlgorithm
52 {
53 public:
55  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
56 
60  static vtkVectorNorm *New();
61 
62 
63  // Specify whether to normalize scalar values. If the data is normalized,
64  // then it will fall in the range [0,1].
65  vtkSetMacro(Normalize,int);
66  vtkGetMacro(Normalize,int);
67  vtkBooleanMacro(Normalize,int);
68 
70 
79  vtkSetMacro(AttributeMode,int);
80  vtkGetMacro(AttributeMode,int);
82  {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_DEFAULT);};
84  {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_POINT_DATA);};
86  {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_CELL_DATA);};
87  const char *GetAttributeModeAsString();
89 
90 protected:
92  ~vtkVectorNorm() VTK_OVERRIDE {}
93 
95 
96  int Normalize; // normalize 0<=n<=1 if true.
97  int AttributeMode; //control whether to use point or cell data, or both
98 
99 private:
100  vtkVectorNorm(const vtkVectorNorm&) VTK_DELETE_FUNCTION;
101  void operator=(const vtkVectorNorm&) VTK_DELETE_FUNCTION;
102 
103  // Helper function
104  void GenerateScalars(vtkIdType num, vtkDataArray *v, vtkFloatArray *s);
105 };
106 
107 #endif
vtkVectorNorm::AttributeMode
int AttributeMode
Definition: vtkVectorNorm.h:97
vtkVectorNorm::SetAttributeModeToDefault
void SetAttributeModeToDefault()
Definition: vtkVectorNorm.h:81
VTK_ATTRIBUTE_MODE_USE_CELL_DATA
#define VTK_ATTRIBUTE_MODE_USE_CELL_DATA
Definition: vtkVectorNorm.h:43
vtkIdType
int vtkIdType
Definition: vtkType.h:287
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:42
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
VTK_ATTRIBUTE_MODE_USE_POINT_DATA
#define VTK_ATTRIBUTE_MODE_USE_POINT_DATA
Definition: vtkVectorNorm.h:42
vtkVectorNorm::SetAttributeModeToUseCellData
void SetAttributeModeToUseCellData()
Definition: vtkVectorNorm.h:85
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkVectorNorm::Normalize
int Normalize
Definition: vtkVectorNorm.h:96
vtkVectorNorm::SetAttributeModeToUsePointData
void SetAttributeModeToUsePointData()
Definition: vtkVectorNorm.h:83
vtkDataSetAlgorithm
Superclass for algorithms that produce output of the same type as input.
Definition: vtkDataSetAlgorithm.h:52
VTK_ATTRIBUTE_MODE_DEFAULT
#define VTK_ATTRIBUTE_MODE_DEFAULT
Definition: vtkVectorNorm.h:41
vtkVectorNorm::GetAttributeModeAsString
const char * GetAttributeModeAsString()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkVectorNorm::New
static vtkVectorNorm * New()
Construct with normalize flag off.
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
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::~vtkVectorNorm
~vtkVectorNorm() override
Definition: vtkVectorNorm.h:92
vtkVectorNorm
generate scalars from Euclidean norm of vectors
Definition: vtkVectorNorm.h:52
vtkVectorNorm::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.