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 =========================================================================*/
35 #ifndef vtkVectorNorm_h
36 #define vtkVectorNorm_h
37 
38 #define VTK_ATTRIBUTE_MODE_DEFAULT 0
39 #define VTK_ATTRIBUTE_MODE_USE_POINT_DATA 1
40 #define VTK_ATTRIBUTE_MODE_USE_CELL_DATA 2
41 
42 #include "vtkFiltersCoreModule.h" // For export macro
43 #include "vtkDataSetAlgorithm.h"
44 
45 class vtkDataArray;
46 class vtkFloatArray;
47 
48 class VTKFILTERSCORE_EXPORT vtkVectorNorm : public vtkDataSetAlgorithm
49 {
50 public:
52  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
53 
57  static vtkVectorNorm *New();
58 
59 
60  // Specify whether to normalize scalar values. If the data is normalized,
61  // then it will fall in the range [0,1].
62  vtkSetMacro(Normalize,int);
63  vtkGetMacro(Normalize,int);
64  vtkBooleanMacro(Normalize,int);
65 
67 
76  vtkSetMacro(AttributeMode,int);
77  vtkGetMacro(AttributeMode,int);
79  {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_DEFAULT);};
81  {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_POINT_DATA);};
83  {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_CELL_DATA);};
84  const char *GetAttributeModeAsString();
86 
87 protected:
88  vtkVectorNorm();
89  ~vtkVectorNorm() VTK_OVERRIDE {}
90 
92 
93  int Normalize; // normalize 0<=n<=1 if true.
94  int AttributeMode; //control whether to use point or cell data, or both
95 
96 private:
97  vtkVectorNorm(const vtkVectorNorm&) VTK_DELETE_FUNCTION;
98  void operator=(const vtkVectorNorm&) VTK_DELETE_FUNCTION;
99 
100  // Helper function
101  void GenerateScalars(vtkIdType num, vtkDataArray *v, vtkFloatArray *s);
102 };
103 
104 #endif
void SetAttributeModeToUsePointData()
Control how the filter works to generate scalar data from the input vector data.
Definition: vtkVectorNorm.h:80
void SetAttributeModeToUseCellData()
Control how the filter works to generate scalar data from the input vector data.
Definition: vtkVectorNorm.h:82
Store vtkAlgorithm input/output information.
#define VTK_ATTRIBUTE_MODE_USE_CELL_DATA
Definition: vtkVectorNorm.h:40
#define VTK_ATTRIBUTE_MODE_USE_POINT_DATA
Definition: vtkVectorNorm.h:39
generate scalars from Euclidean norm of vectors
Definition: vtkVectorNorm.h:48
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:35
int vtkIdType
Definition: vtkType.h:345
#define VTK_ATTRIBUTE_MODE_DEFAULT
Definition: vtkVectorNorm.h:38
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:33
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
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:89
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:78