VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkBridgeAttribute.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 =========================================================================*/ 00027 #ifndef __vtkBridgeAttribute_h 00028 #define __vtkBridgeAttribute_h 00029 00030 #include "vtkBridgeExport.h" //for module export macro 00031 #include "vtkGenericAttribute.h" 00032 00033 class vtkPointData; 00034 class vtkCellData; 00035 class vtkDataSetAttributes; 00036 00037 class VTKTESTINGGENERICBRIDGE_EXPORT vtkBridgeAttribute : public vtkGenericAttribute 00038 { 00039 public: 00040 static vtkBridgeAttribute *New(); 00041 vtkTypeMacro(vtkBridgeAttribute,vtkGenericAttribute); 00042 void PrintSelf(ostream& os, vtkIndent indent); 00043 00046 const char *GetName(); 00047 00050 int GetNumberOfComponents(); 00051 00055 int GetCentering(); 00056 00063 int GetType(); 00064 00072 int GetComponentType(); 00073 00075 vtkIdType GetSize(); 00076 00078 unsigned long GetActualMemorySize(); 00079 00084 double *GetRange(int component); 00085 00087 00089 void GetRange(int component, 00090 double range[2]); 00092 00095 double GetMaxNorm(); 00096 00102 virtual double *GetTuple(vtkGenericAdaptorCell *c); 00103 00109 virtual void GetTuple(vtkGenericAdaptorCell *c, double *tuple); 00110 00116 double *GetTuple(vtkGenericCellIterator *c); 00117 00123 void GetTuple(vtkGenericCellIterator *c, double *tuple); 00124 00128 double *GetTuple(vtkGenericPointIterator *p); 00129 00134 void GetTuple(vtkGenericPointIterator *p, double *tuple); 00135 00141 void GetComponent(int i,vtkGenericCellIterator *c, double *values); 00142 00146 double GetComponent(int i,vtkGenericPointIterator *p); 00147 00150 void DeepCopy(vtkGenericAttribute *other); 00151 00154 void ShallowCopy(vtkGenericAttribute *other); 00155 00157 00160 void InitWithPointData(vtkPointData *d, 00161 int i); 00163 00165 00168 void InitWithCellData(vtkCellData *d, 00169 int i); 00171 00172 protected: 00174 vtkBridgeAttribute(); 00176 virtual ~vtkBridgeAttribute(); 00177 00180 void AllocateInternalTuple(int size); 00181 00182 friend class vtkBridgeCell; 00183 00184 // only one of them is non-null at a time. 00185 vtkPointData *Pd; 00186 vtkCellData *Cd; 00187 vtkDataSetAttributes *Data; // always not-null, equal to either on Pd or Cd 00188 int AttributeNumber; 00189 00190 double *InternalTuple; // used by vtkBridgeCell 00191 int InternalTupleCapacity; 00192 00193 private: 00194 vtkBridgeAttribute(const vtkBridgeAttribute&); // Not implemented 00195 void operator=(const vtkBridgeAttribute&); // Not implemented 00196 }; 00197 00198 #endif