VTK  9.3.1
vtkAssignAttribute.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
42 #ifndef vtkAssignAttribute_h
43 #define vtkAssignAttribute_h
44 
45 #include "vtkFiltersCoreModule.h" // For export macro
47 
48 #include "vtkDataSetAttributes.h" // Needed for NUM_ATTRIBUTES
49 
50 VTK_ABI_NAMESPACE_BEGIN
51 class vtkFieldData;
52 
53 class VTKFILTERSCORE_EXPORT vtkAssignAttribute : public vtkPassInputTypeAlgorithm
54 {
55 public:
57  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
62  static vtkAssignAttribute* New();
63 
67  void Assign(int inputAttributeType, int attributeType, int attributeLoc);
68 
72  void Assign(const char* fieldName, int attributeType, int attributeLoc);
73 
78  void Assign(const char* name, const char* attributeType, const char* attributeLoc);
79 
80  // Always keep NUM_ATTRIBUTE_LOCS as the last entry
82  {
83  POINT_DATA = 0,
84  CELL_DATA = 1,
85  VERTEX_DATA = 2,
86  EDGE_DATA = 3,
87  NUM_ATTRIBUTE_LOCS
88  };
89 
90 protected:
91  enum FieldType
92  {
94  ATTRIBUTE
95  };
96 
98  ~vtkAssignAttribute() override;
99 
102  int FillInputPortInformation(int, vtkInformation*) override;
103 
104  char* FieldName;
109 
110  static char AttributeLocationNames[vtkAssignAttribute::NUM_ATTRIBUTE_LOCS][12];
111  static char AttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][20];
112 
113 private:
114  vtkAssignAttribute(const vtkAssignAttribute&) = delete;
115  void operator=(const vtkAssignAttribute&) = delete;
116 };
117 
118 VTK_ABI_NAMESPACE_END
119 #endif
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks for Information.
Superclass for algorithms that produce output of the same type as input.
Store vtkAlgorithm input/output information.
a simple class to control print indentation
Definition: vtkIndent.h:28
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Store zero or more vtkInformation instances.
Labels/marks a field as an attribute.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
static vtkPassInputTypeAlgorithm * New()
represent and manipulate fields of data
Definition: vtkFieldData.h:51