VTK
dox/IO/Image/vtkImageExport.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkImageExport.h
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 =========================================================================*/
00034 #ifndef __vtkImageExport_h
00035 #define __vtkImageExport_h
00036 
00037 #include "vtkIOImageModule.h" // For export macro
00038 #include "vtkImageAlgorithm.h"
00039 
00040 class VTKIOIMAGE_EXPORT vtkImageExport : public vtkImageAlgorithm
00041 {
00042 public:
00043   static vtkImageExport *New();
00044   vtkTypeMacro(vtkImageExport,vtkImageAlgorithm);
00045   void PrintSelf(ostream& os, vtkIndent indent);
00046 
00048   vtkIdType GetDataMemorySize();
00049 
00051 
00053   void GetDataDimensions(int *ptr);
00054   int *GetDataDimensions() {
00055     this->GetDataDimensions(this->DataDimensions);
00056     return this->DataDimensions; }
00058 
00062   int GetDataNumberOfScalarComponents();
00063 
00065 
00067   int GetDataScalarType();
00068   const char *GetDataScalarTypeAsString() {
00069     return vtkImageScalarTypeNameMacro(this->GetDataScalarType()); }
00071 
00073 
00074   int *GetDataExtent();
00075   void GetDataExtent(int *ptr);
00076   double *GetDataSpacing();
00077   void GetDataSpacing(double *ptr);
00078   double *GetDataOrigin();
00079   void GetDataOrigin(double *ptr);
00081 
00082 //BTX
00084 
00085   vtkImageData *GetInput();
00086 //ETX
00088 
00090 
00095   vtkBooleanMacro(ImageLowerLeft, int);
00096   vtkGetMacro(ImageLowerLeft, int);
00097   vtkSetMacro(ImageLowerLeft, int);
00099 
00101 
00104   void SetExportVoidPointer(void *);
00105   void *GetExportVoidPointer() { return this->ExportVoidPointer; };
00107 
00109 
00112   void Export() { this->Export(this->ExportVoidPointer); };
00113   virtual void Export(void *);
00115 
00120   void *GetPointerToData();
00121 
00123   void* GetCallbackUserData();
00124 
00125   //BTX
00127 
00129   typedef void (*UpdateInformationCallbackType)(void*);
00130   typedef int (*PipelineModifiedCallbackType)(void*);
00131   typedef int* (*WholeExtentCallbackType)(void*);
00132   typedef double* (*SpacingCallbackType)(void*);
00133   typedef double* (*OriginCallbackType)(void*);
00134   typedef const char* (*ScalarTypeCallbackType)(void*);
00135   typedef int (*NumberOfComponentsCallbackType)(void*);
00136   typedef void (*PropagateUpdateExtentCallbackType)(void*, int*);
00137   typedef void (*UpdateDataCallbackType)(void*);
00138   typedef int* (*DataExtentCallbackType)(void*);
00139   typedef void* (*BufferPointerCallbackType)(void*);
00141 
00143 
00144   UpdateInformationCallbackType     GetUpdateInformationCallback() const;
00145   PipelineModifiedCallbackType      GetPipelineModifiedCallback() const;
00146   WholeExtentCallbackType           GetWholeExtentCallback() const;
00147   SpacingCallbackType               GetSpacingCallback() const;
00148   OriginCallbackType                GetOriginCallback() const;
00149   ScalarTypeCallbackType            GetScalarTypeCallback() const;
00150   NumberOfComponentsCallbackType    GetNumberOfComponentsCallback() const;
00151   PropagateUpdateExtentCallbackType GetPropagateUpdateExtentCallback() const;
00152   UpdateDataCallbackType            GetUpdateDataCallback() const;
00153   DataExtentCallbackType            GetDataExtentCallback() const;
00154   BufferPointerCallbackType         GetBufferPointerCallback() const;
00155   //ETX
00157 
00158 protected:
00159   vtkImageExport();
00160   ~vtkImageExport();
00161 
00162   // This is called by the superclass.
00163   virtual int RequestData(vtkInformation *request,
00164                           vtkInformationVector** inputVector,
00165                           vtkInformationVector* outputVector);
00166 
00167   virtual void UpdateInformationCallback();
00168   virtual int PipelineModifiedCallback();
00169   virtual void UpdateDataCallback();
00170   virtual int* WholeExtentCallback();
00171   virtual double* SpacingCallback();
00172   virtual double* OriginCallback();
00173   virtual const char* ScalarTypeCallback();
00174   virtual int NumberOfComponentsCallback();
00175   virtual void PropagateUpdateExtentCallback(int*);
00176   virtual int* DataExtentCallback();
00177   virtual void* BufferPointerCallback();
00178 
00179   int ImageLowerLeft;
00180   int DataDimensions[3];
00181   void *ExportVoidPointer;
00182 
00183   unsigned long LastPipelineMTime;
00184 
00185 private:
00186   vtkImageExport(const vtkImageExport&);  // Not implemented.
00187   void operator=(const vtkImageExport&);  // Not implemented.
00188 
00189   static void UpdateInformationCallbackFunction(void*);
00190   static int PipelineModifiedCallbackFunction(void*);
00191   static int* WholeExtentCallbackFunction(void*);
00192   static double* SpacingCallbackFunction(void*);
00193   static double* OriginCallbackFunction(void*);
00194   static const char* ScalarTypeCallbackFunction(void*);
00195   static int NumberOfComponentsCallbackFunction(void*);
00196   static void PropagateUpdateExtentCallbackFunction(void*, int*);
00197   static void UpdateDataCallbackFunction(void*);
00198   static int* DataExtentCallbackFunction(void*);
00199   static void* BufferPointerCallbackFunction(void*);
00200 
00201   vtkAlgorithm* GetInputAlgorithm();
00202   vtkInformation* GetInputInformation();
00203 };
00204 
00205 #endif
00206 
00207