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 00164 int *GetAttributesToInterpolate(); 00165 //ETX 00167 00171 int HasAttribute(int size, int *attributes, int attribute); 00172 00174 00180 void SetAttributesToInterpolate(int size, int *attributes); 00181 void SetAttributesToInterpolateToAll(); 00183 00184 protected: 00186 vtkGenericAttributeCollection(); 00187 00189 virtual ~vtkGenericAttributeCollection(); 00190 00192 vtkGenericAttributeInternalVector* AttributeInternalVector; 00194 vtkIntInternalVector *AttributeIndices; 00195 00196 int ActiveAttribute; 00197 int ActiveComponent; 00198 int NumberOfAttributesToInterpolate; 00199 int AttributesToInterpolate[10]; 00200 00201 int NumberOfComponents; // cache 00202 int NumberOfPointCenteredComponents; // cache 00203 int MaxNumberOfComponents; // cache 00204 unsigned long ActualMemorySize; // cache 00205 vtkTimeStamp ComputeTime; // cache time stamp 00206 00209 void ComputeNumbers(); 00210 00211 private: 00212 vtkGenericAttributeCollection(const vtkGenericAttributeCollection &); // Not implemented. 00213 void operator=(const vtkGenericAttributeCollection &); // Not implemented. 00214 }; 00215 #endif