VTK  9.6.1
vtkFieldDataToAttributeDataFilter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
45
46#ifndef vtkFieldDataToAttributeDataFilter_h
47#define vtkFieldDataToAttributeDataFilter_h
48
49#include "vtkDataSetAlgorithm.h"
50#include "vtkFiltersCoreModule.h" // For export macro
51#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
52
53#define VTK_DATA_OBJECT_FIELD 0
54#define VTK_POINT_DATA_FIELD 1
55#define VTK_CELL_DATA_FIELD 2
56
57#define VTK_CELL_DATA 0
58#define VTK_POINT_DATA 1
59
60VTK_ABI_NAMESPACE_BEGIN
61class vtkDataArray;
63class vtkFieldData;
64
66 : public vtkDataSetAlgorithm
67{
68public:
69 void PrintSelf(ostream& os, vtkIndent indent) override;
71
77
79
85 vtkSetMacro(InputField, int);
86 vtkGetMacro(InputField, int);
91
93
96 vtkSetMacro(OutputAttributeData, int);
97 vtkGetMacro(OutputAttributeData, int);
101
103
111 int comp, const char* arrayName, int arrayComp, int min, int max, int normalize);
112 void SetScalarComponent(int comp, const char* arrayName, int arrayComp)
113 {
114 this->SetScalarComponent(comp, arrayName, arrayComp, -1, -1, this->DefaultNormalize);
115 }
116 const char* GetScalarComponentArrayName(int comp);
122
124
132 int comp, const char* arrayName, int arrayComp, int min, int max, int normalize);
133 void SetVectorComponent(int comp, const char* arrayName, int arrayComp)
134 {
135 this->SetVectorComponent(comp, arrayName, arrayComp, -1, -1, this->DefaultNormalize);
136 }
137 const char* GetVectorComponentArrayName(int comp);
143
145
153 int comp, const char* arrayName, int arrayComp, int min, int max, int normalize);
154 void SetNormalComponent(int comp, const char* arrayName, int arrayComp)
155 {
156 this->SetNormalComponent(comp, arrayName, arrayComp, -1, -1, this->DefaultNormalize);
157 }
158 const char* GetNormalComponentArrayName(int comp);
164
166
174 int comp, const char* arrayName, int arrayComp, int min, int max, int normalize);
175 void SetTensorComponent(int comp, const char* arrayName, int arrayComp)
176 {
177 this->SetTensorComponent(comp, arrayName, arrayComp, -1, -1, this->DefaultNormalize);
178 }
179 const char* GetTensorComponentArrayName(int comp);
185
187
195 int comp, const char* arrayName, int arrayComp, int min, int max, int normalize);
196 void SetTCoordComponent(int comp, const char* arrayName, int arrayComp)
197 {
198 this->SetTCoordComponent(comp, arrayName, arrayComp, -1, -1, this->DefaultNormalize);
199 }
200 const char* GetTCoordComponentArrayName(int comp);
206
208
214 vtkBooleanMacro(DefaultNormalize, vtkTypeBool);
216
217 // Helper functions, made public to support other classes
218
224 static int GetComponentsType(int numComp, vtkDataArray** arrays);
225
232 static int ConstructArray(vtkDataArray* da, int comp, vtkDataArray* fieldArray, int fieldComp,
233 vtkIdType min, vtkIdType max, int normalize);
234
238 static vtkDataArray* GetFieldArray(vtkFieldData* fd, const char* name, int comp);
239
243 static void SetArrayName(vtkObject* self, char*& name, const char* newName);
244
249 static int UpdateComponentRange(vtkDataArray* da, vtkIdType compRange[2]);
250
255
256protected:
259
261 vtkInformationVector*) override; // generate output data
262
265
266 int NumberOfScalarComponents; // the number of components to fill-in
267 char* ScalarArrays[4]; // the name of the arrays used to construct the scalar
268 int ScalarArrayComponents[4]; // the components of the arrays used to construct
269 vtkIdType ScalarComponentRange[4][2]; // the range of the components to use
270 int ScalarNormalize[4]; // flags control normalization
271
272 char* VectorArrays[3]; // the name of the arrays used to construct the vectors
273 int VectorArrayComponents[3]; // the components of the arrays used to construct
274 vtkIdType VectorComponentRange[3][2]; // the range of the components to use
275 int VectorNormalize[3]; // flags control normalization
276
277 char* GhostLevelArray; // the name of the array used to construct the ghost levels
278 int GhostLevelArrayComponent; // the component of the array used to construct
279 vtkIdType GhostLevelComponentRange[2]; // the range of the components to use
280 int GhostLevelNormalize; // flags control normalization
281
282 char* NormalArrays[3]; // the name of the arrays used to construct the normals
283 int NormalArrayComponents[3]; // the components of the arrays used to construct
284 vtkIdType NormalComponentRange[3][2]; // the range of the components to use
285 int NormalNormalize[3]; // flags control normalization
286
287 char* TensorArrays[9]; // the name of the arrays used to construct the tensors
288 int TensorArrayComponents[9]; // the components of the arrays used to construct
289 vtkIdType TensorComponentRange[9][2]; // the range of the components to use
290 int TensorNormalize[9]; // flags control normalization
291
292 int NumberOfTCoordComponents; // the number of components to fill-in
293 char* TCoordArrays[3]; // the name of the arrays used to construct the tcoords
294 int TCoordArrayComponents[3]; // the components of the arrays used to construct
295 vtkIdType TCoordComponentRange[3][2]; // the range of the components to use
296 int TCoordNormalize[3]; // flags control normalization
297
299
301 vtkIdType componentRange[4][2], char* arrays[4], int arrayComponents[4], int normalize[4],
302 int numComp);
304 vtkIdType componentRange[3][2], char* arrays[3], int arrayComponents[3], int normalize[3]);
306 vtkIdType componentRange[2], char* array, int arrayComponent, int normalize);
308 vtkIdType componentRange[3][2], char* arrays[3], int arrayComponents[3], int normalize[3]);
310 vtkIdType componentRange[3][2], char* arrays[3], int arrayComponents[3], int normalize[3],
311 int numComp);
313 vtkIdType componentRange[9][2], char* arrays[9], int arrayComponents[9], int normalize[9]);
315
316private:
318 void operator=(const vtkFieldDataToAttributeDataFilter&) = delete;
319};
320
321VTK_ABI_NAMESPACE_END
322#endif
represent and manipulate attribute data in a dataset
void SetOutputAttributeDataToPointData()
Specify which attribute data to output: point or cell data attributes.
static int GetComponentsType(int numComp, vtkDataArray **arrays)
Given an array of names of arrays in field data, return the common type for these arrays.
int GetNormalComponentMinRange(int comp)
Define the component(s) of the field to be used for the normal components.
void SetOutputAttributeDataToCellData()
Specify which attribute data to output: point or cell data attributes.
static vtkFieldDataToAttributeDataFilter * New()
Construct object with input field set to the data object field, and the output attribute data set to ...
void SetInputFieldToCellDataField()
Specify which field data to use to generate the output attribute data.
int GetTensorComponentMaxRange(int comp)
Define the components of the field to be used for the tensor components.
int GetNormalComponentMaxRange(int comp)
Define the component(s) of the field to be used for the normal components.
void SetTensorComponent(int comp, const char *arrayName, int arrayComp)
Define the components of the field to be used for the tensor components.
virtual void SetOutputAttributeData(int)
Specify which attribute data to output: point or cell data attributes.
void ConstructNormals(int num, vtkFieldData *fd, vtkDataSetAttributes *attr, vtkIdType componentRange[3][2], char *arrays[3], int arrayComponents[3], int normalize[3])
const char * GetTCoordComponentArrayName(int comp)
Define the components of the field to be used for the cell texture coord components.
static int UpdateComponentRange(vtkDataArray *da, vtkIdType compRange[2])
Update the maximum and minimum component range values.
void ConstructVectors(int num, vtkFieldData *fd, vtkDataSetAttributes *attr, vtkIdType componentRange[3][2], char *arrays[3], int arrayComponents[3], int normalize[3])
static void SetArrayName(vtkObject *self, char *&name, const char *newName)
Specify an array name for one of the components.
const char * GetVectorComponentArrayName(int comp)
Define the component(s) of the field to be used for the vector components.
const char * GetScalarComponentArrayName(int comp)
Define the component(s) of the field to be used for the scalar components.
const char * GetNormalComponentArrayName(int comp)
Define the component(s) of the field to be used for the normal components.
void SetInputFieldToDataObjectField()
Specify which field data to use to generate the output attribute data.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int GetTCoordComponentArrayComponent(int comp)
Define the components of the field to be used for the cell texture coord components.
void ConstructFieldData(int num, vtkDataSetAttributes *attr)
void ConstructTCoords(int num, vtkFieldData *fd, vtkDataSetAttributes *attr, vtkIdType componentRange[3][2], char *arrays[3], int arrayComponents[3], int normalize[3], int numComp)
void SetNormalComponent(int comp, const char *arrayName, int arrayComp)
Define the component(s) of the field to be used for the normal components.
int GetTCoordComponentMaxRange(int comp)
Define the components of the field to be used for the cell texture coord components.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
int GetTensorComponentMinRange(int comp)
Define the components of the field to be used for the tensor components.
static int ConstructArray(vtkDataArray *da, int comp, vtkDataArray *fieldArray, int fieldComp, vtkIdType min, vtkIdType max, int normalize)
Construct a portion of a data array (the comp portion) from another data array and its component.
int GetVectorComponentArrayComponent(int comp)
Define the component(s) of the field to be used for the vector components.
int GetTensorComponentNormalizeFlag(int comp)
Define the components of the field to be used for the tensor components.
int GetScalarComponentMinRange(int comp)
Define the component(s) of the field to be used for the scalar components.
void SetVectorComponent(int comp, const char *arrayName, int arrayComp, int min, int max, int normalize)
Define the component(s) of the field to be used for the vector components.
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
If output does not need exact extent, the I do not either.
int GetVectorComponentMaxRange(int comp)
Define the component(s) of the field to be used for the vector components.
const char * GetTensorComponentArrayName(int comp)
Define the components of the field to be used for the tensor components.
int GetTensorComponentArrayComponent(int comp)
Define the components of the field to be used for the tensor components.
void SetTCoordComponent(int comp, const char *arrayName, int arrayComp)
Define the components of the field to be used for the cell texture coord components.
static vtkDataArray * GetFieldArray(vtkFieldData *fd, const char *name, int comp)
Return an array of a particular name from field data and do error checking.
void SetScalarComponent(int comp, const char *arrayName, int arrayComp, int min, int max, int normalize)
Define the component(s) of the field to be used for the scalar components.
void ConstructGhostLevels(int num, vtkFieldData *fd, vtkDataSetAttributes *attr, vtkIdType componentRange[2], char *array, int arrayComponent, int normalize)
int GetTCoordComponentMinRange(int comp)
Define the components of the field to be used for the cell texture coord components.
void SetTCoordComponent(int comp, const char *arrayName, int arrayComp, int min, int max, int normalize)
Define the components of the field to be used for the cell texture coord components.
void ConstructTensors(int num, vtkFieldData *fd, vtkDataSetAttributes *attr, vtkIdType componentRange[9][2], char *arrays[9], int arrayComponents[9], int normalize[9])
virtual void SetInputField(int)
Specify which field data to use to generate the output attribute data.
void SetVectorComponent(int comp, const char *arrayName, int arrayComp)
Define the component(s) of the field to be used for the vector components.
int GetScalarComponentMaxRange(int comp)
Define the component(s) of the field to be used for the scalar components.
void SetScalarComponent(int comp, const char *arrayName, int arrayComp)
Define the component(s) of the field to be used for the scalar components.
void SetTensorComponent(int comp, const char *arrayName, int arrayComp, int min, int max, int normalize)
Define the components of the field to be used for the tensor components.
void ConstructScalars(int num, vtkFieldData *fd, vtkDataSetAttributes *attr, vtkIdType componentRange[4][2], char *arrays[4], int arrayComponents[4], int normalize[4], int numComp)
int GetNormalComponentArrayComponent(int comp)
Define the component(s) of the field to be used for the normal components.
int GetScalarComponentArrayComponent(int comp)
Define the component(s) of the field to be used for the scalar components.
int GetTCoordComponentNormalizeFlag(int comp)
Define the components of the field to be used for the cell texture coord components.
int GetVectorComponentMinRange(int comp)
Define the component(s) of the field to be used for the vector components.
int GetNormalComponentNormalizeFlag(int comp)
Define the component(s) of the field to be used for the normal components.
void SetInputFieldToPointDataField()
Specify which field data to use to generate the output attribute data.
void SetNormalComponent(int comp, const char *arrayName, int arrayComp, int min, int max, int normalize)
Define the component(s) of the field to be used for the normal components.
int GetScalarComponentNormalizeFlag(int comp)
Define the component(s) of the field to be used for the scalar components.
int GetVectorComponentNormalizeFlag(int comp)
Define the component(s) of the field to be used for the vector components.
Represents and manipulates a collection of data arrays.
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
int vtkTypeBool
Definition vtkABI.h:64
#define vtkDataArray
#define VTK_POINT_DATA_FIELD
#define VTK_CELL_DATA_FIELD
#define VTK_DATA_OBJECT_FIELD
int vtkIdType
Definition vtkType.h:368
#define VTK_MARSHALAUTO
#define max(a, b)