Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkDataObject.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkDataObject.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00045 #ifndef __vtkDataObject_h
00046 #define __vtkDataObject_h
00047 
00048 #include "vtkObject.h"
00049 
00050 class vtkAlgorithmOutput;
00051 class vtkExecutive;
00052 class vtkFieldData;
00053 class vtkInformation;
00054 class vtkProcessObject;
00055 class vtkSource;
00056 class vtkStreamingDemandDrivenPipelineToDataObjectFriendship;
00057 class vtkExtentTranslator;
00058 class vtkInformationDataObjectKey;
00059 class vtkInformationDoubleVectorKey;
00060 class vtkInformationIntegerKey;
00061 class vtkInformationIntegerVectorKey;
00062 class vtkInformationStringKey;
00063 class vtkStreamingDemandDrivenPipeline;
00064 
00065 #define VTK_PIECES_EXTENT   0
00066 #define VTK_3D_EXTENT       1
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   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   // Handle the source/data loop.
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 vtkNotUsed(piece),int vtkNotUsed(numPieces),
00192                                int vtkNotUsed(ghostLevel))
00193     {vtkErrorMacro("Subclass did not implement 'SetUpdateExtent'");}
00194   void SetUpdateExtent(int piece, int numPieces)
00195     {this->SetUpdateExtent(piece, numPieces, 0);}
00197 
00199 
00206   virtual void SetUpdateExtent(int x0, int x1, int y0, int y1, int z0, int z1);
00207   virtual void SetUpdateExtent(int extent[6]);
00208   virtual int* GetUpdateExtent();
00209   virtual void GetUpdateExtent(int& x0, int& x1, int& y0, int& y1,
00210                                int& z0, int& z1);
00211   virtual void GetUpdateExtent(int extent[6]);
00213 
00218   virtual int GetDataObjectType() {return VTK_DATA_OBJECT;}
00219   
00222   unsigned long GetUpdateTime();
00223 
00228   void SetUpdateExtentToWholeExtent();
00229 
00232   unsigned long GetPipelineMTime();
00233 
00239   virtual unsigned long GetActualMemorySize();
00240 
00242   void CopyInformation( vtkDataObject *data );
00243 
00245 
00246   virtual void CopyTypeSpecificInformation( vtkDataObject *data ) 
00247     {this->CopyInformation( data );};
00249   
00251 
00253   void SetUpdatePiece(int piece);
00254   void SetUpdateNumberOfPieces(int num);
00255   virtual int GetUpdatePiece();
00256   virtual int GetUpdateNumberOfPieces();
00258   
00260 
00262   void SetUpdateGhostLevel(int level);
00263   virtual int GetUpdateGhostLevel();
00265   
00267 
00272   virtual void SetRequestExactExtent(int flag);
00273   virtual int GetRequestExactExtent();
00274   vtkBooleanMacro(RequestExactExtent, int);
00276   
00278 
00281   virtual void SetWholeExtent(int x0, int x1, int y0, int y1, int z0, int z1);
00282   virtual void SetWholeExtent(int extent[6]);
00283   virtual int* GetWholeExtent();
00284   virtual void GetWholeExtent(int& x0, int& x1, int& y0, int& y1,
00285                               int& z0, int& z1);
00286   virtual void GetWholeExtent(int extent[6]);
00288   
00290 
00293   virtual void SetWholeBoundingBox(double x0, double x1, double y0, 
00294                                    double y1, double z0, double z1);
00295   virtual void SetWholeBoundingBox(double bb[6]);
00296   virtual double* GetWholeBoundingBox();
00297   virtual void GetWholeBoundingBox(double& x0, double& x1, double& y0, 
00298                                    double& y1, double& z0, double& z1);
00299   virtual void GetWholeBoundingBox(double extent[6]);
00301   
00303 
00307   virtual void SetMaximumNumberOfPieces(int);
00308   virtual int GetMaximumNumberOfPieces();
00310 
00314   void DataHasBeenGenerated();
00315 
00319   virtual void PrepareForNewData() {this->Initialize();};
00320 
00322 
00324   virtual void ShallowCopy(vtkDataObject *src);  
00325   virtual void DeepCopy(vtkDataObject *src);
00327 
00329 
00330   void SetExtentTranslator(vtkExtentTranslator* translator);
00331   vtkExtentTranslator* GetExtentTranslator();
00333 
00340   virtual int GetExtentType() { return VTK_PIECES_EXTENT; };
00341 
00344   virtual void Crop();
00345 
00346   //BTX
00348 
00349   enum FieldAssociations
00350   {
00351     FIELD_ASSOCIATION_POINTS,
00352     FIELD_ASSOCIATION_CELLS,
00353     FIELD_ASSOCIATION_NONE
00354   };
00355   //ETX
00357 
00358   //BTX
00360 
00361   enum FieldOperations
00362   {
00363     FIELD_OPERATION_PRESERVED,
00364     FIELD_OPERATION_REINTERPOLATED,
00365     FIELD_OPERATION_MODIFIED,
00366     FIELD_OPERATION_REMOVED
00367   };
00368   //ETX
00370 
00371   static vtkInformationStringKey* DATA_TYPE_NAME();
00372   static vtkInformationDataObjectKey* DATA_OBJECT();
00373   static vtkInformationIntegerKey* DATA_EXTENT_TYPE();
00374   static vtkInformationIntegerVectorKey* DATA_EXTENT();
00375   static vtkInformationIntegerKey* DATA_PIECE_NUMBER();
00376   static vtkInformationIntegerKey* DATA_NUMBER_OF_PIECES();
00377   static vtkInformationIntegerKey* DATA_NUMBER_OF_GHOST_LEVELS();
00378   static vtkInformationIntegerKey* SCALAR_TYPE();
00379   static vtkInformationIntegerKey* SCALAR_NUMBER_OF_COMPONENTS();
00380   static vtkInformationIntegerKey* FIELD_ARRAY_TYPE();
00381   static vtkInformationIntegerKey* FIELD_ASSOCIATION();
00382   static vtkInformationIntegerKey* FIELD_ATTRIBUTE_TYPE();
00383   static vtkInformationIntegerKey* FIELD_NUMBER_OF_COMPONENTS();
00384   static vtkInformationIntegerKey* FIELD_NUMBER_OF_TUPLES();
00385   static vtkInformationIntegerKey* FIELD_OPERATION();
00386   static vtkInformationStringKey* FIELD_NAME();
00387   static vtkInformationDoubleVectorKey* ORIGIN();
00388   static vtkInformationDoubleVectorKey* SPACING();
00389 
00390 protected:
00391 
00392   vtkDataObject();
00393   ~vtkDataObject();
00394 
00395   // General field data associated with data object      
00396   vtkFieldData  *FieldData;  
00397 
00398   // Who generated this data as output?
00399   vtkSource     *Source;     
00400 
00401   // Keep track of data release during network execution
00402   int DataReleased; 
00403 
00404   virtual void CopyPipelineInformation(vtkInformation* oldPInfo,
00405                                        vtkInformation* newPInfo);
00406   
00407   // When was this data last generated?
00408   vtkTimeStamp UpdateTime;  
00409 
00410   // Get the executive that manages this data object.
00411   vtkExecutive* GetExecutive();
00412 
00413   // Get the port number producing this data object.
00414   int GetPortNumber();
00415 
00416   virtual void ReportReferences(vtkGarbageCollector*);
00417   virtual void RemoveReferences();
00418   virtual void GarbageCollectionStarting();
00419   int GarbageCollecting;
00420 
00421   // Arbitrary extra information associated with this data object.
00422   vtkInformation* Information;
00423 
00424   // Reference the pipeline information object that owns this data
00425   // object.
00426   vtkInformation* PipelineInformation;
00427 
00428   //BTX
00429   // Check whether this data object is owned by a vtkStreamingDemandDrivenPipeline.
00430   vtkStreamingDemandDrivenPipeline* TrySDDP(const char* method);
00431   typedef vtkStreamingDemandDrivenPipeline SDDP;
00432   //ETX
00433 
00434   //BTX
00435   friend class vtkStreamingDemandDrivenPipelineToDataObjectFriendship;
00436   //ETX
00437 private:
00438   // Helper method for the ShallowCopy and DeepCopy methods.
00439   void InternalDataObjectCopy(vtkDataObject *src);
00440 
00441 private:
00442   vtkDataObject(const vtkDataObject&);  // Not implemented.
00443   void operator=(const vtkDataObject&);  // Not implemented.
00444 };
00445 
00446 #endif
00447