dox/Filtering/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 #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   // Handle the source/data loop.
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   //BTX
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     FIELD_ASSOCIATION_ROWS,
00439     NUMBER_OF_ASSOCIATIONS
00440   };
00441   //ETX
00443 
00444   //BTX
00446 
00447   enum FieldOperations
00448   {
00449     FIELD_OPERATION_PRESERVED,
00450     FIELD_OPERATION_REINTERPOLATED,
00451     FIELD_OPERATION_MODIFIED,
00452     FIELD_OPERATION_REMOVED
00453   };
00454   //ETX
00456 
00459   static const char* GetAssociationTypeAsString(int associationType);
00460 
00461   static vtkInformationStringKey* DATA_TYPE_NAME();
00462   static vtkInformationDataObjectKey* DATA_OBJECT();
00463   static vtkInformationIntegerKey* DATA_EXTENT_TYPE();
00464   static vtkInformationIntegerPointerKey* DATA_EXTENT();
00465   static vtkInformationIntegerKey* DATA_PIECE_NUMBER();
00466   static vtkInformationIntegerKey* DATA_NUMBER_OF_PIECES();
00467   static vtkInformationIntegerKey* DATA_NUMBER_OF_GHOST_LEVELS();
00468   static vtkInformationDoubleVectorKey* DATA_TIME_STEPS();
00469   static vtkInformationInformationVectorKey* POINT_DATA_VECTOR();
00470   static vtkInformationInformationVectorKey* CELL_DATA_VECTOR();
00471   static vtkInformationInformationVectorKey* VERTEX_DATA_VECTOR();
00472   static vtkInformationInformationVectorKey* EDGE_DATA_VECTOR();
00473   static vtkInformationIntegerKey* FIELD_ARRAY_TYPE();
00474   static vtkInformationIntegerKey* FIELD_ASSOCIATION();
00475   static vtkInformationIntegerKey* FIELD_ATTRIBUTE_TYPE();
00476   static vtkInformationIntegerKey* FIELD_ACTIVE_ATTRIBUTE();
00477   static vtkInformationIntegerKey* FIELD_NUMBER_OF_COMPONENTS();
00478   static vtkInformationIntegerKey* FIELD_NUMBER_OF_TUPLES();
00479   static vtkInformationIntegerKey* FIELD_OPERATION();
00480   static vtkInformationDoubleVectorKey* FIELD_RANGE();
00481   static vtkInformationStringKey* FIELD_NAME();
00482   static vtkInformationDoubleVectorKey* ORIGIN();
00483   static vtkInformationDoubleVectorKey* SPACING();
00484   static vtkInformationIntegerKey* DATA_GEOMETRY_UNMODIFIED();
00485 
00486   // Key used to put SIL information in the output information by readers.
00487   static vtkInformationDataObjectKey* SIL();
00488 
00489   //BTX
00491 
00492   static vtkDataObject* GetData(vtkInformation* info);
00493   static vtkDataObject* GetData(vtkInformationVector* v, int i=0);
00494   //ETX
00496 
00497 protected:
00498 
00499   vtkDataObject();
00500   ~vtkDataObject();
00501 
00502   // General field data associated with data object      
00503   vtkFieldData  *FieldData;  
00504 
00505   // Who generated this data as output?
00506   vtkSource     *Source;     
00507 
00508   // Keep track of data release during network execution
00509   int DataReleased; 
00510 
00511   // When was this data last generated?
00512   vtkTimeStamp UpdateTime;  
00513 
00514   // Get the executive that manages this data object.
00515   vtkExecutive* GetExecutive();
00516 
00517   // Get the port number producing this data object.
00518   int GetPortNumber();
00519 
00520   virtual void ReportReferences(vtkGarbageCollector*);
00521 
00522   // Arbitrary extra information associated with this data object.
00523   vtkInformation* Information;
00524 
00525   // Reference the pipeline information object that owns this data
00526   // object.
00527   vtkInformation* PipelineInformation;
00528 
00529   //BTX
00530   // Check whether this data object is owned by a vtkStreamingDemandDrivenPipeline.
00531   vtkStreamingDemandDrivenPipeline* TrySDDP(const char* method);
00532   typedef vtkStreamingDemandDrivenPipeline SDDP;
00533   //ETX
00534 
00535   //BTX
00536   friend class vtkStreamingDemandDrivenPipelineToDataObjectFriendship;
00537   //ETX
00538 
00539   static const char AssociationNames[NUMBER_OF_ASSOCIATIONS][55];
00540 
00541 private:
00542   // Helper method for the ShallowCopy and DeepCopy methods.
00543   void InternalDataObjectCopy(vtkDataObject *src);
00544 
00545 private:
00546   vtkDataObject(const vtkDataObject&);  // Not implemented.
00547   void operator=(const vtkDataObject&);  // Not implemented.
00548 };
00549 
00550 #endif
00551 

Generated on Wed Oct 8 14:41:45 2008 for VTK by  doxygen 1.4.7