Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

common/vtkDataSetAttributes.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkDataSetAttributes.h,v $
00005   Language:  C++
00006 
00007 
00008 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00009 All rights reserved.
00010 
00011 Redistribution and use in source and binary forms, with or without
00012 modification, are permitted provided that the following conditions are met:
00013 
00014  * Redistributions of source code must retain the above copyright notice,
00015    this list of conditions and the following disclaimer.
00016 
00017  * Redistributions in binary form must reproduce the above copyright notice,
00018    this list of conditions and the following disclaimer in the documentation
00019    and/or other materials provided with the distribution.
00020 
00021  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00022    of any contributors may be used to endorse or promote products derived
00023    from this software without specific prior written permission.
00024 
00025  * Modified source versions must be plainly marked as such, and must not be
00026    misrepresented as being the original software.
00027 
00028 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00029 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00030 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00031 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00032 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00033 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00034 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00035 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00036 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00037 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00038 
00039 =========================================================================*/
00054 #ifndef __vtkDataSetAttributes_h
00055 #define __vtkDataSetAttributes_h
00056 
00057 #include "vtkObject.h"
00058 #include "vtkScalars.h"
00059 #include "vtkVectors.h"
00060 #include "vtkNormals.h"
00061 #include "vtkTCoords.h"
00062 #include "vtkTensors.h"
00063 #include "vtkFieldData.h"
00064 #include "vtkGhostLevels.h"
00065 
00066 class VTK_EXPORT vtkDataSetAttributes : public vtkObject
00067 {
00068 public:
00070   static vtkDataSetAttributes *New();
00071   
00072   vtkTypeMacro(vtkDataSetAttributes,vtkObject);
00073   void PrintSelf(ostream& os, vtkIndent indent);
00074 
00076   void Initialize();
00077 
00080   virtual void Update() {};
00081 
00084   void PassData(vtkDataSetAttributes* pd);
00085 
00089   void PassNoReplaceData(vtkDataSetAttributes* pd);
00090 
00095   void CopyAllocate(vtkDataSetAttributes* pd, int sze=0, int ext=1000);
00096 
00099   void CopyData(vtkDataSetAttributes *fromPd, int fromId, int toId);
00100 
00102   void InterpolateAllocate(vtkDataSetAttributes* pd, int sze=0, int ext=1000);
00103   
00106   void InterpolatePoint(vtkDataSetAttributes *fromPd, int toId, 
00107                         vtkIdList *ids, float *weights);
00108   
00113   void InterpolateEdge(vtkDataSetAttributes *fromPd, int toId, int p1, int p2,
00114                         float t);
00115 
00123   void InterpolateTime(vtkDataSetAttributes *from1, vtkDataSetAttributes *from2,
00124                        int id, float t);
00125 
00128   void DeepCopy(vtkDataSetAttributes *pd);
00129 
00131   void ShallowCopy(vtkDataSetAttributes *pd);
00132 
00134   void Squeeze();
00135 
00137   unsigned long int GetMTime();
00138 
00140   vtkSetObjectMacro(Scalars,vtkScalars);
00141   vtkGetObjectMacro(Scalars,vtkScalars);
00142 
00144   vtkSetObjectMacro(Vectors,vtkVectors);
00145   vtkGetObjectMacro(Vectors,vtkVectors);
00146 
00148   vtkSetObjectMacro(Normals,vtkNormals);
00149   vtkGetObjectMacro(Normals,vtkNormals);
00150 
00152   vtkSetObjectMacro(GhostLevels, vtkGhostLevels);
00153   vtkGetObjectMacro(GhostLevels, vtkGhostLevels);
00154 
00156   vtkSetObjectMacro(TCoords,vtkTCoords);
00157   vtkGetObjectMacro(TCoords,vtkTCoords);
00158 
00160   vtkSetObjectMacro(Tensors,vtkTensors);
00161   vtkGetObjectMacro(Tensors,vtkTensors);
00162 
00164   vtkSetObjectMacro(FieldData,vtkFieldData);
00165   vtkGetObjectMacro(FieldData,vtkFieldData);
00166 
00168   vtkSetMacro(CopyScalars,int);
00169   vtkGetMacro(CopyScalars,int);
00170   vtkBooleanMacro(CopyScalars,int);
00171 
00173   vtkSetMacro(CopyVectors,int);
00174   vtkGetMacro(CopyVectors,int);
00175   vtkBooleanMacro(CopyVectors,int);
00176 
00178   vtkSetMacro(CopyGhostLevels, int);
00179   vtkGetMacro(CopyGhostLevels, int);
00180   vtkBooleanMacro(CopyGhostLevels, int);
00181 
00183   vtkSetMacro(CopyNormals,int);
00184   vtkGetMacro(CopyNormals,int);
00185   vtkBooleanMacro(CopyNormals,int);
00186 
00188   vtkSetMacro(CopyTCoords,int);
00189   vtkGetMacro(CopyTCoords,int);
00190   vtkBooleanMacro(CopyTCoords,int);
00191 
00193   vtkSetMacro(CopyTensors,int);
00194   vtkGetMacro(CopyTensors,int);
00195   vtkBooleanMacro(CopyTensors,int);
00196 
00198   vtkSetMacro(CopyFieldData,int);
00199   vtkGetMacro(CopyFieldData,int);
00200   vtkBooleanMacro(CopyFieldData,int);
00201 
00206   int GetAnyEnabled() {return this->AnyEnabled;}
00207 
00209   void CopyAllOn();
00210 
00212   void CopyAllOff();
00213 
00218   void CopyTuple(vtkDataArray *fromData, vtkDataArray *toData, int fromId, 
00219                  int toId);
00220 
00227   unsigned long GetActualMemorySize();
00228   
00229 #ifndef VTK_REMOVE_LEGACY_CODE
00230 
00231   void DeepCopy(vtkDataSetAttributes &pd) 
00232     {VTK_LEGACY_METHOD(DeepCopy,"3.2"); this->DeepCopy(&pd);}
00233   void ShallowCopy(vtkDataSetAttributes &pd) 
00234     {VTK_LEGACY_METHOD(ShalowCopy,"3.2"); this->ShallowCopy(&pd);}
00235 #endif
00236   
00237 protected:
00238   vtkDataSetAttributes();
00239   ~vtkDataSetAttributes();
00240   vtkDataSetAttributes(const vtkDataSetAttributes&) {};
00241   void operator=(const vtkDataSetAttributes&) {};
00242 
00243   // special methods to support managing data
00244   void InterpolateTuple(vtkDataArray *fromData, vtkDataArray *toData, int toId,
00245                         vtkIdList *ptIds, float *weights);
00246   void InterpolateTuple(vtkDataArray *fromData, vtkDataArray *toData, int toId,
00247                         int id1, int id2, float t);
00248   void InterpolateTuple(vtkDataArray *fromData1, vtkDataArray *fromData2, 
00249                         vtkDataArray *toData, int id, float t);
00250   
00251   // support manipulation and access of attribute data
00252   vtkScalars *Scalars;
00253   vtkVectors *Vectors;
00254   vtkNormals *Normals;
00255   vtkTCoords *TCoords;
00256   vtkTensors *Tensors;
00257   vtkFieldData *FieldData;
00258   vtkGhostLevels *GhostLevels;
00259 
00260   // User flags control whether data is to be copied
00261   int CopyScalars;
00262   int CopyVectors;
00263   int CopyNormals;
00264   int CopyTCoords;
00265   int CopyTensors;
00266   int CopyFieldData;
00267   int CopyGhostLevels;
00268 
00269   // Flags are evaluated in CopyAllocate to determine whether copying is possible
00270   int AnyEnabled;
00271   int CopyScalarsEnabled;
00272   int CopyVectorsEnabled;
00273   int CopyNormalsEnabled;
00274   int CopyTCoordsEnabled;
00275   int CopyTensorsEnabled;
00276   int CopyFieldDataEnabled;
00277   int CopyGhostLevelsEnabled;
00278 
00279   // used to set null values
00280   float Null3Tuple[3];
00281   float Null4Tuple[4];
00282   vtkTensor *NullTensor;
00283   float *NullTuple;
00284   int TupleSize;
00285   float *Tuple;
00286 };
00287 
00288 #endif
00289 
00290 

Generated on Wed Nov 21 12:26:51 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001