VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkGenericAttributeCollection.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00025 #ifndef vtkGenericAttributeCollection_h 00026 #define vtkGenericAttributeCollection_h 00027 00028 #include "vtkCommonDataModelModule.h" // For export macro 00029 #include "vtkObject.h" 00030 00031 class vtkGenericAttributeInternalVector; 00032 class vtkIntInternalVector; 00033 class vtkGenericAttribute; 00034 00035 class VTKCOMMONDATAMODEL_EXPORT vtkGenericAttributeCollection : public vtkObject 00036 { 00037 public: 00039 static vtkGenericAttributeCollection *New(); 00040 00042 00043 vtkTypeMacro(vtkGenericAttributeCollection,vtkObject); 00044 virtual void PrintSelf(ostream& os, vtkIndent indent); 00046 00050 int GetNumberOfAttributes(); 00051 00054 int GetNumberOfComponents(); 00055 00059 int GetNumberOfPointCenteredComponents(); 00060 00064 int GetMaxNumberOfComponents(); 00065 00069 unsigned long GetActualMemorySize(); 00070 00073 int IsEmpty(); 00074 00078 vtkGenericAttribute *GetAttribute(int i); 00079 00084 int FindAttribute(const char *name); 00085 00090 int GetAttributeIndex(int i); 00091 00096 void InsertNextAttribute(vtkGenericAttribute *a); 00097 00102 void InsertAttribute(int i, vtkGenericAttribute *a); 00103 00107 void RemoveAttribute(int i); 00108 00110 void Reset(); 00111 00115 void DeepCopy(vtkGenericAttributeCollection *other); 00116 00120 void ShallowCopy(vtkGenericAttributeCollection *other); 00121 00124 virtual unsigned long int GetMTime(); 00125 00126 // *** ALL THE FOLLOWING METHODS SHOULD BE REMOVED WHEN when the 00127 // new pipeline update mechanism is checked in. 00128 // *** BEGIN 00129 00131 00134 vtkGetMacro(ActiveAttribute, int); 00136 00138 00142 vtkGetMacro(ActiveComponent, int); 00144 00151 void SetActiveAttribute(int attribute, int component = 0); 00152 00154 00156 vtkGetMacro(NumberOfAttributesToInterpolate, int); 00158 00159 //BTX 00161 00163 int *GetAttributesToInterpolate(); 00164 //ETX 00166 00170 int HasAttribute(int size, int *attributes, int attribute); 00171 00173 00179 void SetAttributesToInterpolate(int size, int *attributes); 00180 void SetAttributesToInterpolateToAll(); 00182 00183 protected: 00185 vtkGenericAttributeCollection(); 00186 00188 virtual ~vtkGenericAttributeCollection(); 00189 00191 vtkGenericAttributeInternalVector* AttributeInternalVector; 00193 vtkIntInternalVector *AttributeIndices; 00194 00195 int ActiveAttribute; 00196 int ActiveComponent; 00197 int NumberOfAttributesToInterpolate; 00198 int AttributesToInterpolate[10]; 00199 00200 int NumberOfComponents; // cache 00201 int NumberOfPointCenteredComponents; // cache 00202 int MaxNumberOfComponents; // cache 00203 unsigned long ActualMemorySize; // cache 00204 vtkTimeStamp ComputeTime; // cache time stamp 00205 00208 void ComputeNumbers(); 00209 00210 private: 00211 vtkGenericAttributeCollection(const vtkGenericAttributeCollection &); // Not implemented. 00212 void operator=(const vtkGenericAttributeCollection &); // Not implemented. 00213 }; 00214 #endif