00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00061 #ifndef __vtkDataObject_h
00062 #define __vtkDataObject_h
00063
00064 #include "vtkObject.h"
00065 #include "vtkFieldData.h"
00066
00067 class vtkSource;
00068 class vtkExtentTranslator;
00069
00070 #define VTK_PIECES_EXTENT 0
00071 #define VTK_3D_EXTENT 1
00072
00073 class VTK_EXPORT vtkDataObject : public vtkObject
00074 {
00075 public:
00076 static vtkDataObject *New();
00077
00078 vtkTypeMacro(vtkDataObject,vtkObject);
00079 void PrintSelf(ostream& os, vtkIndent indent);
00080
00082 virtual vtkDataObject *MakeObject() {return vtkDataObject::New();}
00083
00085 vtkGetObjectMacro(Source,vtkSource);
00086 void SetSource(vtkSource *s);
00087
00090 unsigned long int GetMTime();
00091
00092
00093
00094 virtual void Initialize();
00095
00100 void ReleaseData();
00101
00104 int ShouldIReleaseData();
00105
00107 vtkGetMacro(DataReleased,int);
00108
00111 vtkSetMacro(ReleaseDataFlag,int);
00112 vtkGetMacro(ReleaseDataFlag,int);
00113 vtkBooleanMacro(ReleaseDataFlag,int);
00114
00117 static void SetGlobalReleaseDataFlag(int val);
00118 void GlobalReleaseDataFlagOn() {this->SetGlobalReleaseDataFlag(1);};
00119 void GlobalReleaseDataFlagOff() {this->SetGlobalReleaseDataFlag(0);};
00120 static int GetGlobalReleaseDataFlag();
00121
00123 vtkSetObjectMacro(FieldData,vtkFieldData);
00124 vtkGetObjectMacro(FieldData,vtkFieldData);
00125
00126
00127 void UnRegister(vtkObject *o);
00128
00132 virtual int GetNetReferenceCount() {return this->ReferenceCount;};
00133
00139 virtual void Update();
00140
00146 virtual void UpdateInformation();
00147
00152 virtual void PropagateUpdateExtent();
00153
00159 virtual void TriggerAsynchronousUpdate();
00160
00167 virtual void UpdateData();
00168
00172 unsigned long GetEstimatedPipelineMemorySize();
00173
00179 virtual unsigned long GetEstimatedMemorySize();
00180
00191 void ComputeEstimatedPipelineMemorySize( unsigned long sizes[3] );
00192
00196 virtual void SetUpdateExtent(int vtkNotUsed(piece),int vtkNotUsed(numPieces),
00197 int vtkNotUsed(ghostLevel))
00198 {vtkErrorMacro("Subclass did not implement 'SetUpdateExtent'");}
00199 void SetUpdateExtent(int piece, int numPieces)
00200 {this->SetUpdateExtent(piece, numPieces, 0);}
00201
00209 virtual void SetUpdateExtent(int x1, int x2, int y1, int y2, int z1, int z2);
00210 virtual void SetUpdateExtent( int ext[6] );
00211 vtkGetVector6Macro( UpdateExtent, int );
00212
00217 virtual int GetDataObjectType() {return VTK_DATA_OBJECT;}
00218
00221 unsigned long GetUpdateTime();
00222
00227 void SetUpdateExtentToWholeExtent();
00228
00229 void SetPipelineMTime(unsigned long time) {this->PipelineMTime = time; }
00230 vtkGetMacro(PipelineMTime, unsigned long);
00231
00237 virtual unsigned long GetActualMemorySize();
00238
00240 void CopyInformation( vtkDataObject *data );
00241
00243 virtual void CopyTypeSpecificInformation( vtkDataObject *data )
00244 {this->CopyInformation( data );};
00245
00248 void SetUpdatePiece(int piece);
00249 void SetUpdateNumberOfPieces(int num);
00250 vtkGetMacro( UpdatePiece, int );
00251 vtkGetMacro( UpdateNumberOfPieces, int );
00252
00255 void SetUpdateGhostLevel(int level);
00256 vtkGetMacro(UpdateGhostLevel, int);
00257
00259 vtkSetVector6Macro( WholeExtent, int );
00260 vtkGetVector6Macro( WholeExtent, int );
00261
00265 void DataHasBeenGenerated();
00266
00270 virtual void PrepareForNewData() {this->Initialize();};
00271
00274 virtual void ShallowCopy(vtkDataObject *src);
00275 virtual void DeepCopy(vtkDataObject *src);
00276
00280 vtkSetMacro(Locality, float);
00281 vtkGetMacro(Locality, float);
00282
00284 void SetExtentTranslator(vtkExtentTranslator *translator);
00285 vtkExtentTranslator *GetExtentTranslator();
00286
00287 protected:
00288
00289 vtkDataObject();
00290 ~vtkDataObject();
00291 vtkDataObject(const vtkDataObject&) {};
00292 void operator=(const vtkDataObject&) {};
00293
00294
00295 vtkFieldData *FieldData;
00296
00297
00298 vtkSource *Source;
00299
00300
00301 int DataReleased;
00302
00304 int UpdateExtentIsOutsideOfTheExtent();
00305
00310 int UpdateExtentIsEmpty();
00311
00319 virtual int VerifyUpdateExtent();
00320
00321
00322
00323
00324
00325
00326
00327 virtual int GetExtentType() { return VTK_PIECES_EXTENT; };
00328
00329
00330
00331
00332 int WholeExtent[6];
00333 int Extent[6];
00334 int UpdateExtent[6];
00335
00336 unsigned char UpdateExtentInitialized;
00337
00338 vtkExtentTranslator *ExtentTranslator;
00339
00340
00341 int NumberOfPieces;
00342 int Piece;
00343 int UpdateNumberOfPieces;
00344 int UpdatePiece;
00345
00346 int GhostLevel;
00347 int UpdateGhostLevel;
00348
00349
00350 int ReleaseDataFlag;
00351
00352
00353 vtkTimeStamp UpdateTime;
00354
00355
00356
00357 unsigned long EstimatedWholeMemorySize;
00358
00359
00360
00361 unsigned long PipelineMTime;
00362
00363
00364 int LastUpdateExtentWasOutsideOfTheExtent;
00365
00366
00367
00368
00369
00370
00371 float Locality;
00372
00373 private:
00374
00375 void InternalDataObjectCopy(vtkDataObject *src);
00376 };
00377
00378 #endif
00379