VTK: Common/DataModel/vtkGenericAttributeCollection.h Source File

| VTK 9.3.1

vtkGenericAttributeCollection.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
14 #ifndef vtkGenericAttributeCollection_h
15 #define vtkGenericAttributeCollection_h
16
17 #include "vtkCommonDataModelModule.h" // For export macro
18 #include "vtkObject.h"
19
20 VTK_ABI_NAMESPACE_BEGIN
21 class vtkGenericAttributeInternalVector;
22 class vtkIntInternalVector;
23 class vtkGenericAttribute;
24
25 class VTKCOMMONDATAMODEL_EXPORT vtkGenericAttributeCollection : public vtkObject
26 {
27 public:
31 static vtkGenericAttributeCollection* New();
32
34
37 vtkTypeMacro(vtkGenericAttributeCollection, vtkObject);
38 void PrintSelf(ostream& os, vtkIndent indent) override;
40
46 int GetNumberOfAttributes();
47
53 int GetNumberOfComponents();
54
60 int GetNumberOfPointCenteredComponents();
61
67 int GetMaxNumberOfComponents();
68
74 unsigned long GetActualMemorySize();
75
80 int IsEmpty();
81
88 vtkGenericAttribute* GetAttribute(int i);
89
96 int FindAttribute(const char* name);
97
104 int GetAttributeIndex(int i);
105
112 void InsertNextAttribute(vtkGenericAttribute* a);
113
122 void InsertAttribute(int i, vtkGenericAttribute* a);
123
130 void RemoveAttribute(int i);
131
136 void Reset();
137
144 void DeepCopy(vtkGenericAttributeCollection* other);
145
152 void ShallowCopy(vtkGenericAttributeCollection* other);
153
158 vtkMTimeType GetMTime() override;
159
160 // *** ALL THE FOLLOWING METHODS SHOULD BE REMOVED WHEN when the
161 // new pipeline update mechanism is checked in.
162 // *** BEGIN
163
165
170 vtkGetMacro(ActiveAttribute, int);
172
174
180 vtkGetMacro(ActiveComponent, int);
182
192 void SetActiveAttribute(int attribute, int component = 0);
193
195
200 vtkGetMacro(NumberOfAttributesToInterpolate, int);
202
208 int* GetAttributesToInterpolate() VTK_SIZEHINT(GetNumberOfAttributesToInterpolate());
209
215 vtkTypeBool HasAttribute(int size, int* attributes, int attribute) VTK_SIZEHINT(attributes, size);
216
218
228 void SetAttributesToInterpolate(int size, int* attributes) VTK_SIZEHINT(attributes, size);
229 void SetAttributesToInterpolateToAll();
231
232 protected:
236 vtkGenericAttributeCollection();
237
241 ~vtkGenericAttributeCollection() override;
242
246 vtkGenericAttributeInternalVector* AttributeInternalVector;
250 vtkIntInternalVector* AttributeIndices;
251
252 int ActiveAttribute;
253 int ActiveComponent;
254 int NumberOfAttributesToInterpolate;
255 int AttributesToInterpolate[10];
256
257 int NumberOfComponents; // cache
258 int NumberOfPointCenteredComponents; // cache
259 int MaxNumberOfComponents; // cache
260 unsigned long ActualMemorySize; // cache
261 vtkTimeStamp ComputeTime; // cache time stamp
262
267 void ComputeNumbers();
268
269 private:
270 vtkGenericAttributeCollection(const vtkGenericAttributeCollection&) = delete;
271 void operator=(const vtkGenericAttributeCollection&) = delete;
272 };
273 VTK_ABI_NAMESPACE_END
274 #endif
vtkGenericAttributeCollection
a collection of attributes
Definition: vtkGenericAttributeCollection.h:26
vtkGenericAttributeCollection::ShallowCopy
void ShallowCopy(vtkGenericAttributeCollection *other)
Copy, via reference counting, the other attribute array.
vtkGenericAttributeCollection::RemoveAttribute
void RemoveAttribute(int i)
Remove the attribute at ‘i’.
vtkGenericAttributeCollection::GetNumberOfPointCenteredComponents
int GetNumberOfPointCenteredComponents()
Return the number of components.
vtkGenericAttributeCollection::GetNumberOfComponents
int GetNumberOfComponents()
Return the number of components.
vtkGenericAttributeCollection::InsertNextAttribute
void InsertNextAttribute(vtkGenericAttribute *a)
Add the attribute ‘a’ to the end of the collection.
vtkGenericAttributeCollection::IsEmpty
int IsEmpty()
Indicate whether the collection contains any attributes.
vtkGenericAttributeCollection::DeepCopy
void DeepCopy(vtkGenericAttributeCollection *other)
Copy, without reference counting, the other attribute array.
vtkGenericAttributeCollection::FindAttribute
int FindAttribute(const char *name)
Return the index of the attribute named ‘name’.
vtkGenericAttributeCollection::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard type definition and print methods for a VTK class.
vtkGenericAttributeCollection::SetActiveAttribute
void SetActiveAttribute(int attribute, int component=0)
Set the scalar attribute to be processed.
vtkGenericAttributeCollection::GetAttribute
vtkGenericAttribute * GetAttribute(int i)
Return a pointer to the ith instance of vtkGenericAttribute.
vtkGenericAttributeCollection::New
static vtkGenericAttributeCollection * New()
Create an empty collection.
vtkGenericAttributeCollection::GetAttributesToInterpolate
int * GetAttributesToInterpolate()
Indices of attributes to interpolate.
vtkGenericAttributeCollection::GetMTime
vtkMTimeType GetMTime() override
vtkAttributeCollection is a composite object and needs to check each member of its collection for mod...
vtkGenericAttributeCollection::GetActualMemorySize
unsigned long GetActualMemorySize()
Actual size of the data in kibibytes (1024 bytes); only valid after the pipeline has updated.
vtkGenericAttributeCollection::GetNumberOfAttributes
int GetNumberOfAttributes()
Return the number of attributes (e.g., instances of vtkGenericAttribute) in the collection.
vtkGenericAttributeCollection::GetAttributeIndex
int GetAttributeIndex(int i)
Return the index of the first component of attribute ‘i’ in an array of format attrib0comp0 attrib0co...
vtkGenericAttributeCollection::Reset
void Reset()
Remove all attributes.
vtkGenericAttributeCollection::GetMaxNumberOfComponents
int GetMaxNumberOfComponents()
Maximum number of components encountered among all attributes.
vtkGenericAttributeCollection::InsertAttribute
void InsertAttribute(int i, vtkGenericAttribute *a)
Replace the attribute at index ‘i’ by ‘a’.
vtkGenericAttribute
abstract class defined API for attribute data
Definition: vtkGenericAttribute.h:40
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:34
vtkX3D::component
@ component
Definition: vtkX3D.h:175
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkX3D::size
@ size
Definition: vtkX3D.h:253
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkObject.h
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:36