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 =========================================================================*/
37 #ifndef vtkVectorNorm_h
38 #define vtkVectorNorm_h
39 
40 #define VTK_ATTRIBUTE_MODE_DEFAULT 0
41 #define VTK_ATTRIBUTE_MODE_USE_POINT_DATA 1
42 #define VTK_ATTRIBUTE_MODE_USE_CELL_DATA 2
43 
44 #include "vtkFiltersCoreModule.h" // For export macro
45 #include "vtkDataSetAlgorithm.h"
46 
47 class vtkDataArray;
48 class vtkFloatArray;
49 
51 {
52 public:
54  void PrintSelf(ostream& os, vtkIndent indent);
55 
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 
73  vtkSetMacro(AttributeMode,int);
74  vtkGetMacro(AttributeMode,int);
76  {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_DEFAULT);};
78  {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_POINT_DATA);};
80  {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_CELL_DATA);};
81  const char *GetAttributeModeAsString();
83 
84 protected:
85  vtkVectorNorm();
87 
89 
90  int Normalize; // normalize 0<=n<=1 if true.
91  int AttributeMode; //control whether to use point or cell data, or both
92 
93 private:
94  vtkVectorNorm(const vtkVectorNorm&); // Not implemented.
95  void operator=(const vtkVectorNorm&); // Not implemented.
96 
97  // Helper function
98  void GenerateScalars(vtkIdType num, vtkDataArray *v, vtkFloatArray *s);
99 };
100 
101 #endif
void SetAttributeModeToUsePointData()
Definition: vtkVectorNorm.h:77
void SetAttributeModeToUseCellData()
Definition: vtkVectorNorm.h:79
Store vtkAlgorithm input/output information.
#define VTK_ATTRIBUTE_MODE_USE_CELL_DATA
Definition: vtkVectorNorm.h:42
#define VTK_ATTRIBUTE_MODE_USE_POINT_DATA
Definition: vtkVectorNorm.h:41
#define VTKFILTERSCORE_EXPORT
generate scalars from Euclidean norm of vectors
Definition: vtkVectorNorm.h:50
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:45
int vtkIdType
Definition: vtkType.h:247
#define VTK_ATTRIBUTE_MODE_DEFAULT
Definition: vtkVectorNorm.h:40
a simple class to control print indentation
Definition: vtkIndent.h:38
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Store zero or more vtkInformation instances.
void PrintSelf(ostream &os, vtkIndent indent)
Superclass for algorithms that produce output of the same type as input.
static vtkDataSetAlgorithm * New()
void SetAttributeModeToDefault()
Definition: vtkVectorNorm.h:75