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;
24 
25 class VTKCOMMONDATAMODEL_EXPORT vtkGenericAttributeCollection : public vtkObject
26 {
27 public:
32 
34 
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:
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
abstract base class for most VTK objects
Definition: vtkObject.h:51
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
record modification and/or execution time
Definition: vtkTimeStamp.h:24
abstract class defined API for attribute data
int vtkTypeBool
Definition: vtkABI.h:64
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual vtkMTimeType GetMTime()
Return this object's modified time.
#define VTK_SIZEHINT(...)
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...