VTK
vtkArrayCalculator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkArrayCalculator.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 =========================================================================*/
66 #ifndef vtkArrayCalculator_h
67 #define vtkArrayCalculator_h
68 
69 #include "vtkFiltersCoreModule.h" // For export macro
70 #include "vtkDataSetAlgorithm.h"
71 
72 class vtkFunctionParser;
73 
74 #define VTK_ATTRIBUTE_MODE_DEFAULT 0
75 #define VTK_ATTRIBUTE_MODE_USE_POINT_DATA 1
76 #define VTK_ATTRIBUTE_MODE_USE_CELL_DATA 2
77 #define VTK_ATTRIBUTE_MODE_USE_VERTEX_DATA 3
78 #define VTK_ATTRIBUTE_MODE_USE_EDGE_DATA 4
79 
81 {
82 public:
84  void PrintSelf(ostream& os, vtkIndent indent);
85 
86  static vtkArrayCalculator *New();
87 
89 
90  virtual void SetFunction(const char* function);
91  vtkGetStringMacro(Function);
93 
95 
100  void AddScalarArrayName(const char* arrayName, int component = 0);
101  void AddVectorArrayName(const char* arrayName, int component0 = 0,
102  int component1 = 1, int component2 = 2);
104 
106 
108  void AddScalarVariable(const char* variableName, const char* arrayName,
109  int component = 0);
110  void AddVectorVariable(const char* variableName, const char* arrayName,
111  int component0 = 0, int component1 = 1,
112  int component2 = 2);
114 
116 
118  void AddCoordinateScalarVariable(const char* variableName,
119  int component = 0);
120  void AddCoordinateVectorVariable(const char* variableName,
121  int component0 = 0, int component1 = 1,
122  int component2 = 2);
124 
126 
130  void SetResultArrayName(const char* name);
131  vtkGetStringMacro(ResultArrayName);
133 
135 
137  vtkGetMacro(ResultArrayType,int);
138  vtkSetMacro(ResultArrayType,int);
140 
142 
146  vtkGetMacro(CoordinateResults, int);
147  vtkSetMacro(CoordinateResults, int);
148  vtkBooleanMacro(CoordinateResults, int);
150 
152 
155  vtkGetMacro(ResultNormals, bool);
156  vtkSetMacro(ResultNormals, bool);
157  vtkBooleanMacro(ResultNormals, bool);
159 
161 
164  vtkGetMacro(ResultTCoords, bool);
165  vtkSetMacro(ResultTCoords, bool);
166  vtkBooleanMacro(ResultTCoords, bool);
168 
170 
177  vtkSetMacro(AttributeMode,int);
178  vtkGetMacro(AttributeMode,int);
180  {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_DEFAULT);};
182  {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_POINT_DATA);};
184  {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_CELL_DATA);};
186  {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_VERTEX_DATA);};
188  {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_EDGE_DATA);};
189  const char *GetAttributeModeAsString();
191 
193  void RemoveAllVariables();
194 
197  virtual void RemoveScalarVariables();
198 
201  virtual void RemoveVectorVariables();
202 
204  virtual void RemoveCoordinateScalarVariables();
205 
207  virtual void RemoveCoordinateVectorVariables();
208 
210 
211  char** GetScalarArrayNames() { return this->ScalarArrayNames; }
212  char* GetScalarArrayName(int i);
213  char** GetVectorArrayNames() { return this->VectorArrayNames; }
214  char* GetVectorArrayName(int i);
215  char** GetScalarVariableNames() { return this->ScalarVariableNames; }
216  char* GetScalarVariableName(int i);
217  char** GetVectorVariableNames() { return this->VectorVariableNames; }
218  char* GetVectorVariableName(int i);
219  int* GetSelectedScalarComponents() { return this->SelectedScalarComponents; }
220  int GetSelectedScalarComponent(int i);
221  int** GetSelectedVectorComponents() { return this->SelectedVectorComponents;}
222  int* GetSelectedVectorComponents(int i);
223  vtkGetMacro(NumberOfScalarArrays, int);
224  vtkGetMacro(NumberOfVectorArrays, int);
226 
228 
232  vtkSetMacro(ReplaceInvalidValues,int);
233  vtkGetMacro(ReplaceInvalidValues,int);
234  vtkBooleanMacro(ReplaceInvalidValues,int);
235  vtkSetMacro(ReplacementValue,double);
236  vtkGetMacro(ReplacementValue,double);
238 
239 protected:
242 
244 
245  char * Function;
257 
260 
270 
272 private:
273  vtkArrayCalculator(const vtkArrayCalculator&); // Not implemented.
274  void operator=(const vtkArrayCalculator&); // Not implemented.
275 };
276 
277 #endif
#define VTK_ATTRIBUTE_MODE_USE_VERTEX_DATA
int ** SelectedCoordinateVectorComponents
Store vtkAlgorithm input/output information.
perform mathematical operations on data in field data arrays
#define VTKFILTERSCORE_EXPORT
#define VTK_ATTRIBUTE_MODE_DEFAULT
vtkFunctionParser * FunctionParser
#define VTK_ATTRIBUTE_MODE_USE_EDGE_DATA
char ** CoordinateVectorVariableNames
void SetAttributeModeToUseVertexData()
Parse and evaluate a mathematical expression.
a simple class to control print indentation
Definition: vtkIndent.h:38
char ** GetVectorVariableNames()
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
#define VTK_ATTRIBUTE_MODE_USE_CELL_DATA
char ** GetScalarVariableNames()
#define VTK_ATTRIBUTE_MODE_USE_POINT_DATA
Store zero or more vtkInformation instances.
void PrintSelf(ostream &os, vtkIndent indent)
int * SelectedCoordinateScalarComponents
Superclass for algorithms that produce output of the same type as input.
int ** GetSelectedVectorComponents()
static vtkDataSetAlgorithm * New()
char ** CoordinateScalarVariableNames