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 "vtkDataSetAlgorithm.h"
70 
71 class vtkFunctionParser;
72 
73 #define VTK_ATTRIBUTE_MODE_DEFAULT 0
74 #define VTK_ATTRIBUTE_MODE_USE_POINT_DATA 1
75 #define VTK_ATTRIBUTE_MODE_USE_CELL_DATA 2
76 #define VTK_ATTRIBUTE_MODE_USE_VERTEX_DATA 3
77 #define VTK_ATTRIBUTE_MODE_USE_EDGE_DATA 4
78 
80 {
81 public:
83  void PrintSelf(ostream& os, vtkIndent indent);
84 
85  static vtkArrayCalculator *New();
86 
88 
89  virtual void SetFunction(const char* function);
90  vtkGetStringMacro(Function);
92 
94 
99  void AddScalarArrayName(const char* arrayName, int component = 0);
100  void AddVectorArrayName(const char* arrayName, int component0 = 0,
101  int component1 = 1, int component2 = 2);
103 
105 
107  void AddScalarVariable(const char* variableName, const char* arrayName,
108  int component = 0);
109  void AddVectorVariable(const char* variableName, const char* arrayName,
110  int component0 = 0, int component1 = 1,
111  int component2 = 2);
113 
115 
117  void AddCoordinateScalarVariable(const char* variableName,
118  int component = 0);
119  void AddCoordinateVectorVariable(const char* variableName,
120  int component0 = 0, int component1 = 1,
121  int component2 = 2);
123 
125 
129  void SetResultArrayName(const char* name);
130  vtkGetStringMacro(ResultArrayName);
132 
134 
136  vtkGetMacro(ResultArrayType,int);
137  vtkSetMacro(ResultArrayType,int);
139 
141 
145  vtkGetMacro(CoordinateResults, int);
146  vtkSetMacro(CoordinateResults, int);
147  vtkBooleanMacro(CoordinateResults, int);
149 
151 
158  vtkSetMacro(AttributeMode,int);
159  vtkGetMacro(AttributeMode,int);
160  void SetAttributeModeToDefault()
161  {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_DEFAULT);};
162  void SetAttributeModeToUsePointData()
163  {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_POINT_DATA);};
164  void SetAttributeModeToUseCellData()
165  {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_CELL_DATA);};
166  void SetAttributeModeToUseVertexData()
167  {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_VERTEX_DATA);};
168  void SetAttributeModeToUseEdgeData()
169  {this->SetAttributeMode(VTK_ATTRIBUTE_MODE_USE_EDGE_DATA);};
170  const char *GetAttributeModeAsString();
172 
174  void RemoveAllVariables();
175 
178  virtual void RemoveScalarVariables();
179 
182  virtual void RemoveVectorVariables();
183 
185  virtual void RemoveCoordinateScalarVariables();
186 
188  virtual void RemoveCoordinateVectorVariables();
189 
191 
192  char** GetScalarArrayNames() { return this->ScalarArrayNames; }
193  char* GetScalarArrayName(int i);
194  char** GetVectorArrayNames() { return this->VectorArrayNames; }
195  char* GetVectorArrayName(int i);
196  char** GetScalarVariableNames() { return this->ScalarVariableNames; }
197  char* GetScalarVariableName(int i);
198  char** GetVectorVariableNames() { return this->VectorVariableNames; }
199  char* GetVectorVariableName(int i);
200  int* GetSelectedScalarComponents() { return this->SelectedScalarComponents; }
201  int GetSelectedScalarComponent(int i);
202  int** GetSelectedVectorComponents() { return this->SelectedVectorComponents;}
203  int* GetSelectedVectorComponents(int i);
204  vtkGetMacro(NumberOfScalarArrays, int);
205  vtkGetMacro(NumberOfVectorArrays, int);
207 
209 
213  vtkSetMacro(ReplaceInvalidValues,int);
214  vtkGetMacro(ReplaceInvalidValues,int);
215  vtkBooleanMacro(ReplaceInvalidValues,int);
216  vtkSetMacro(ReplacementValue,double);
217  vtkGetMacro(ReplacementValue,double);
219 
220 protected:
223 
225 
226  char * Function;
238 
241 
249 
251 private:
252  vtkArrayCalculator(const vtkArrayCalculator&); // Not implemented.
253  void operator=(const vtkArrayCalculator&); // Not implemented.
254 };
255 
256 #endif