VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
48 
49 #include "vtkDataSetAttributes.h" // Needed for NUM_ATTRIBUTES
50 
51 VTK_ABI_NAMESPACE_BEGIN
52 class vtkFieldData;
53 
54 class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkAssignAttribute : public vtkPassInputTypeAlgorithm
55 {
56 public:
58  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
63  static vtkAssignAttribute* New();
64 
68  void Assign(int inputAttributeType, int attributeType, int attributeLoc);
69 
73  void Assign(const char* fieldName, int attributeType, int attributeLoc);
74 
79  void Assign(const char* name, const char* attributeType, const char* attributeLoc);
80 
81  // Always keep NUM_ATTRIBUTE_LOCS as the last entry
83  {
84  POINT_DATA = 0,
85  CELL_DATA = 1,
86  VERTEX_DATA = 2,
87  EDGE_DATA = 3,
88  NUM_ATTRIBUTE_LOCS = 4
89  };
90 
91 protected:
92  enum FieldType
93  {
95  ATTRIBUTE
96  };
97 
99  ~vtkAssignAttribute() override;
100 
103  int FillInputPortInformation(int, vtkInformation*) override;
104 
105  char* FieldName;
110 
111  static char AttributeLocationNames[vtkAssignAttribute::NUM_ATTRIBUTE_LOCS][12];
112  static char AttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][20];
113 
114 private:
115  vtkAssignAttribute(const vtkAssignAttribute&) = delete;
116  void operator=(const vtkAssignAttribute&) = delete;
117 };
118 
119 VTK_ABI_NAMESPACE_END
120 #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.
#define VTK_MARSHALAUTO
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()
Represents and manipulates a collection of data arrays.
Definition: vtkFieldData.h:51