VTK
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 =========================================================================*/
26 #ifndef vtkGenericAttributeCollection_h
27 #define vtkGenericAttributeCollection_h
28 
29 #include "vtkCommonDataModelModule.h" // For export macro
30 #include "vtkObject.h"
31 
32 class vtkGenericAttributeInternalVector;
33 class vtkIntInternalVector;
35 
36 class VTKCOMMONDATAMODEL_EXPORT vtkGenericAttributeCollection : public vtkObject
37 {
38 public:
43 
45 
49  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
58 
65 
72 
79 
85  unsigned long GetActualMemorySize();
86 
91  int IsEmpty();
92 
100 
107  int FindAttribute(const char *name);
108 
115  int GetAttributeIndex(int i);
116 
124 
134 
141  void RemoveAttribute(int i);
142 
147  void Reset();
148 
156 
164 
169  vtkMTimeType GetMTime() override;
170 
171  // *** ALL THE FOLLOWING METHODS SHOULD BE REMOVED WHEN when the
172  // new pipeline update mechanism is checked in.
173  // *** BEGIN
174 
176 
181  vtkGetMacro(ActiveAttribute, int);
183 
185 
191  vtkGetMacro(ActiveComponent, int);
193 
203  void SetActiveAttribute(int attribute, int component = 0);
204 
206 
211  vtkGetMacro(NumberOfAttributesToInterpolate, int);
213 
220 
226  int HasAttribute(int size, int *attributes, int attribute);
227 
229 
239  void SetAttributesToInterpolate(int size, int *attributes);
242 
243 protected:
248 
253 
257  vtkGenericAttributeInternalVector* AttributeInternalVector;
261  vtkIntInternalVector *AttributeIndices;
262 
266  int AttributesToInterpolate[10];
267 
268  int NumberOfComponents; // cache
270  int MaxNumberOfComponents; // cache
271  unsigned long ActualMemorySize; // cache
272  vtkTimeStamp ComputeTime; // cache time stamp
273 
279 
280 private:
282  void operator=(const vtkGenericAttributeCollection &) = delete;
283 };
284 #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:175
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.
vtkGenericAttributeCollection::AttributeIndices
vtkIntInternalVector * AttributeIndices
STL vector for storing index of point centered attributes.
Definition: vtkGenericAttributeCollection.h:261
vtkGenericAttributeCollection::ComputeTime
vtkTimeStamp ComputeTime
Definition: vtkGenericAttributeCollection.h:272
vtkGenericAttributeCollection::vtkGenericAttributeCollection
vtkGenericAttributeCollection()
Default constructor: empty collection.
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:36
vtkGenericAttributeCollection::AttributeInternalVector
vtkGenericAttributeInternalVector * AttributeInternalVector
STL vector for storing attributes.
Definition: vtkGenericAttributeCollection.h:257
vtkGenericAttributeCollection::NumberOfAttributesToInterpolate
int NumberOfAttributesToInterpolate
Definition: vtkGenericAttributeCollection.h:265
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:60
vtkGenericAttributeCollection::ComputeNumbers
void ComputeNumbers()
Compute number of components, max number of components and actual memory size.
vtkGenericAttributeCollection::DeepCopy
void DeepCopy(vtkGenericAttributeCollection *other)
Copy, without reference counting, the other attribute array.
vtkGenericAttributeCollection::NumberOfPointCenteredComponents
int NumberOfPointCenteredComponents
Definition: vtkGenericAttributeCollection.h:269
vtkGenericAttributeCollection::ShallowCopy
void ShallowCopy(vtkGenericAttributeCollection *other)
Copy, via reference counting, the other attribute array.
vtkGenericAttributeCollection::ActiveComponent
int ActiveComponent
Definition: vtkGenericAttributeCollection.h:264
vtkGenericAttributeCollection::NumberOfComponents
int NumberOfComponents
Definition: vtkGenericAttributeCollection.h:268
vtkGenericAttributeCollection::ActualMemorySize
unsigned long ActualMemorySize
Definition: vtkGenericAttributeCollection.h:271
vtkGenericAttributeCollection::GetNumberOfComponents
int GetNumberOfComponents()
Return the number of components.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkGenericAttributeCollection::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkGenericAttributeCollection::SetAttributesToInterpolate
void SetAttributesToInterpolate(int size, int *attributes)
Set the attributes to interpolate.
vtkX3D::size
@ size
Definition: vtkX3D.h:253
vtkGenericAttributeCollection::GetAttributesToInterpolate
int * GetAttributesToInterpolate()
Indices of attributes to interpolate.
vtkGenericAttributeCollection::Reset
void Reset()
Remove all attributes.
vtkGenericAttributeCollection::SetAttributesToInterpolateToAll
void SetAttributesToInterpolateToAll()
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkObject.h
vtkGenericAttributeCollection::GetAttribute
vtkGenericAttribute * GetAttribute(int i)
Return a pointer to the ith instance of vtkGenericAttribute.
vtkGenericAttributeCollection::~vtkGenericAttributeCollection
~vtkGenericAttributeCollection() override
Destructor.
vtkGenericAttributeCollection::RemoveAttribute
void RemoveAttribute(int i)
Remove the attribute at ‘i’.
vtkGenericAttributeCollection
a collection of attributes
Definition: vtkGenericAttributeCollection.h:37
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:51
vtkGenericAttributeCollection::GetNumberOfPointCenteredComponents
int GetNumberOfPointCenteredComponents()
Return the number of components.
vtkGenericAttributeCollection::MaxNumberOfComponents
int MaxNumberOfComponents
Definition: vtkGenericAttributeCollection.h:270
vtkGenericAttributeCollection::GetActualMemorySize
unsigned long GetActualMemorySize()
Actual size of the data in kibibytes (1024 bytes); only valid after the pipeline has updated.
vtkGenericAttributeCollection::ActiveAttribute
int ActiveAttribute
Definition: vtkGenericAttributeCollection.h:263
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:302
vtkGenericAttributeCollection::HasAttribute
int HasAttribute(int size, int *attributes, int attribute)
Does the array ‘attributes’ of size ‘size’ have ‘attribute’?