VTK  9.0.1
vtkGenericAttributeCollection.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGenericAttributeCollection.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
23 #ifndef vtkGenericAttributeCollection_h
24 #define vtkGenericAttributeCollection_h
25 
26 #include "vtkCommonDataModelModule.h" // For export macro
27 #include "vtkObject.h"
28 
29 class vtkGenericAttributeInternalVector;
30 class vtkIntInternalVector;
32 
33 class VTKCOMMONDATAMODEL_EXPORT vtkGenericAttributeCollection : public vtkObject
34 {
35 public:
40 
42 
46  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
55 
62 
69 
76 
82  unsigned long GetActualMemorySize();
83 
88  int IsEmpty();
89 
97 
104  int FindAttribute(const char* name);
105 
112  int GetAttributeIndex(int i);
113 
121 
131 
138  void RemoveAttribute(int i);
139 
144  void Reset();
145 
153 
161 
166  vtkMTimeType GetMTime() override;
167 
168  // *** ALL THE FOLLOWING METHODS SHOULD BE REMOVED WHEN when the
169  // new pipeline update mechanism is checked in.
170  // *** BEGIN
171 
173 
178  vtkGetMacro(ActiveAttribute, int);
180 
182 
188  vtkGetMacro(ActiveComponent, int);
190 
200  void SetActiveAttribute(int attribute, int component = 0);
201 
203 
208  vtkGetMacro(NumberOfAttributesToInterpolate, int);
210 
216  int* GetAttributesToInterpolate() VTK_SIZEHINT(GetNumberOfAttributesToInterpolate());
217 
223  int HasAttribute(int size, int* attributes, int attribute) VTK_SIZEHINT(attributes, size);
224 
226 
236  void SetAttributesToInterpolate(int size, int* attributes) VTK_SIZEHINT(attributes, size);
237  void SetAttributesToInterpolateToAll();
239 
240 protected:
245 
250 
254  vtkGenericAttributeInternalVector* AttributeInternalVector;
258  vtkIntInternalVector* AttributeIndices;
259 
260  int ActiveAttribute;
261  int ActiveComponent;
262  int NumberOfAttributesToInterpolate;
263  int AttributesToInterpolate[10];
264 
265  int NumberOfComponents; // cache
266  int NumberOfPointCenteredComponents; // cache
267  int MaxNumberOfComponents; // cache
268  unsigned long ActualMemorySize; // cache
269  vtkTimeStamp ComputeTime; // cache time stamp
270 
275  void ComputeNumbers();
276 
277 private:
279  void operator=(const vtkGenericAttributeCollection&) = delete;
280 };
281 #endif
vtkGenericAttributeCollection::New
static vtkGenericAttributeCollection * New()
Create an empty 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::GetNumberOfAttributes
int GetNumberOfAttributes()
Return the number of attributes (e.g., instances of vtkGenericAttribute) in the collection.
vtkGenericAttributeCollection::InsertAttribute
void InsertAttribute(int i, vtkGenericAttribute *a)
Replace the attribute at index ‘i’ by ‘a’.
vtkX3D::component
@ component
Definition: vtkX3D.h:181
vtkGenericAttributeCollection::GetMTime
vtkMTimeType GetMTime() override
vtkAttributeCollection is a composite object and needs to check each member of its collection for mod...
vtkGenericAttributeCollection::GetMaxNumberOfComponents
int GetMaxNumberOfComponents()
Maximum number of components encountered among all attributes.
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:33
vtkGenericAttributeCollection::FindAttribute
int FindAttribute(const char *name)
Return the index of the attribute named ‘name’.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:54
vtkGenericAttributeCollection::DeepCopy
void DeepCopy(vtkGenericAttributeCollection *other)
Copy, without reference counting, the other attribute array.
vtkGenericAttributeCollection::ShallowCopy
void ShallowCopy(vtkGenericAttributeCollection *other)
Copy, via reference counting, the other attribute array.
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:45
vtkGenericAttributeCollection::GetNumberOfComponents
int GetNumberOfComponents()
Return the number of components.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkGenericAttributeCollection::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkX3D::size
@ size
Definition: vtkX3D.h:259
vtkGenericAttributeCollection::Reset
void Reset()
Remove all attributes.
vtkX3D::name
@ name
Definition: vtkX3D.h:225
vtkObject.h
vtkGenericAttributeCollection::GetAttribute
vtkGenericAttribute * GetAttribute(int i)
Return a pointer to the ith instance of vtkGenericAttribute.
vtkGenericAttributeCollection::GetAttributesToInterpolate
int * GetAttributesToInterpolate())
Indices of attributes to interpolate.
vtkGenericAttributeCollection::RemoveAttribute
void RemoveAttribute(int i)
Remove the attribute at ‘i’.
vtkGenericAttributeCollection
a collection of attributes
Definition: vtkGenericAttributeCollection.h:34
vtkGenericAttributeCollection::SetActiveAttribute
void SetActiveAttribute(int attribute, int component=0)
Set the scalar attribute to be processed.
vtkGenericAttribute
abstract class defined API for attribute data
Definition: vtkGenericAttribute.h:48
vtkGenericAttributeCollection::GetNumberOfPointCenteredComponents
int GetNumberOfPointCenteredComponents()
Return the number of components.
vtkGenericAttributeCollection::GetActualMemorySize
unsigned long GetActualMemorySize()
Actual size of the data in kibibytes (1024 bytes); only valid after the pipeline has updated.
vtkGenericAttributeCollection::IsEmpty
int IsEmpty()
Indicate whether the collection contains any attributes.
vtkGenericAttributeCollection::InsertNextAttribute
void InsertNextAttribute(vtkGenericAttribute *a)
Add the attribute ‘a’ to the end of the collection.
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293