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
00062 #ifndef __vtkDataObject_h
00063 #define __vtkDataObject_h
00064
00065 #include "vtkObject.h"
00066 #include "vtkFieldData.h"
00067
00068 class vtkProcessObject;
00069 class vtkSource;
00070 class vtkExtentTranslator;
00071
00072 #define VTK_PIECES_EXTENT 0
00073 #define VTK_3D_EXTENT 1
00074
00075 class VTK_COMMON_EXPORT vtkDataObject : public vtkObject
00076 {
00077 public:
00078 static vtkDataObject *New();
00079
00080 vtkTypeMacro(vtkDataObject,vtkObject);
00081 void PrintSelf(ostream& os, vtkIndent indent);
00082
00084 virtual vtkDataObject *MakeObject() {return vtkDataObject::New();}
00085
00087
00088 vtkGetObjectMacro(Source,vtkSource);
00089 void SetSource(vtkSource *s);
00091
00094 unsigned long int GetMTime();
00095
00096
00097
00098 virtual void Initialize();
00099
00104 void ReleaseData();
00105
00108 int ShouldIReleaseData();
00109
00111
00112 vtkGetMacro(DataReleased,int);
00114
00116
00118 vtkSetMacro(ReleaseDataFlag,int);
00119 vtkGetMacro(ReleaseDataFlag,int);
00120 vtkBooleanMacro(ReleaseDataFlag,int);
00122
00124
00126 static void SetGlobalReleaseDataFlag(int val);
00127 void GlobalReleaseDataFlagOn() {this->SetGlobalReleaseDataFlag(1);};
00128 void GlobalReleaseDataFlagOff() {this->SetGlobalReleaseDataFlag(0);};
00129 static int GetGlobalReleaseDataFlag();
00131
00133
00134 vtkSetObjectMacro(FieldData,vtkFieldData);
00135 vtkGetObjectMacro(FieldData,vtkFieldData);
00137
00138
00139 void UnRegister(vtkObject *o);
00140
00144 virtual int GetNetReferenceCount() {return this->ReferenceCount;};
00145
00151 virtual void Update();
00152
00158 virtual void UpdateInformation();
00159
00164 virtual void PropagateUpdateExtent();
00165
00171 virtual void TriggerAsynchronousUpdate();
00172
00179 virtual void UpdateData();
00180
00186 virtual unsigned long GetEstimatedMemorySize();
00187
00189
00192 virtual void SetUpdateExtent(int vtkNotUsed(piece),int vtkNotUsed(numPieces),
00193 int vtkNotUsed(ghostLevel))
00194 {vtkErrorMacro("Subclass did not implement 'SetUpdateExtent'");}
00195 void SetUpdateExtent(int piece, int numPieces)
00196 {this->SetUpdateExtent(piece, numPieces, 0);}
00198
00200
00207 virtual void SetUpdateExtent(int x1, int x2, int y1, int y2, int z1, int z2);
00208 virtual void SetUpdateExtent( int ext[6] );
00209 vtkGetVector6Macro( UpdateExtent, int );
00211
00216 virtual int GetDataObjectType() {return VTK_DATA_OBJECT;}
00217
00220 unsigned long GetUpdateTime();
00221
00226 void SetUpdateExtentToWholeExtent();
00227
00228 void SetPipelineMTime(unsigned long time) {this->PipelineMTime = time; }
00229 vtkGetMacro(PipelineMTime, unsigned long);
00230
00236 virtual unsigned long GetActualMemorySize();
00237
00239 void CopyInformation( vtkDataObject *data );
00240
00242
00243 virtual void CopyTypeSpecificInformation( vtkDataObject *data )
00244 {this->CopyInformation( data );};
00246
00248
00250 void SetUpdatePiece(int piece);
00251 void SetUpdateNumberOfPieces(int num);
00252 vtkGetMacro( UpdatePiece, int );
00253 vtkGetMacro( UpdateNumberOfPieces, int );
00255
00257
00259 void SetUpdateGhostLevel(int level);
00260 vtkGetMacro(UpdateGhostLevel, int);
00262
00264
00269 void SetRequestExactExtent(int v);
00270 vtkGetMacro(RequestExactExtent, int);
00271 vtkBooleanMacro(RequestExactExtent, int);
00273
00275
00278 vtkSetVector6Macro( WholeExtent, int );
00279 vtkGetVector6Macro( WholeExtent, int );
00281
00283
00287 vtkSetMacro( MaximumNumberOfPieces, int );
00288 vtkGetMacro( MaximumNumberOfPieces, int );
00290
00294 void DataHasBeenGenerated();
00295
00299 virtual void PrepareForNewData() {this->Initialize();};
00300
00302
00304 virtual void ShallowCopy(vtkDataObject *src);
00305 virtual void DeepCopy(vtkDataObject *src);
00307
00309
00312 vtkSetMacro(Locality, float);
00313 vtkGetMacro(Locality, float);
00315
00317
00318 void SetExtentTranslator(vtkExtentTranslator *translator);
00319 vtkExtentTranslator *GetExtentTranslator();
00321
00323
00324 vtkGetMacro(NumberOfConsumers,int);
00326
00328
00329 void AddConsumer(vtkProcessObject *c);
00330 void RemoveConsumer(vtkProcessObject *c);
00331 vtkProcessObject *GetConsumer(int i);
00332 int IsConsumer(vtkProcessObject *c);
00334
00335
00336 protected:
00337
00338 vtkDataObject();
00339 ~vtkDataObject();
00340
00341
00342 vtkFieldData *FieldData;
00343
00344
00345 vtkSource *Source;
00346
00347
00348 int DataReleased;
00349
00350
00351 int NumberOfConsumers;
00352 vtkProcessObject **Consumers;
00353
00355 int UpdateExtentIsOutsideOfTheExtent();
00356
00361 int UpdateExtentIsEmpty();
00362
00370 virtual int VerifyUpdateExtent();
00371
00372
00373
00374
00375
00376
00377
00378 virtual int GetExtentType() { return VTK_PIECES_EXTENT; };
00379
00380
00381
00382
00383 int WholeExtent[6];
00384 int Extent[6];
00385 int UpdateExtent[6];
00386
00387 unsigned char UpdateExtentInitialized;
00388
00389 vtkExtentTranslator *ExtentTranslator;
00390
00391
00392 int NumberOfPieces;
00393 int Piece;
00394 int MaximumNumberOfPieces;
00395 int UpdateNumberOfPieces;
00396 int UpdatePiece;
00397
00398
00399
00400
00401
00402
00403
00404 int RequestExactExtent;
00405
00406
00407
00408 virtual void Crop();
00409
00410 int GhostLevel;
00411 int UpdateGhostLevel;
00412
00413
00414 int ReleaseDataFlag;
00415
00416
00417 vtkTimeStamp UpdateTime;
00418
00419
00420
00421 unsigned long PipelineMTime;
00422
00423
00424 int LastUpdateExtentWasOutsideOfTheExtent;
00425
00426
00427
00428
00429
00430
00431 float Locality;
00432
00433 private:
00434
00435 void InternalDataObjectCopy(vtkDataObject *src);
00436 private:
00437 vtkDataObject(const vtkDataObject&);
00438 void operator=(const vtkDataObject&);
00439 };
00440
00441 #endif
00442