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
48class vtkDataArray;
49class vtkFloatArray;
50
51class VTKFILTERSCORE_EXPORT vtkVectorNorm : public vtkDataSetAlgorithm
52{
53public:
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);};
89
90protected:
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
99private:
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
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
Superclass for algorithms that produce output of the same type as input.
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:42
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
generate scalars from Euclidean norm of vectors
Definition: vtkVectorNorm.h:52
~vtkVectorNorm() override
Definition: vtkVectorNorm.h:92
void SetAttributeModeToUsePointData()
Definition: vtkVectorNorm.h:83
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
const char * GetAttributeModeAsString()
void SetAttributeModeToUseCellData()
Definition: vtkVectorNorm.h:85
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetAttributeModeToDefault()
Definition: vtkVectorNorm.h:81
static vtkVectorNorm * New()
Construct with normalize flag off.
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
int vtkIdType
Definition: vtkType.h:287
#define VTK_ATTRIBUTE_MODE_USE_POINT_DATA
Definition: vtkVectorNorm.h:42
#define VTK_ATTRIBUTE_MODE_DEFAULT
Definition: vtkVectorNorm.h:41
#define VTK_ATTRIBUTE_MODE_USE_CELL_DATA
Definition: vtkVectorNorm.h:43