VTK
vtkFieldDataToAttributeDataFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkFieldDataToAttributeDataFilter.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 =========================================================================*/
57 #ifndef vtkFieldDataToAttributeDataFilter_h
58 #define vtkFieldDataToAttributeDataFilter_h
59 
60 #include "vtkFiltersCoreModule.h" // For export macro
61 #include "vtkDataSetAlgorithm.h"
62 
63 #define VTK_DATA_OBJECT_FIELD 0
64 #define VTK_POINT_DATA_FIELD 1
65 #define VTK_CELL_DATA_FIELD 2
66 
67 #define VTK_CELL_DATA 0
68 #define VTK_POINT_DATA 1
69 
70 class vtkDataArray;
72 class vtkFieldData;
73 
75 {
76 public:
77  void PrintSelf(ostream& os, vtkIndent indent);
79 
83 
85 
89  vtkSetMacro(InputField,int);
90  vtkGetMacro(InputField,int);
92  {this->SetInputField(VTK_DATA_OBJECT_FIELD);};
94  {this->SetInputField(VTK_POINT_DATA_FIELD);};
96  {this->SetInputField(VTK_CELL_DATA_FIELD);};
98 
100 
102  vtkSetMacro(OutputAttributeData,int);
103  vtkGetMacro(OutputAttributeData,int);
105  {this->SetOutputAttributeData(VTK_CELL_DATA);};
107  {this->SetOutputAttributeData(VTK_POINT_DATA);};
109 
111 
116  void SetScalarComponent(int comp, const char *arrayName, int arrayComp,
117  int min, int max, int normalize);
118  void SetScalarComponent(int comp, const char *arrayName, int arrayComp)
119  {this->SetScalarComponent(comp, arrayName, arrayComp, -1, -1, this->DefaultNormalize);};
120  const char *GetScalarComponentArrayName(int comp);
126 
128 
133  void SetVectorComponent(int comp, const char *arrayName, int arrayComp,
134  int min, int max, int normalize);
135  void SetVectorComponent(int comp, const char *arrayName, int arrayComp)
136  {this->SetVectorComponent(comp, arrayName, arrayComp, -1, -1, this->DefaultNormalize);};
137  const char *GetVectorComponentArrayName(int comp);
143 
145 
150  void SetNormalComponent(int comp, const char *arrayName, int arrayComp,
151  int min, int max, int normalize);
152  void SetNormalComponent(int comp, const char *arrayName, int arrayComp)
153  {this->SetNormalComponent(comp, arrayName, arrayComp, -1, -1, this->DefaultNormalize);};
154  const char *GetNormalComponentArrayName(int comp);
160 
162 
167  void SetTensorComponent(int comp, const char *arrayName, int arrayComp,
168  int min, int max, int normalize);
169  void SetTensorComponent(int comp, const char *arrayName, int arrayComp)
170  {this->SetTensorComponent(comp, arrayName, arrayComp, -1, -1, this->DefaultNormalize);};
171  const char *GetTensorComponentArrayName(int comp);
177 
179 
184  void SetTCoordComponent(int comp, const char *arrayName, int arrayComp,
185  int min, int max, int normalize);
186  void SetTCoordComponent(int comp, const char *arrayName, int arrayComp)
187  {this->SetTCoordComponent(comp, arrayName, arrayComp, -1, -1, this->DefaultNormalize);};
188  const char *GetTCoordComponentArrayName(int comp);
194 
196 
198  vtkSetMacro(DefaultNormalize,int);
199  vtkGetMacro(DefaultNormalize,int);
200  vtkBooleanMacro(DefaultNormalize,int);
202 
203  // Helper functions, made public to support other classes
204 
208  static int GetComponentsType(int numComp, vtkDataArray **arrays);
209 
211 
215  static int ConstructArray(vtkDataArray *da, int comp, vtkDataArray *frray,
216  int fieldComp, vtkIdType min, vtkIdType max,
217  int normalize);
219 
222  static vtkDataArray *GetFieldArray(vtkFieldData *fd, char *name, int comp);
223 
225  static void SetArrayName(vtkObject *self, char* &name, const char *newName);
226 
227 //BTX
229 
231  static int UpdateComponentRange(vtkDataArray *da, vtkIdType compRange[2]);
232 //ETX
234 
237 
238 protected:
241 
242  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); //generate output data
243 
246 
247  int NumberOfScalarComponents; //the number of components to fill-in
248  char *ScalarArrays[4]; //the name of the arrays used to construct the scalar
249  int ScalarArrayComponents[4]; //the components of the arrays used to construct
250  vtkIdType ScalarComponentRange[4][2]; //the range of the components to use
251  int ScalarNormalize[4]; //flags control normalization
252 
253  char *VectorArrays[3]; //the name of the arrays used to construct the vectors
254  int VectorArrayComponents[3]; //the components of the arrays used to construct
255  vtkIdType VectorComponentRange[3][2]; //the range of the components to use
256  int VectorNormalize[3]; //flags control normalization
257 
258  char *GhostLevelArray; //the name of the array used to construct the ghost levels
259  int GhostLevelArrayComponent; //the component of the array used to construct
260  vtkIdType GhostLevelComponentRange[2]; //the range of the components to use
261  int GhostLevelNormalize; //flags control normalization
262 
263  char *NormalArrays[3]; //the name of the arrays used to construct the normals
264  int NormalArrayComponents[3]; //the components of the arrays used to construct
265  vtkIdType NormalComponentRange[3][2]; //the range of the components to use
266  int NormalNormalize[3]; //flags control normalization
267 
268  char *TensorArrays[9]; //the name of the arrays used to construct the tensors
269  int TensorArrayComponents[9]; //the components of the arrays used to construct
270  vtkIdType TensorComponentRange[9][2]; //the range of the components to use
271  int TensorNormalize[9]; //flags control normalization
272 
273  int NumberOfTCoordComponents; //the number of components to fill-in
274  char *TCoordArrays[3]; //the name of the arrays used to construct the tcoords
275  int TCoordArrayComponents[3]; //the components of the arrays used to construct
276  vtkIdType TCoordComponentRange[3][2]; //the range of the components to use
277  int TCoordNormalize[3]; //flags control normalization
278 
280 
282  vtkIdType componentRange[4][2], char *arrays[4],
283  int arrayComponents[4], int normalize[4], int numComp);
285  vtkIdType componentRange[3][2], char *arrays[3],
286  int arrayComponents[3], int normalize[3]);
288  vtkDataSetAttributes *attr,
289  vtkIdType componentRange[2],
290  char *array, int arrayComponent, int normalize);
292  vtkIdType componentRange[3][2], char *arrays[3],
293  int arrayComponents[3], int normalize[3]);
295  vtkIdType componentRange[3][2], char *arrays[3],
296  int arrayComponents[3], int normalize[3], int numComp);
298  vtkIdType componentRange[9][2], char *arrays[9],
299  int arrayComponents[9], int normalize[9]);
301 
302 private:
304  void operator=(const vtkFieldDataToAttributeDataFilter&); // Not implemented.
305 };
306 
307 #endif
308 
309 
vtkFieldDataToAttributeDataFilter::GetFieldArray
static vtkDataArray * GetFieldArray(vtkFieldData *fd, char *name, int comp)
vtkFieldDataToAttributeDataFilter::GetTensorComponentNormalizeFlag
int GetTensorComponentNormalizeFlag(int comp)
vtkFieldDataToAttributeDataFilter::GetVectorComponentMaxRange
int GetVectorComponentMaxRange(int comp)
vtkFieldDataToAttributeDataFilter::GetNormalComponentArrayComponent
int GetNormalComponentArrayComponent(int comp)
vtkFieldDataToAttributeDataFilter::GetScalarComponentMaxRange
int GetScalarComponentMaxRange(int comp)
vtkFieldDataToAttributeDataFilter
map field data to dataset attribute data
Definition: vtkFieldDataToAttributeDataFilter.h:75
vtkFieldDataToAttributeDataFilter::ConstructFieldData
void ConstructFieldData(int num, vtkDataSetAttributes *attr)
vtkFieldDataToAttributeDataFilter::InputField
int InputField
Definition: vtkFieldDataToAttributeDataFilter.h:244
vtkFieldDataToAttributeDataFilter::SetInputFieldToDataObjectField
void SetInputFieldToDataObjectField()
Definition: vtkFieldDataToAttributeDataFilter.h:91
VTK_CELL_DATA
#define VTK_CELL_DATA
Definition: vtkFieldDataToAttributeDataFilter.h:67
vtkFieldDataToAttributeDataFilter::GetScalarComponentNormalizeFlag
int GetScalarComponentNormalizeFlag(int comp)
vtkFieldDataToAttributeDataFilter::GhostLevelArrayComponent
int GhostLevelArrayComponent
Definition: vtkFieldDataToAttributeDataFilter.h:259
VTK_POINT_DATA_FIELD
#define VTK_POINT_DATA_FIELD
Definition: vtkFieldDataToAttributeDataFilter.h:64
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkFieldDataToAttributeDataFilter::ConstructGhostLevels
void ConstructGhostLevels(int num, vtkFieldData *fd, vtkDataSetAttributes *attr, vtkIdType componentRange[2], char *array, int arrayComponent, int normalize)
vtkDataSetAttributes
represent and manipulate attribute data in a dataset
Definition: vtkDataSetAttributes.h:58
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkFieldDataToAttributeDataFilter::GhostLevelNormalize
int GhostLevelNormalize
Definition: vtkFieldDataToAttributeDataFilter.h:261
vtkFieldDataToAttributeDataFilter::NumberOfTCoordComponents
int NumberOfTCoordComponents
Definition: vtkFieldDataToAttributeDataFilter.h:273
vtkFieldDataToAttributeDataFilter::SetTensorComponent
void SetTensorComponent(int comp, const char *arrayName, int arrayComp, int min, int max, int normalize)
vtkFieldDataToAttributeDataFilter::GetTensorComponentMinRange
int GetTensorComponentMinRange(int comp)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkFieldDataToAttributeDataFilter::GetScalarComponentMinRange
int GetScalarComponentMinRange(int comp)
vtkFieldDataToAttributeDataFilter::SetInputFieldToCellDataField
void SetInputFieldToCellDataField()
Definition: vtkFieldDataToAttributeDataFilter.h:95
vtkFieldDataToAttributeDataFilter::ConstructTensors
void ConstructTensors(int num, vtkFieldData *fd, vtkDataSetAttributes *attr, vtkIdType componentRange[9][2], char *arrays[9], int arrayComponents[9], int normalize[9])
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkFieldDataToAttributeDataFilter::OutputAttributeData
int OutputAttributeData
Definition: vtkFieldDataToAttributeDataFilter.h:245
vtkFieldDataToAttributeDataFilter::ConstructScalars
void ConstructScalars(int num, vtkFieldData *fd, vtkDataSetAttributes *attr, vtkIdType componentRange[4][2], char *arrays[4], int arrayComponents[4], int normalize[4], int numComp)
vtkFieldDataToAttributeDataFilter::GetTensorComponentMaxRange
int GetTensorComponentMaxRange(int comp)
vtkFieldDataToAttributeDataFilter::UpdateComponentRange
static int UpdateComponentRange(vtkDataArray *da, vtkIdType compRange[2])
VTK_CELL_DATA_FIELD
#define VTK_CELL_DATA_FIELD
Definition: vtkFieldDataToAttributeDataFilter.h:65
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:30
vtkFieldData
represent and manipulate fields of data
Definition: vtkFieldData.h:56
vtkFieldDataToAttributeDataFilter::ConstructNormals
void ConstructNormals(int num, vtkFieldData *fd, vtkDataSetAttributes *attr, vtkIdType componentRange[3][2], char *arrays[3], int arrayComponents[3], int normalize[3])
vtkFiltersCoreModule.h
vtkFieldDataToAttributeDataFilter::GhostLevelArray
char * GhostLevelArray
Definition: vtkFieldDataToAttributeDataFilter.h:258
vtkDataSetAlgorithm
Superclass for algorithms that produce output of the same type as input.
Definition: vtkDataSetAlgorithm.h:51
vtkFieldDataToAttributeDataFilter::SetTensorComponent
void SetTensorComponent(int comp, const char *arrayName, int arrayComp)
Definition: vtkFieldDataToAttributeDataFilter.h:169
vtkgl::name
GLuint const GLchar * name
Definition: vtkgl.h:11983
vtkFieldDataToAttributeDataFilter::~vtkFieldDataToAttributeDataFilter
~vtkFieldDataToAttributeDataFilter()
vtkFieldDataToAttributeDataFilter::SetOutputAttributeDataToCellData
void SetOutputAttributeDataToCellData()
Definition: vtkFieldDataToAttributeDataFilter.h:104
vtkFieldDataToAttributeDataFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkFieldDataToAttributeDataFilter::SetVectorComponent
void SetVectorComponent(int comp, const char *arrayName, int arrayComp, int min, int max, int normalize)
vtkFieldDataToAttributeDataFilter::ConstructVectors
void ConstructVectors(int num, vtkFieldData *fd, vtkDataSetAttributes *attr, vtkIdType componentRange[3][2], char *arrays[3], int arrayComponents[3], int normalize[3])
vtkFieldDataToAttributeDataFilter::GetNormalComponentArrayName
const char * GetNormalComponentArrayName(int comp)
vtkFieldDataToAttributeDataFilter::GetVectorComponentMinRange
int GetVectorComponentMinRange(int comp)
vtkFieldDataToAttributeDataFilter::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkFieldDataToAttributeDataFilter::ConstructArray
static int ConstructArray(vtkDataArray *da, int comp, vtkDataArray *frray, int fieldComp, vtkIdType min, vtkIdType max, int normalize)
VTK_POINT_DATA
#define VTK_POINT_DATA
Definition: vtkFieldDataToAttributeDataFilter.h:68
vtkFieldDataToAttributeDataFilter::GetTensorComponentArrayComponent
int GetTensorComponentArrayComponent(int comp)
vtkFieldDataToAttributeDataFilter::SetNormalComponent
void SetNormalComponent(int comp, const char *arrayName, int arrayComp, int min, int max, int normalize)
vtkFieldDataToAttributeDataFilter::NumberOfScalarComponents
int NumberOfScalarComponents
Definition: vtkFieldDataToAttributeDataFilter.h:247
vtkFieldDataToAttributeDataFilter::vtkFieldDataToAttributeDataFilter
vtkFieldDataToAttributeDataFilter()
vtkgl::arrays
const GLuint * arrays
Definition: vtkgl.h:13636
VTK_DATA_OBJECT_FIELD
#define VTK_DATA_OBJECT_FIELD
Definition: vtkFieldDataToAttributeDataFilter.h:63
vtkgl::num
GLuint GLuint num
Definition: vtkgl.h:16907
VTKFILTERSCORE_EXPORT
#define VTKFILTERSCORE_EXPORT
Definition: vtkFiltersCoreModule.h:15
vtkFieldDataToAttributeDataFilter::SetScalarComponent
void SetScalarComponent(int comp, const char *arrayName, int arrayComp)
Definition: vtkFieldDataToAttributeDataFilter.h:118
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkFieldDataToAttributeDataFilter::GetVectorComponentArrayComponent
int GetVectorComponentArrayComponent(int comp)
vtkFieldDataToAttributeDataFilter::GetScalarComponentArrayName
const char * GetScalarComponentArrayName(int comp)
vtkFieldDataToAttributeDataFilter::SetTCoordComponent
void SetTCoordComponent(int comp, const char *arrayName, int arrayComp, int min, int max, int normalize)
vtkFieldDataToAttributeDataFilter::SetOutputAttributeDataToPointData
void SetOutputAttributeDataToPointData()
Definition: vtkFieldDataToAttributeDataFilter.h:106
vtkFieldDataToAttributeDataFilter::SetNormalComponent
void SetNormalComponent(int comp, const char *arrayName, int arrayComp)
Definition: vtkFieldDataToAttributeDataFilter.h:152
vtkFieldDataToAttributeDataFilter::GetScalarComponentArrayComponent
int GetScalarComponentArrayComponent(int comp)
vtkFieldDataToAttributeDataFilter::GetTCoordComponentArrayComponent
int GetTCoordComponentArrayComponent(int comp)
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkFieldDataToAttributeDataFilter::GetComponentsType
static int GetComponentsType(int numComp, vtkDataArray **arrays)
vtkFieldDataToAttributeDataFilter::GetTensorComponentArrayName
const char * GetTensorComponentArrayName(int comp)
vtkFieldDataToAttributeDataFilter::GetNormalComponentNormalizeFlag
int GetNormalComponentNormalizeFlag(int comp)
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkFieldDataToAttributeDataFilter::SetScalarComponent
void SetScalarComponent(int comp, const char *arrayName, int arrayComp, int min, int max, int normalize)
vtkFieldDataToAttributeDataFilter::SetInputFieldToPointDataField
void SetInputFieldToPointDataField()
Definition: vtkFieldDataToAttributeDataFilter.h:93
vtkFieldDataToAttributeDataFilter::GetNormalComponentMinRange
int GetNormalComponentMinRange(int comp)
vtkFieldDataToAttributeDataFilter::DefaultNormalize
int DefaultNormalize
Definition: vtkFieldDataToAttributeDataFilter.h:279
vtkDataSetAlgorithm.h
vtkFieldDataToAttributeDataFilter::GetTCoordComponentNormalizeFlag
int GetTCoordComponentNormalizeFlag(int comp)
vtkFieldDataToAttributeDataFilter::ConstructTCoords
void ConstructTCoords(int num, vtkFieldData *fd, vtkDataSetAttributes *attr, vtkIdType componentRange[3][2], char *arrays[3], int arrayComponents[3], int normalize[3], int numComp)
vtkFieldDataToAttributeDataFilter::New
static vtkFieldDataToAttributeDataFilter * New()
vtkFieldDataToAttributeDataFilter::RequestUpdateExtent
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkFieldDataToAttributeDataFilter::GetNormalComponentMaxRange
int GetNormalComponentMaxRange(int comp)
vtkFieldDataToAttributeDataFilter::SetArrayName
static void SetArrayName(vtkObject *self, char *&name, const char *newName)
vtkFieldDataToAttributeDataFilter::SetVectorComponent
void SetVectorComponent(int comp, const char *arrayName, int arrayComp)
Definition: vtkFieldDataToAttributeDataFilter.h:135
vtkFieldDataToAttributeDataFilter::SetTCoordComponent
void SetTCoordComponent(int comp, const char *arrayName, int arrayComp)
Definition: vtkFieldDataToAttributeDataFilter.h:186
vtkFieldDataToAttributeDataFilter::GetTCoordComponentMaxRange
int GetTCoordComponentMaxRange(int comp)
vtkFieldDataToAttributeDataFilter::GetTCoordComponentMinRange
int GetTCoordComponentMinRange(int comp)
vtkFieldDataToAttributeDataFilter::GetTCoordComponentArrayName
const char * GetTCoordComponentArrayName(int comp)
vtkFieldDataToAttributeDataFilter::GetVectorComponentArrayName
const char * GetVectorComponentArrayName(int comp)
vtkFieldDataToAttributeDataFilter::GetVectorComponentNormalizeFlag
int GetVectorComponentNormalizeFlag(int comp)