VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Testing/GenericBridge/vtkBridgeAttribute.h
Go to the documentation of this file.
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 
00101   virtual double *GetTuple(vtkGenericAdaptorCell *c);
00102 
00107   virtual void GetTuple(vtkGenericAdaptorCell *c, double *tuple);
00108 
00113   double *GetTuple(vtkGenericCellIterator *c);
00114 
00119   void GetTuple(vtkGenericCellIterator *c, double *tuple);
00120 
00124   double *GetTuple(vtkGenericPointIterator *p);
00125 
00130   void GetTuple(vtkGenericPointIterator *p, double *tuple);
00131 
00137   void GetComponent(int i,vtkGenericCellIterator *c, double *values);
00138 
00142   double GetComponent(int i,vtkGenericPointIterator *p);
00143 
00146   void DeepCopy(vtkGenericAttribute *other);
00147 
00150   void ShallowCopy(vtkGenericAttribute *other);
00151 
00153 
00156   void InitWithPointData(vtkPointData *d,
00157                          int i);
00159 
00161 
00164   void InitWithCellData(vtkCellData *d,
00165                         int i);
00167 
00168 protected:
00170   vtkBridgeAttribute();
00172   virtual ~vtkBridgeAttribute();
00173 
00176   void AllocateInternalTuple(int size);
00177 
00178   friend class vtkBridgeCell;
00179 
00180   // only one of them is non-null at a time.
00181   vtkPointData *Pd;
00182   vtkCellData *Cd;
00183   vtkDataSetAttributes *Data; // always not-null, equal to either on Pd or Cd
00184   int AttributeNumber;
00185 
00186   double *InternalTuple; // used by vtkBridgeCell
00187   int InternalTupleCapacity;
00188 
00189 private:
00190   vtkBridgeAttribute(const vtkBridgeAttribute&); // Not implemented
00191   void operator=(const vtkBridgeAttribute&); // Not implemented
00192 };
00193 
00194 #endif