Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | 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 =========================================================================*/
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 
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   // Handle the source/data loop.
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 
00314   virtual void CopyInformationToPipeline(vtkInformation* request,
00315                                          vtkInformation* input);
00317 
00320   virtual void CopyInformationFromPipeline(vtkInformation* request);
00321 
00323 
00327   static vtkInformation *GetActiveFieldInformation(vtkInformation *info, 
00328     int fieldAssociation, int attributeType);
00330 
00332 
00335   static vtkInformation *GetNamedFieldInformation(vtkInformation *info, 
00336     int fieldAssociation, const char *name);
00338 
00340 
00341   static void RemoveNamedFieldInformation(vtkInformation *info, 
00342                                           int fieldAssociation, 
00343                                           const char *name);
00345   
00347 
00352   static vtkInformation *SetActiveAttribute(vtkInformation *info,
00353     int fieldAssociation, const char *attributeName, int attributeType);
00355 
00357 
00364   static void SetActiveAttributeInfo(vtkInformation *info, 
00365     int fieldAssociation, int attributeType, const char *name, int arrayType,
00366     int numComponents, int numTuples);
00368 
00370 
00373   static void SetPointDataActiveScalarInfo(vtkInformation *info,
00374     int arrayType, int numComponents);
00376 
00380   void DataHasBeenGenerated();
00381 
00385   virtual void PrepareForNewData() {this->Initialize();};
00386 
00388 
00390   virtual void ShallowCopy(vtkDataObject *src);  
00391   virtual void DeepCopy(vtkDataObject *src);
00393 
00395 
00396   void SetExtentTranslator(vtkExtentTranslator* translator);
00397   vtkExtentTranslator* GetExtentTranslator();
00399 
00406   virtual int GetExtentType() { return VTK_PIECES_EXTENT; };
00407 
00410   virtual void Crop();
00411 
00412   //BTX
00414 
00415   enum FieldAssociations
00416   {
00417     FIELD_ASSOCIATION_POINTS,
00418     FIELD_ASSOCIATION_CELLS,
00419     FIELD_ASSOCIATION_NONE,
00420     FIELD_ASSOCIATION_POINTS_THEN_CELLS,
00421     NUMBER_OF_ASSOCIATIONS
00422   };
00423   //ETX
00425 
00426   //BTX
00428 
00429   enum FieldOperations
00430   {
00431     FIELD_OPERATION_PRESERVED,
00432     FIELD_OPERATION_REINTERPOLATED,
00433     FIELD_OPERATION_MODIFIED,
00434     FIELD_OPERATION_REMOVED
00435   };
00436   //ETX
00438 
00441   static const char* GetAssociationTypeAsString(int associationType);
00442 
00443   static vtkInformationStringKey* DATA_TYPE_NAME();
00444   static vtkInformationDataObjectKey* DATA_OBJECT();
00445   static vtkInformationIntegerKey* DATA_EXTENT_TYPE();
00446   static vtkInformationIntegerPointerKey* DATA_EXTENT();
00447   static vtkInformationIntegerKey* DATA_PIECE_NUMBER();
00448   static vtkInformationIntegerKey* DATA_NUMBER_OF_PIECES();
00449   static vtkInformationIntegerKey* DATA_NUMBER_OF_GHOST_LEVELS();
00450   static vtkInformationIntegerKey* DATA_TIME_INDEX();
00451   static vtkInformationDoubleKey* DATA_TIME();
00452   static vtkInformationInformationVectorKey* POINT_DATA_VECTOR();
00453   static vtkInformationInformationVectorKey* CELL_DATA_VECTOR();
00454   static vtkInformationIntegerKey* FIELD_ARRAY_TYPE();
00455   static vtkInformationIntegerKey* FIELD_ASSOCIATION();
00456   static vtkInformationIntegerKey* FIELD_ATTRIBUTE_TYPE();
00457   static vtkInformationIntegerKey* FIELD_ACTIVE_ATTRIBUTE();
00458   static vtkInformationIntegerKey* FIELD_NUMBER_OF_COMPONENTS();
00459   static vtkInformationIntegerKey* FIELD_NUMBER_OF_TUPLES();
00460   static vtkInformationIntegerKey* FIELD_OPERATION();
00461   static vtkInformationStringKey* FIELD_NAME();
00462   static vtkInformationDoubleVectorKey* ORIGIN();
00463   static vtkInformationDoubleVectorKey* SPACING();
00464 
00465   //BTX
00467 
00468   static vtkDataObject* GetData(vtkInformation* info);
00469   static vtkDataObject* GetData(vtkInformationVector* v, int i=0);
00470   //ETX
00472 
00473 protected:
00474 
00475   vtkDataObject();
00476   ~vtkDataObject();
00477 
00478   // General field data associated with data object      
00479   vtkFieldData  *FieldData;  
00480 
00481   // Who generated this data as output?
00482   vtkSource     *Source;     
00483 
00484   // Keep track of data release during network execution
00485   int DataReleased; 
00486 
00487   // When was this data last generated?
00488   vtkTimeStamp UpdateTime;  
00489 
00490   // Get the executive that manages this data object.
00491   vtkExecutive* GetExecutive();
00492 
00493   // Get the port number producing this data object.
00494   int GetPortNumber();
00495 
00496   virtual void ReportReferences(vtkGarbageCollector*);
00497 
00498   // Arbitrary extra information associated with this data object.
00499   vtkInformation* Information;
00500 
00501   // Reference the pipeline information object that owns this data
00502   // object.
00503   vtkInformation* PipelineInformation;
00504 
00505   //BTX
00506   // Check whether this data object is owned by a vtkStreamingDemandDrivenPipeline.
00507   vtkStreamingDemandDrivenPipeline* TrySDDP(const char* method);
00508   typedef vtkStreamingDemandDrivenPipeline SDDP;
00509   //ETX
00510 
00511   //BTX
00512   friend class vtkStreamingDemandDrivenPipelineToDataObjectFriendship;
00513   //ETX
00514 
00515   static const char AssociationNames[NUMBER_OF_ASSOCIATIONS][55];
00516 
00517 private:
00518   // Helper method for the ShallowCopy and DeepCopy methods.
00519   void InternalDataObjectCopy(vtkDataObject *src);
00520 
00521 private:
00522   vtkDataObject(const vtkDataObject&);  // Not implemented.
00523   void operator=(const vtkDataObject&);  // Not implemented.
00524 };
00525 
00526 #endif
00527 

Generated on Mon Jan 21 23:07:18 2008 for VTK by  doxygen 1.4.3-20050530