VTK: Filters/Core/vtkAssignAttribute.h Source File

| 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
51 #ifndef vtkAssignAttribute_h
52 #define vtkAssignAttribute_h
53
54 #include "vtkFiltersCoreModule.h" // For export macro
55 #include "vtkPassInputTypeAlgorithm.h"
56
57 #include "vtkDataSetAttributes.h" // Needed for NUM_ATTRIBUTES
58
59 VTK_ABI_NAMESPACE_BEGIN
60 class vtkFieldData;
61
62 class VTKFILTERSCORE_EXPORT vtkAssignAttribute : public vtkPassInputTypeAlgorithm
63 {
64 public:
65 vtkTypeMacro(vtkAssignAttribute, vtkPassInputTypeAlgorithm);
66 void PrintSelf(ostream& os, vtkIndent indent) override;
67
71 static vtkAssignAttribute* New();
72
76 void Assign(int inputAttributeType, int attributeType, int attributeLoc);
77
81 void Assign(const char* fieldName, int attributeType, int attributeLoc);
82
87 void Assign(const char* name, const char* attributeType, const char* attributeLoc);
88
89 // Always keep NUM_ATTRIBUTE_LOCS as the last entry
90 enum AttributeLocation
91 {
92 POINT_DATA = 0,
93 CELL_DATA = 1,
94 VERTEX_DATA = 2,
95 EDGE_DATA = 3,
96 NUM_ATTRIBUTE_LOCS
97 };
98
99 protected:
100 enum FieldType
101 {
102 NAME,
103 ATTRIBUTE
104 };
105
106 vtkAssignAttribute();
107 ~vtkAssignAttribute() override;
108
109 int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
110 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
111 int FillInputPortInformation(int, vtkInformation*) override;
112
113 char* FieldName;
114 int FieldTypeAssignment;
115 int AttributeType;
116 int InputAttributeType;
117 int AttributeLocationAssignment;
118
119 static char AttributeLocationNames[vtkAssignAttribute::NUM_ATTRIBUTE_LOCS][12];
120 static char AttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][20];
121
122 private:
123 vtkAssignAttribute(const vtkAssignAttribute&) = delete;
124 void operator=(const vtkAssignAttribute&) = delete;
125 };
126
127 VTK_ABI_NAMESPACE_END
128 #endif
vtkAssignAttribute
Labels/marks a field as an attribute.
Definition: vtkAssignAttribute.h:63
vtkAssignAttribute::AttributeLocationAssignment
int AttributeLocationAssignment
Definition: vtkAssignAttribute.h:117
vtkAssignAttribute::FieldTypeAssignment
int FieldTypeAssignment
Definition: vtkAssignAttribute.h:114
vtkAssignAttribute::FieldType
FieldType
Definition: vtkAssignAttribute.h:101
vtkAssignAttribute::NAME
@ NAME
Definition: vtkAssignAttribute.h:102
vtkAssignAttribute::New
static vtkAssignAttribute * New()
Create a new vtkAssignAttribute.
vtkAssignAttribute::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks for Information.
vtkAssignAttribute::AttributeType
int AttributeType
Definition: vtkAssignAttribute.h:115
vtkAssignAttribute::AttributeLocation
AttributeLocation
Definition: vtkAssignAttribute.h:91
vtkAssignAttribute::NUM_ATTRIBUTE_LOCS
@ NUM_ATTRIBUTE_LOCS
Definition: vtkAssignAttribute.h:96
vtkAssignAttribute::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
vtkAssignAttribute::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAssignAttribute::Assign
void Assign(const char *name, const char *attributeType, const char *attributeLoc)
Helper method used by other language bindings.
vtkAssignAttribute::~vtkAssignAttribute
~vtkAssignAttribute() override
vtkAssignAttribute::Assign
void Assign(const char *fieldName, int attributeType, int attributeLoc)
Label an array as an attribute.
vtkAssignAttribute::FillInputPortInformation
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
vtkAssignAttribute::vtkAssignAttribute
vtkAssignAttribute()
vtkAssignAttribute::InputAttributeType
int InputAttributeType
Definition: vtkAssignAttribute.h:116
vtkAssignAttribute::FieldName
char * FieldName
Definition: vtkAssignAttribute.h:113
vtkAssignAttribute::Assign
void Assign(int inputAttributeType, int attributeType, int attributeLoc)
Label an attribute as another attribute.
vtkDataSetAttributes::NUM_ATTRIBUTES
@ NUM_ATTRIBUTES
Definition: vtkDataSetAttributes.h:120
vtkFieldData
represent and manipulate fields of data
Definition: vtkFieldData.h:61
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkPassInputTypeAlgorithm
Superclass for algorithms that produce output of the same type as input.
Definition: vtkPassInputTypeAlgorithm.h:45
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkDataSetAttributes.h
vtkPassInputTypeAlgorithm.h