00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00037 #ifndef __vtkDataObject_h
00038 #define __vtkDataObject_h
00039
00040 #include "vtkObject.h"
00041
00042 class vtkAbstractArray;
00043 class vtkAlgorithmOutput;
00044 class vtkDataSetAttributes;
00045 class vtkExecutive;
00046 class vtkFieldData;
00047 class vtkInformation;
00048 class vtkProcessObject;
00049 class vtkSource;
00050 class vtkStreamingDemandDrivenPipelineToDataObjectFriendship;
00051 class vtkExtentTranslator;
00052 class vtkInformationDataObjectKey;
00053 class vtkInformationDoubleKey;
00054 class vtkInformationDoubleVectorKey;
00055 class vtkInformationIntegerKey;
00056 class vtkInformationIntegerPointerKey;
00057 class vtkInformationIntegerVectorKey;
00058 class vtkInformationStringKey;
00059 class vtkInformationVector;
00060 class vtkStreamingDemandDrivenPipeline;
00061 class vtkInformationInformationVectorKey;
00062
00063 #define VTK_PIECES_EXTENT 0
00064 #define VTK_3D_EXTENT 1
00065 #define VTK_TIME_EXTENT 2
00066
00067 class VTK_FILTERING_EXPORT vtkDataObject : public vtkObject
00068 {
00069 public:
00070 static vtkDataObject *New();
00071
00072 vtkTypeRevisionMacro(vtkDataObject,vtkObject);
00073 void PrintSelf(ostream& os, vtkIndent indent);
00074
00076
00077 vtkGetObjectMacro(Source,vtkSource);
00078 void SetSource(vtkSource *s);
00080
00082
00083 vtkGetObjectMacro(Information, vtkInformation);
00084 virtual void SetInformation(vtkInformation*);
00086
00088
00089 vtkGetObjectMacro(PipelineInformation, vtkInformation);
00090 virtual void SetPipelineInformation(vtkInformation*);
00092
00094 virtual vtkAlgorithmOutput* GetProducerPort();
00095
00098 unsigned long int GetMTime();
00099
00101 virtual void Initialize();
00102
00107 void ReleaseData();
00108
00111 int ShouldIReleaseData();
00112
00114
00115 vtkGetMacro(DataReleased,int);
00117
00119
00121 void SetReleaseDataFlag(int);
00122 int GetReleaseDataFlag();
00123 vtkBooleanMacro(ReleaseDataFlag,int);
00125
00127
00129 static void SetGlobalReleaseDataFlag(int val);
00130 void GlobalReleaseDataFlagOn() {this->SetGlobalReleaseDataFlag(1);};
00131 void GlobalReleaseDataFlagOff() {this->SetGlobalReleaseDataFlag(0);};
00132 static int GetGlobalReleaseDataFlag();
00134
00136
00137 virtual void SetFieldData(vtkFieldData*);
00138 vtkGetObjectMacro(FieldData,vtkFieldData);
00140
00141
00142 virtual void Register(vtkObjectBase* o);
00143 virtual void UnRegister(vtkObjectBase* o);
00144
00150 virtual void Update();
00151
00157 virtual void UpdateInformation();
00158
00163 virtual void PropagateUpdateExtent();
00164
00170 virtual void TriggerAsynchronousUpdate();
00171
00178 virtual void UpdateData();
00179
00185 virtual unsigned long GetEstimatedMemorySize();
00186
00188
00191 virtual void SetUpdateExtent(int piece,int numPieces, int ghostLevel);
00192 void SetUpdateExtent(int piece, int numPieces)
00193 {this->SetUpdateExtent(piece, numPieces, 0);}
00195
00197
00204 virtual void SetUpdateExtent(int x0, int x1, int y0, int y1, int z0, int z1);
00205 virtual void SetUpdateExtent(int extent[6]);
00206 virtual int* GetUpdateExtent();
00207 virtual void GetUpdateExtent(int& x0, int& x1, int& y0, int& y1,
00208 int& z0, int& z1);
00209 virtual void GetUpdateExtent(int extent[6]);
00211
00216 virtual int GetDataObjectType() {return VTK_DATA_OBJECT;}
00217
00220 unsigned long GetUpdateTime();
00221
00226 void SetUpdateExtentToWholeExtent();
00227
00230 unsigned long GetPipelineMTime();
00231
00237 virtual unsigned long GetActualMemorySize();
00238
00240 void CopyInformation( vtkDataObject *data );
00241
00243
00244 virtual void CopyTypeSpecificInformation( vtkDataObject *data )
00245 {this->CopyInformation( data );};
00247
00249
00251 void SetUpdatePiece(int piece);
00252 void SetUpdateNumberOfPieces(int num);
00253 virtual int GetUpdatePiece();
00254 virtual int GetUpdateNumberOfPieces();
00256
00258
00260 void SetUpdateGhostLevel(int level);
00261 virtual int GetUpdateGhostLevel();
00263
00265
00270 virtual void SetRequestExactExtent(int flag);
00271 virtual int GetRequestExactExtent();
00272 vtkBooleanMacro(RequestExactExtent, int);
00274
00276
00279 virtual void SetWholeExtent(int x0, int x1, int y0, int y1, int z0, int z1);
00280 virtual void SetWholeExtent(int extent[6]);
00281 virtual int* GetWholeExtent();
00282 virtual void GetWholeExtent(int& x0, int& x1, int& y0, int& y1,
00283 int& z0, int& z1);
00284 virtual void GetWholeExtent(int extent[6]);
00286
00288
00291 virtual void SetWholeBoundingBox(double x0, double x1, double y0,
00292 double y1, double z0, double z1);
00293 virtual void SetWholeBoundingBox(double bb[6]);
00294 virtual double* GetWholeBoundingBox();
00295 virtual void GetWholeBoundingBox(double& x0, double& x1, double& y0,
00296 double& y1, double& z0, double& z1);
00297 virtual void GetWholeBoundingBox(double extent[6]);
00299
00301
00305 virtual void SetMaximumNumberOfPieces(int);
00306 virtual int GetMaximumNumberOfPieces();
00308
00310
00315 virtual void CopyInformationToPipeline(vtkInformation* request,
00316 vtkInformation* input,
00317 vtkInformation* output,
00318 int forceCopy);
00320
00322
00325 void CopyInformationToPipeline(vtkInformation* request,
00326 vtkInformation* input)
00327 {
00328 this->CopyInformationToPipeline(request, input, this->PipelineInformation, 0);
00329 }
00331
00334 virtual void CopyInformationFromPipeline(vtkInformation* request);
00335
00337
00341 static vtkInformation *GetActiveFieldInformation(vtkInformation *info,
00342 int fieldAssociation, int attributeType);
00344
00346
00349 static vtkInformation *GetNamedFieldInformation(vtkInformation *info,
00350 int fieldAssociation, const char *name);
00352
00354
00355 static void RemoveNamedFieldInformation(vtkInformation *info,
00356 int fieldAssociation,
00357 const char *name);
00359
00361
00366 static vtkInformation *SetActiveAttribute(vtkInformation *info,
00367 int fieldAssociation, const char *attributeName, int attributeType);
00369
00371
00378 static void SetActiveAttributeInfo(vtkInformation *info,
00379 int fieldAssociation, int attributeType, const char *name, int arrayType,
00380 int numComponents, int numTuples);
00382
00384
00387 static void SetPointDataActiveScalarInfo(vtkInformation *info,
00388 int arrayType, int numComponents);
00390
00394 void DataHasBeenGenerated();
00395
00399 virtual void PrepareForNewData() {this->Initialize();};
00400
00402
00404 virtual void ShallowCopy(vtkDataObject *src);
00405 virtual void DeepCopy(vtkDataObject *src);
00407
00409
00410 void SetExtentTranslator(vtkExtentTranslator* translator);
00411 vtkExtentTranslator* GetExtentTranslator();
00413
00420 virtual int GetExtentType() { return VTK_PIECES_EXTENT; };
00421
00424 virtual void Crop();
00425
00426
00428
00429 enum FieldAssociations
00430 {
00431 FIELD_ASSOCIATION_POINTS,
00432 FIELD_ASSOCIATION_CELLS,
00433 FIELD_ASSOCIATION_NONE,
00434 FIELD_ASSOCIATION_POINTS_THEN_CELLS,
00435 FIELD_ASSOCIATION_VERTICES,
00436 FIELD_ASSOCIATION_EDGES,
00437 FIELD_ASSOCIATION_ROWS,
00438 NUMBER_OF_ASSOCIATIONS
00439 };
00440
00442
00443
00445
00447 enum AttributeTypes
00448 {
00449 POINT,
00450 CELL,
00451 FIELD,
00452 POINT_THEN_CELL,
00453 VERTEX,
00454 EDGE,
00455 ROW,
00456 NUMBER_OF_ATTRIBUTE_TYPES
00457 };
00458
00460
00469 virtual vtkDataSetAttributes* GetAttributes(int type);
00470
00475 virtual vtkFieldData* GetAttributesAsFieldData(int type);
00476
00480 virtual int GetAttributeTypeForArray(vtkAbstractArray* arr);
00481
00484 virtual vtkIdType GetNumberOfElements(int type);
00485
00486
00488
00489 enum FieldOperations
00490 {
00491 FIELD_OPERATION_PRESERVED,
00492 FIELD_OPERATION_REINTERPOLATED,
00493 FIELD_OPERATION_MODIFIED,
00494 FIELD_OPERATION_REMOVED
00495 };
00496
00498
00501 static const char* GetAssociationTypeAsString(int associationType);
00502
00503 static vtkInformationStringKey* DATA_TYPE_NAME();
00504 static vtkInformationDataObjectKey* DATA_OBJECT();
00505 static vtkInformationIntegerKey* DATA_EXTENT_TYPE();
00506 static vtkInformationIntegerPointerKey* DATA_EXTENT();
00507 static vtkInformationIntegerKey* DATA_PIECE_NUMBER();
00508 static vtkInformationIntegerKey* DATA_NUMBER_OF_PIECES();
00509 static vtkInformationIntegerKey* DATA_NUMBER_OF_GHOST_LEVELS();
00510 static vtkInformationDoubleKey* DATA_RESOLUTION();
00511 static vtkInformationDoubleVectorKey* DATA_TIME_STEPS();
00512 static vtkInformationInformationVectorKey* POINT_DATA_VECTOR();
00513 static vtkInformationInformationVectorKey* CELL_DATA_VECTOR();
00514 static vtkInformationInformationVectorKey* VERTEX_DATA_VECTOR();
00515 static vtkInformationInformationVectorKey* EDGE_DATA_VECTOR();
00516 static vtkInformationIntegerKey* FIELD_ARRAY_TYPE();
00517 static vtkInformationIntegerKey* FIELD_ASSOCIATION();
00518 static vtkInformationIntegerKey* FIELD_ATTRIBUTE_TYPE();
00519 static vtkInformationIntegerKey* FIELD_ACTIVE_ATTRIBUTE();
00520 static vtkInformationIntegerKey* FIELD_NUMBER_OF_COMPONENTS();
00521 static vtkInformationIntegerKey* FIELD_NUMBER_OF_TUPLES();
00522 static vtkInformationIntegerKey* FIELD_OPERATION();
00523 static vtkInformationDoubleVectorKey* FIELD_RANGE();
00524 static vtkInformationDoubleVectorKey* PIECE_FIELD_RANGE();
00525 static vtkInformationIntegerVectorKey* PIECE_EXTENT();
00526 static vtkInformationStringKey* FIELD_NAME();
00527 static vtkInformationDoubleVectorKey* ORIGIN();
00528 static vtkInformationDoubleVectorKey* SPACING();
00529 static vtkInformationIntegerKey* DATA_GEOMETRY_UNMODIFIED();
00530
00531
00532 static vtkInformationDataObjectKey* SIL();
00533
00534
00536
00537 static vtkDataObject* GetData(vtkInformation* info);
00538 static vtkDataObject* GetData(vtkInformationVector* v, int i=0);
00539
00541
00542 protected:
00543
00544 vtkDataObject();
00545 ~vtkDataObject();
00546
00547
00548 vtkFieldData *FieldData;
00549
00550
00551 vtkSource *Source;
00552
00553
00554 int DataReleased;
00555
00556
00557 vtkTimeStamp UpdateTime;
00558
00559
00560 vtkExecutive* GetExecutive();
00561
00562
00563 int GetPortNumber();
00564
00565 virtual void ReportReferences(vtkGarbageCollector*);
00566
00567
00568 vtkInformation* Information;
00569
00570
00571
00572 vtkInformation* PipelineInformation;
00573
00574
00575
00576 vtkStreamingDemandDrivenPipeline* TrySDDP(const char* method);
00577 typedef vtkStreamingDemandDrivenPipeline SDDP;
00578
00579
00580
00581 friend class vtkStreamingDemandDrivenPipelineToDataObjectFriendship;
00582
00583
00584 static const char AssociationNames[NUMBER_OF_ASSOCIATIONS][55];
00585
00586 private:
00587
00588 void InternalDataObjectCopy(vtkDataObject *src);
00589
00590 private:
00591 vtkDataObject(const vtkDataObject&);
00592 void operator=(const vtkDataObject&);
00593 };
00594
00595 #endif
00596