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:
91  vtkVectorNorm();
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
void SetAttributeModeToUsePointData()
Control how the filter works to generate scalar data from the input vector data.
Definition: vtkVectorNorm.h:83
void SetAttributeModeToUseCellData()
Control how the filter works to generate scalar data from the input vector data.
Definition: vtkVectorNorm.h:85
Store vtkAlgorithm input/output information.
#define VTK_ATTRIBUTE_MODE_USE_CELL_DATA
Definition: vtkVectorNorm.h:43
#define VTK_ATTRIBUTE_MODE_USE_POINT_DATA
Definition: vtkVectorNorm.h:42
generate scalars from Euclidean norm of vectors
Definition: vtkVectorNorm.h:51
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:41
int vtkIdType
Definition: vtkType.h:287
#define VTK_ATTRIBUTE_MODE_DEFAULT
Definition: vtkVectorNorm.h:41
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:39
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
~vtkVectorNorm() override
Definition: vtkVectorNorm.h:92
Store zero or more vtkInformation instances.
Superclass for algorithms that produce output of the same type as input.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
static vtkDataSetAlgorithm * New()
void SetAttributeModeToDefault()
Control how the filter works to generate scalar data from the input vector data.
Definition: vtkVectorNorm.h:81