00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00040 #ifndef __vtkDataObject_h
00041 #define __vtkDataObject_h
00042
00043 #include "vtkObject.h"
00044
00045 class vtkAlgorithmOutput;
00046 class vtkExecutive;
00047 class vtkFieldData;
00048 class vtkInformation;
00049 class vtkProcessObject;
00050 class vtkSource;
00051 class vtkStreamingDemandDrivenPipelineToDataObjectFriendship;
00052 class vtkExtentTranslator;
00053 class vtkInformationDataObjectKey;
00054 class vtkInformationDoubleKey;
00055 class vtkInformationDoubleVectorKey;
00056 class vtkInformationIntegerKey;
00057 class vtkInformationIntegerPointerKey;
00058 class vtkInformationIntegerVectorKey;
00059 class vtkInformationStringKey;
00060 class vtkInformationVector;
00061 class vtkStreamingDemandDrivenPipeline;
00062 class vtkInformationInformationVectorKey;
00063
00064 #define VTK_PIECES_EXTENT 0
00065 #define VTK_3D_EXTENT 1
00066 #define VTK_TIME_EXTENT 2
00067
00068 class VTK_FILTERING_EXPORT vtkDataObject : public vtkObject
00069 {
00070 public:
00071 static vtkDataObject *New();
00072
00073 vtkTypeRevisionMacro(vtkDataObject,vtkObject);
00074 void PrintSelf(ostream& os, vtkIndent indent);
00075
00077
00078 vtkGetObjectMacro(Source,vtkSource);
00079 void SetSource(vtkSource *s);
00081
00083
00084 vtkGetObjectMacro(Information, vtkInformation);
00085 virtual void SetInformation(vtkInformation*);
00087
00089
00090 vtkGetObjectMacro(PipelineInformation, vtkInformation);
00091 virtual void SetPipelineInformation(vtkInformation*);
00093
00095 virtual vtkAlgorithmOutput* GetProducerPort();
00096
00099 unsigned long int GetMTime();
00100
00102 virtual void Initialize();
00103
00108 void ReleaseData();
00109
00112 int ShouldIReleaseData();
00113
00115
00116 vtkGetMacro(DataReleased,int);
00118
00120
00122 void SetReleaseDataFlag(int);
00123 int GetReleaseDataFlag();
00124 vtkBooleanMacro(ReleaseDataFlag,int);
00126
00128
00130 static void SetGlobalReleaseDataFlag(int val);
00131 void GlobalReleaseDataFlagOn() {this->SetGlobalReleaseDataFlag(1);};
00132 void GlobalReleaseDataFlagOff() {this->SetGlobalReleaseDataFlag(0);};
00133 static int GetGlobalReleaseDataFlag();
00135
00137
00138 virtual void SetFieldData(vtkFieldData*);
00139 vtkGetObjectMacro(FieldData,vtkFieldData);
00141
00142
00143 virtual void Register(vtkObjectBase* o);
00144 virtual void UnRegister(vtkObjectBase* o);
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 piece,int numPieces, int ghostLevel);
00193 void SetUpdateExtent(int piece, int numPieces)
00194 {this->SetUpdateExtent(piece, numPieces, 0);}
00196
00198
00205 virtual void SetUpdateExtent(int x0, int x1, int y0, int y1, int z0, int z1);
00206 virtual void SetUpdateExtent(int extent[6]);
00207 virtual int* GetUpdateExtent();
00208 virtual void GetUpdateExtent(int& x0, int& x1, int& y0, int& y1,
00209 int& z0, int& z1);
00210 virtual void GetUpdateExtent(int extent[6]);
00212
00217 virtual int GetDataObjectType() {return VTK_DATA_OBJECT;}
00218
00221 unsigned long GetUpdateTime();
00222
00227 void SetUpdateExtentToWholeExtent();
00228
00231 unsigned long GetPipelineMTime();
00232
00238 virtual unsigned long GetActualMemorySize();
00239
00241 void CopyInformation( vtkDataObject *data );
00242
00244
00245 virtual void CopyTypeSpecificInformation( vtkDataObject *data )
00246 {this->CopyInformation( data );};
00248
00250
00252 void SetUpdatePiece(int piece);
00253 void SetUpdateNumberOfPieces(int num);
00254 virtual int GetUpdatePiece();
00255 virtual int GetUpdateNumberOfPieces();
00257
00259
00261 void SetUpdateGhostLevel(int level);
00262 virtual int GetUpdateGhostLevel();
00264
00266
00271 virtual void SetRequestExactExtent(int flag);
00272 virtual int GetRequestExactExtent();
00273 vtkBooleanMacro(RequestExactExtent, int);
00275
00277
00280 virtual void SetWholeExtent(int x0, int x1, int y0, int y1, int z0, int z1);
00281 virtual void SetWholeExtent(int extent[6]);
00282 virtual int* GetWholeExtent();
00283 virtual void GetWholeExtent(int& x0, int& x1, int& y0, int& y1,
00284 int& z0, int& z1);
00285 virtual void GetWholeExtent(int extent[6]);
00287
00289
00292 virtual void SetWholeBoundingBox(double x0, double x1, double y0,
00293 double y1, double z0, double z1);
00294 virtual void SetWholeBoundingBox(double bb[6]);
00295 virtual double* GetWholeBoundingBox();
00296 virtual void GetWholeBoundingBox(double& x0, double& x1, double& y0,
00297 double& y1, double& z0, double& z1);
00298 virtual void GetWholeBoundingBox(double extent[6]);
00300
00302
00306 virtual void SetMaximumNumberOfPieces(int);
00307 virtual int GetMaximumNumberOfPieces();
00309
00311
00316 virtual void CopyInformationToPipeline(vtkInformation* request,
00317 vtkInformation* input,
00318 vtkInformation* output,
00319 int forceCopy);
00321
00323
00326 void CopyInformationToPipeline(vtkInformation* request,
00327 vtkInformation* input)
00328 {
00329 this->CopyInformationToPipeline(request, input, this->PipelineInformation, 0);
00330 }
00332
00335 virtual void CopyInformationFromPipeline(vtkInformation* request);
00336
00338
00342 static vtkInformation *GetActiveFieldInformation(vtkInformation *info,
00343 int fieldAssociation, int attributeType);
00345
00347
00350 static vtkInformation *GetNamedFieldInformation(vtkInformation *info,
00351 int fieldAssociation, const char *name);
00353
00355
00356 static void RemoveNamedFieldInformation(vtkInformation *info,
00357 int fieldAssociation,
00358 const char *name);
00360
00362
00367 static vtkInformation *SetActiveAttribute(vtkInformation *info,
00368 int fieldAssociation, const char *attributeName, int attributeType);
00370
00372
00379 static void SetActiveAttributeInfo(vtkInformation *info,
00380 int fieldAssociation, int attributeType, const char *name, int arrayType,
00381 int numComponents, int numTuples);
00383
00385
00388 static void SetPointDataActiveScalarInfo(vtkInformation *info,
00389 int arrayType, int numComponents);
00391
00395 void DataHasBeenGenerated();
00396
00400 virtual void PrepareForNewData() {this->Initialize();};
00401
00403
00405 virtual void ShallowCopy(vtkDataObject *src);
00406 virtual void DeepCopy(vtkDataObject *src);
00408
00410
00411 void SetExtentTranslator(vtkExtentTranslator* translator);
00412 vtkExtentTranslator* GetExtentTranslator();
00414
00421 virtual int GetExtentType() { return VTK_PIECES_EXTENT; };
00422
00425 virtual void Crop();
00426
00427
00429
00430 enum FieldAssociations
00431 {
00432 FIELD_ASSOCIATION_POINTS,
00433 FIELD_ASSOCIATION_CELLS,
00434 FIELD_ASSOCIATION_NONE,
00435 FIELD_ASSOCIATION_POINTS_THEN_CELLS,
00436 FIELD_ASSOCIATION_VERTICES,
00437 FIELD_ASSOCIATION_EDGES,
00438 NUMBER_OF_ASSOCIATIONS
00439 };
00440
00442
00443
00445
00446 enum FieldOperations
00447 {
00448 FIELD_OPERATION_PRESERVED,
00449 FIELD_OPERATION_REINTERPOLATED,
00450 FIELD_OPERATION_MODIFIED,
00451 FIELD_OPERATION_REMOVED
00452 };
00453
00455
00458 static const char* GetAssociationTypeAsString(int associationType);
00459
00460 static vtkInformationStringKey* DATA_TYPE_NAME();
00461 static vtkInformationDataObjectKey* DATA_OBJECT();
00462 static vtkInformationIntegerKey* DATA_EXTENT_TYPE();
00463 static vtkInformationIntegerPointerKey* DATA_EXTENT();
00464 static vtkInformationIntegerKey* DATA_PIECE_NUMBER();
00465 static vtkInformationIntegerKey* DATA_NUMBER_OF_PIECES();
00466 static vtkInformationIntegerKey* DATA_NUMBER_OF_GHOST_LEVELS();
00467 static vtkInformationDoubleVectorKey* DATA_TIME_STEPS();
00468 static vtkInformationInformationVectorKey* POINT_DATA_VECTOR();
00469 static vtkInformationInformationVectorKey* CELL_DATA_VECTOR();
00470 static vtkInformationInformationVectorKey* VERTEX_DATA_VECTOR();
00471 static vtkInformationInformationVectorKey* EDGE_DATA_VECTOR();
00472 static vtkInformationIntegerKey* FIELD_ARRAY_TYPE();
00473 static vtkInformationIntegerKey* FIELD_ASSOCIATION();
00474 static vtkInformationIntegerKey* FIELD_ATTRIBUTE_TYPE();
00475 static vtkInformationIntegerKey* FIELD_ACTIVE_ATTRIBUTE();
00476 static vtkInformationIntegerKey* FIELD_NUMBER_OF_COMPONENTS();
00477 static vtkInformationIntegerKey* FIELD_NUMBER_OF_TUPLES();
00478 static vtkInformationIntegerKey* FIELD_OPERATION();
00479 static vtkInformationDoubleVectorKey* FIELD_RANGE();
00480 static vtkInformationStringKey* FIELD_NAME();
00481 static vtkInformationDoubleVectorKey* ORIGIN();
00482 static vtkInformationDoubleVectorKey* SPACING();
00483 static vtkInformationIntegerKey* DATA_GEOMETRY_UNMODIFIED();
00484
00485
00487
00488 static vtkDataObject* GetData(vtkInformation* info);
00489 static vtkDataObject* GetData(vtkInformationVector* v, int i=0);
00490
00492
00493 protected:
00494
00495 vtkDataObject();
00496 ~vtkDataObject();
00497
00498
00499 vtkFieldData *FieldData;
00500
00501
00502 vtkSource *Source;
00503
00504
00505 int DataReleased;
00506
00507
00508 vtkTimeStamp UpdateTime;
00509
00510
00511 vtkExecutive* GetExecutive();
00512
00513
00514 int GetPortNumber();
00515
00516 virtual void ReportReferences(vtkGarbageCollector*);
00517
00518
00519 vtkInformation* Information;
00520
00521
00522
00523 vtkInformation* PipelineInformation;
00524
00525
00526
00527 vtkStreamingDemandDrivenPipeline* TrySDDP(const char* method);
00528 typedef vtkStreamingDemandDrivenPipeline SDDP;
00529
00530
00531
00532 friend class vtkStreamingDemandDrivenPipelineToDataObjectFriendship;
00533
00534
00535 static const char AssociationNames[NUMBER_OF_ASSOCIATIONS][55];
00536
00537 private:
00538
00539 void InternalDataObjectCopy(vtkDataObject *src);
00540
00541 private:
00542 vtkDataObject(const vtkDataObject&);
00543 void operator=(const vtkDataObject&);
00544 };
00545
00546 #endif
00547