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 "vtkObject.h" 00029 00030 class vtkGenericAttributeInternalVector; 00031 class vtkIntInternalVector; 00032 class vtkGenericAttribute; 00033 00034 class VTK_FILTERING_EXPORT vtkGenericAttributeCollection : public vtkObject 00035 { 00036 public: 00038 static vtkGenericAttributeCollection *New(); 00039 00041 00042 vtkTypeMacro(vtkGenericAttributeCollection,vtkObject); 00043 virtual void PrintSelf(ostream& os, vtkIndent indent); 00045 00049 int GetNumberOfAttributes(); 00050 00053 int GetNumberOfComponents(); 00054 00058 int GetNumberOfPointCenteredComponents(); 00059 00063 int GetMaxNumberOfComponents(); 00064 00068 unsigned long GetActualMemorySize(); 00069 00072 int IsEmpty(); 00073 00077 vtkGenericAttribute *GetAttribute(int i); 00078 00083 int FindAttribute(const char *name); 00084 00089 int GetAttributeIndex(int i); 00090 00095 void InsertNextAttribute(vtkGenericAttribute *a); 00096 00101 void InsertAttribute(int i, vtkGenericAttribute *a); 00102 00106 void RemoveAttribute(int i); 00107 00109 void Reset(); 00110 00114 void DeepCopy(vtkGenericAttributeCollection *other); 00115 00119 void ShallowCopy(vtkGenericAttributeCollection *other); 00120 00123 virtual unsigned long int GetMTime(); 00124 00125 // *** ALL THE FOLLOWING METHODS SHOULD BE REMOVED WHEN when the 00126 // new pipeline update mechanism is checked in. 00127 // *** BEGIN 00128 00130 00133 vtkGetMacro(ActiveAttribute, int); 00135 00137 00141 vtkGetMacro(ActiveComponent, int); 00143 00150 void SetActiveAttribute(int attribute, int component = 0); 00151 00153 00155 vtkGetMacro(NumberOfAttributesToInterpolate, int); 00157 00158 //BTX 00160 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