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

vtkImageImport.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkImageImport.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 =========================================================================*/
00047 #ifndef __vtkImageImport_h
00048 #define __vtkImageImport_h
00049 
00050 #include "vtkImageSource.h"
00051 //#include "vtkTransform.h"
00052 
00053 class VTK_IMAGING_EXPORT vtkImageImport : public vtkImageSource
00054 {
00055 public:
00056   static vtkImageImport *New();
00057   vtkTypeRevisionMacro(vtkImageImport,vtkImageSource);
00058   void PrintSelf(ostream& os, vtkIndent indent);   
00059 
00063   void CopyImportVoidPointer(void *ptr, int size);
00064   
00066 
00070   void SetImportVoidPointer(void *ptr);
00071   void *GetImportVoidPointer() {return this->ImportVoidPointer;};
00073 
00079   void SetImportVoidPointer(void *ptr, int save);
00080   
00082 
00084   vtkSetMacro(DataScalarType,int);
00085   void SetDataScalarTypeToDouble(){this->SetDataScalarType(VTK_DOUBLE);}
00086   void SetDataScalarTypeToFloat(){this->SetDataScalarType(VTK_FLOAT);}
00087   void SetDataScalarTypeToInt(){this->SetDataScalarType(VTK_INT);}
00088   void SetDataScalarTypeToShort(){this->SetDataScalarType(VTK_SHORT);}
00089   void SetDataScalarTypeToUnsignedShort()
00090     {this->SetDataScalarType(VTK_UNSIGNED_SHORT);}
00091   void SetDataScalarTypeToUnsignedChar()
00092     {this->SetDataScalarType(VTK_UNSIGNED_CHAR);}
00093   vtkGetMacro(DataScalarType, int);
00094   const char *GetDataScalarTypeAsString() { 
00095     return vtkImageScalarTypeNameMacro(this->DataScalarType); }
00097 
00099 
00101   vtkSetMacro(NumberOfScalarComponents,int);
00102   vtkGetMacro(NumberOfScalarComponents,int);
00104   
00106 
00110   vtkSetVector6Macro(DataExtent,int);
00111   vtkGetVector6Macro(DataExtent,int);
00112   void SetDataExtentToWholeExtent()
00113     {this->SetDataExtent(this->GetWholeExtent());}
00115   
00117 
00119   vtkSetVector3Macro(DataSpacing,double);
00120   vtkGetVector3Macro(DataSpacing,double);
00122   
00124 
00126   vtkSetVector3Macro(DataOrigin,double);
00127   vtkGetVector3Macro(DataOrigin,double);  
00129 
00131 
00134   vtkSetVector6Macro(WholeExtent,int);
00135   vtkGetVector6Macro(WholeExtent,int);
00137   
00139   virtual void PropagateUpdateExtent(vtkDataObject *output);
00140 
00141   //BTX
00143 
00145   typedef void (*UpdateInformationCallbackType)(void*);
00146   typedef int (*PipelineModifiedCallbackType)(void*);
00147   typedef int* (*WholeExtentCallbackType)(void*);
00148   typedef double* (*SpacingCallbackType)(void*);
00149   typedef double* (*OriginCallbackType)(void*);
00150   typedef const char* (*ScalarTypeCallbackType)(void*); 
00151   typedef int (*NumberOfComponentsCallbackType)(void*);
00152   typedef void (*PropagateUpdateExtentCallbackType)(void*, int*);
00153   typedef void (*UpdateDataCallbackType)(void*);
00154   typedef int* (*DataExtentCallbackType)(void*);
00155   typedef void* (*BufferPointerCallbackType)(void*);
00157 
00159 
00162   vtkSetMacro(UpdateInformationCallback, UpdateInformationCallbackType);
00163   vtkGetMacro(UpdateInformationCallback, UpdateInformationCallbackType);
00165   
00167 
00171   vtkSetMacro(PipelineModifiedCallback, PipelineModifiedCallbackType);
00172   vtkGetMacro(PipelineModifiedCallback, PipelineModifiedCallbackType);
00174 
00176 
00180   vtkSetMacro(WholeExtentCallback, WholeExtentCallbackType);
00181   vtkGetMacro(WholeExtentCallback, WholeExtentCallbackType);
00183 
00185 
00188   vtkSetMacro(SpacingCallback, SpacingCallbackType);
00189   vtkGetMacro(SpacingCallback, SpacingCallbackType);
00191 
00193 
00196   vtkSetMacro(OriginCallback, OriginCallbackType);
00197   vtkGetMacro(OriginCallback, OriginCallbackType);
00199 
00201 
00204   vtkSetMacro(ScalarTypeCallback, ScalarTypeCallbackType);
00205   vtkGetMacro(ScalarTypeCallback, ScalarTypeCallbackType);
00207   
00209 
00212   vtkSetMacro(NumberOfComponentsCallback, NumberOfComponentsCallbackType);
00213   vtkGetMacro(NumberOfComponentsCallback, NumberOfComponentsCallbackType);
00215   
00217 
00222   vtkSetMacro(PropagateUpdateExtentCallback,PropagateUpdateExtentCallbackType);
00223   vtkGetMacro(PropagateUpdateExtentCallback,PropagateUpdateExtentCallbackType);
00225   
00227 
00230   vtkSetMacro(UpdateDataCallback, UpdateDataCallbackType);
00231   vtkGetMacro(UpdateDataCallback, UpdateDataCallbackType);
00233   
00235 
00240   vtkSetMacro(DataExtentCallback, DataExtentCallbackType);
00241   vtkGetMacro(DataExtentCallback, DataExtentCallbackType);
00243   
00245 
00249   vtkSetMacro(BufferPointerCallback, BufferPointerCallbackType);
00250   vtkGetMacro(BufferPointerCallback, BufferPointerCallbackType);
00252 
00254 
00256   vtkSetMacro(CallbackUserData, void*);
00257   vtkGetMacro(CallbackUserData, void*);  
00259   
00260   //ETX
00261 
00262 protected:
00263   vtkImageImport();
00264   ~vtkImageImport();
00265 
00266   virtual void UpdateInformation();
00267   virtual void ExecuteInformation();
00268 
00269   int InvokePipelineModifiedCallbacks();
00270   void InvokeUpdateInformationCallbacks();
00271   void InvokeExecuteInformationCallbacks();
00272   void InvokeExecuteDataCallbacks();
00273   void LegacyCheckWholeExtent();
00274   
00275   void *ImportVoidPointer;
00276   int SaveUserArray;
00277   
00278   int NumberOfScalarComponents;
00279   int DataScalarType;
00280 
00281   int WholeExtent[6];
00282   int DataExtent[6];
00283   double DataSpacing[3];
00284   double DataOrigin[3];
00285 
00286   void* CallbackUserData;
00287   
00288   //BTX
00289   UpdateInformationCallbackType     UpdateInformationCallback;
00290   PipelineModifiedCallbackType      PipelineModifiedCallback;
00291   WholeExtentCallbackType           WholeExtentCallback;
00292   SpacingCallbackType               SpacingCallback;
00293   OriginCallbackType                OriginCallback;
00294   ScalarTypeCallbackType            ScalarTypeCallback;
00295   NumberOfComponentsCallbackType    NumberOfComponentsCallback;  
00296   PropagateUpdateExtentCallbackType PropagateUpdateExtentCallback;  
00297   UpdateDataCallbackType            UpdateDataCallback;
00298   DataExtentCallbackType            DataExtentCallback;
00299   BufferPointerCallbackType         BufferPointerCallback;
00300   //ETX
00301   
00302   virtual void ExecuteData(vtkDataObject *d);
00303 
00304 private:
00305   vtkImageImport(const vtkImageImport&);  // Not implemented.
00306   void operator=(const vtkImageImport&);  // Not implemented.
00307 };
00308 
00309 #endif