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 =========================================================================*/
25 #ifndef __vtkGenericAttributeCollection_h
26 #define __vtkGenericAttributeCollection_h
27 
28 #include "vtkObject.h"
29 
30 class vtkGenericAttributeInternalVector;
31 class vtkIntInternalVector;
33 
35 {
36 public:
39 
41 
43  virtual void PrintSelf(ostream& os, vtkIndent indent);
45 
49  int GetNumberOfAttributes();
50 
53  int GetNumberOfComponents();
54 
58  int GetNumberOfPointCenteredComponents();
59 
63  int GetMaxNumberOfComponents();
64 
68  unsigned long GetActualMemorySize();
69 
72  int IsEmpty();
73 
77  vtkGenericAttribute *GetAttribute(int i);
78 
83  int FindAttribute(const char *name);
84 
89  int GetAttributeIndex(int i);
90 
95  void InsertNextAttribute(vtkGenericAttribute *a);
96 
101  void InsertAttribute(int i, vtkGenericAttribute *a);
102 
106  void RemoveAttribute(int i);
107 
109  void Reset();
110 
114  void DeepCopy(vtkGenericAttributeCollection *other);
115 
119  void ShallowCopy(vtkGenericAttributeCollection *other);
120 
123  virtual unsigned long int GetMTime();
124 
125  // *** ALL THE FOLLOWING METHODS SHOULD BE REMOVED WHEN when the
126  // new pipeline update mechanism is checked in.
127  // *** BEGIN
128 
130 
133  vtkGetMacro(ActiveAttribute, int);
135 
137 
141  vtkGetMacro(ActiveComponent, int);
143 
150  void SetActiveAttribute(int attribute, int component = 0);
151 
153 
155  vtkGetMacro(NumberOfAttributesToInterpolate, int);
157 
158  //BTX
160 
163  int *GetAttributesToInterpolate();
164  //ETX
166 
170  int HasAttribute(int size, int *attributes, int attribute);
171 
173 
179  void SetAttributesToInterpolate(int size, int *attributes);
180  void SetAttributesToInterpolateToAll();
182 
183 protected:
186 
189 
191 
192  vtkGenericAttributeInternalVector* AttributeInternalVector;
193  // Description:
194  // STL vector for storing index of point centered attributes
195  vtkIntInternalVector *AttributeIndices;
197 
201  int AttributesToInterpolate[10];
202 
203  int NumberOfComponents; // cache
205  int MaxNumberOfComponents; // cache
206  unsigned long ActualMemorySize; // cache
207  vtkTimeStamp ComputeTime; // cache time stamp
208 
211  void ComputeNumbers();
212 
213 private:
215  void operator=(const vtkGenericAttributeCollection &); // Not implemented.
216 };
217 #endif