dox/Imaging/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 =========================================================================*/
00034 #ifndef __vtkImageImport_h
00035 #define __vtkImageImport_h
00036 
00037 #include "vtkImageAlgorithm.h"
00038 
00039 class VTK_IMAGING_EXPORT vtkImageImport : public vtkImageAlgorithm
00040 {
00041 public:
00042   static vtkImageImport *New();
00043   vtkTypeRevisionMacro(vtkImageImport,vtkImageAlgorithm);
00044   void PrintSelf(ostream& os, vtkIndent indent);   
00045 
00049   void CopyImportVoidPointer(void *ptr, int size);
00050   
00052 
00056   void SetImportVoidPointer(void *ptr);
00057   void *GetImportVoidPointer() {return this->ImportVoidPointer;};
00059 
00065   void SetImportVoidPointer(void *ptr, int save);
00066   
00068 
00070   vtkSetMacro(DataScalarType,int);
00071   void SetDataScalarTypeToDouble(){this->SetDataScalarType(VTK_DOUBLE);}
00072   void SetDataScalarTypeToFloat(){this->SetDataScalarType(VTK_FLOAT);}
00073   void SetDataScalarTypeToInt(){this->SetDataScalarType(VTK_INT);}
00074   void SetDataScalarTypeToShort(){this->SetDataScalarType(VTK_SHORT);}
00075   void SetDataScalarTypeToUnsignedShort()
00076     {this->SetDataScalarType(VTK_UNSIGNED_SHORT);}
00077   void SetDataScalarTypeToUnsignedChar()
00078     {this->SetDataScalarType(VTK_UNSIGNED_CHAR);}
00079   vtkGetMacro(DataScalarType, int);
00080   const char *GetDataScalarTypeAsString() { 
00081     return vtkImageScalarTypeNameMacro(this->DataScalarType); }
00083 
00085 
00087   vtkSetMacro(NumberOfScalarComponents,int);
00088   vtkGetMacro(NumberOfScalarComponents,int);
00090   
00092 
00096   vtkSetVector6Macro(DataExtent,int);
00097   vtkGetVector6Macro(DataExtent,int);
00098   void SetDataExtentToWholeExtent()
00099     {this->SetDataExtent(this->GetWholeExtent());}
00101   
00103 
00105   vtkSetVector3Macro(DataSpacing,double);
00106   vtkGetVector3Macro(DataSpacing,double);
00108   
00110 
00112   vtkSetVector3Macro(DataOrigin,double);
00113   vtkGetVector3Macro(DataOrigin,double);  
00115 
00117 
00120   vtkSetVector6Macro(WholeExtent,int);
00121   vtkGetVector6Macro(WholeExtent,int);
00123   
00125 
00126   virtual int RequestUpdateExtent(  vtkInformation* request,
00127                                     vtkInformationVector** inputVector,
00128                                     vtkInformationVector* outputVector);
00130 
00132 
00133   vtkSetStringMacro(ScalarArrayName);
00134   vtkGetStringMacro(ScalarArrayName);
00136 
00137   //BTX
00139 
00141   typedef void (*UpdateInformationCallbackType)(void*);
00142   typedef int (*PipelineModifiedCallbackType)(void*);
00143   typedef int* (*WholeExtentCallbackType)(void*);
00144   typedef double* (*SpacingCallbackType)(void*);
00145   typedef double* (*OriginCallbackType)(void*);
00146   typedef const char* (*ScalarTypeCallbackType)(void*); 
00147   typedef int (*NumberOfComponentsCallbackType)(void*);
00148   typedef void (*PropagateUpdateExtentCallbackType)(void*, int*);
00149   typedef void (*UpdateDataCallbackType)(void*);
00150   typedef int* (*DataExtentCallbackType)(void*);
00151   typedef void* (*BufferPointerCallbackType)(void*);
00153 
00155 
00158   vtkSetMacro(UpdateInformationCallback, UpdateInformationCallbackType);
00159   vtkGetMacro(UpdateInformationCallback, UpdateInformationCallbackType);
00161   
00163 
00167   vtkSetMacro(PipelineModifiedCallback, PipelineModifiedCallbackType);
00168   vtkGetMacro(PipelineModifiedCallback, PipelineModifiedCallbackType);
00170 
00172 
00176   vtkSetMacro(WholeExtentCallback, WholeExtentCallbackType);
00177   vtkGetMacro(WholeExtentCallback, WholeExtentCallbackType);
00179 
00181 
00184   vtkSetMacro(SpacingCallback, SpacingCallbackType);
00185   vtkGetMacro(SpacingCallback, SpacingCallbackType);
00187 
00189 
00192   vtkSetMacro(OriginCallback, OriginCallbackType);
00193   vtkGetMacro(OriginCallback, OriginCallbackType);
00195 
00197 
00200   vtkSetMacro(ScalarTypeCallback, ScalarTypeCallbackType);
00201   vtkGetMacro(ScalarTypeCallback, ScalarTypeCallbackType);
00203   
00205 
00208   vtkSetMacro(NumberOfComponentsCallback, NumberOfComponentsCallbackType);
00209   vtkGetMacro(NumberOfComponentsCallback, NumberOfComponentsCallbackType);
00211   
00213 
00218   vtkSetMacro(PropagateUpdateExtentCallback,PropagateUpdateExtentCallbackType);
00219   vtkGetMacro(PropagateUpdateExtentCallback,PropagateUpdateExtentCallbackType);
00221   
00223 
00226   vtkSetMacro(UpdateDataCallback, UpdateDataCallbackType);
00227   vtkGetMacro(UpdateDataCallback, UpdateDataCallbackType);
00229   
00231 
00236   vtkSetMacro(DataExtentCallback, DataExtentCallbackType);
00237   vtkGetMacro(DataExtentCallback, DataExtentCallbackType);
00239   
00241 
00245   vtkSetMacro(BufferPointerCallback, BufferPointerCallbackType);
00246   vtkGetMacro(BufferPointerCallback, BufferPointerCallbackType);
00248 
00250 
00252   vtkSetMacro(CallbackUserData, void*);
00253   vtkGetMacro(CallbackUserData, void*);  
00255   
00256   //ETX
00257 
00259 
00260   int InvokePipelineModifiedCallbacks();
00261   void InvokeUpdateInformationCallbacks();
00262   void InvokeExecuteInformationCallbacks();
00263   void InvokeExecuteDataCallbacks();
00264   void LegacyCheckWholeExtent();
00266 
00267 protected:
00268   vtkImageImport();
00269   ~vtkImageImport();
00270 
00271   virtual int RequestInformation (vtkInformation *, vtkInformationVector **, 
00272                                   vtkInformationVector *);
00273 
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   char *ScalarArrayName;
00287   void* CallbackUserData;
00288   
00289   //BTX
00290   UpdateInformationCallbackType     UpdateInformationCallback;
00291   PipelineModifiedCallbackType      PipelineModifiedCallback;
00292   WholeExtentCallbackType           WholeExtentCallback;
00293   SpacingCallbackType               SpacingCallback;
00294   OriginCallbackType                OriginCallback;
00295   ScalarTypeCallbackType            ScalarTypeCallback;
00296   NumberOfComponentsCallbackType    NumberOfComponentsCallback;
00297   PropagateUpdateExtentCallbackType PropagateUpdateExtentCallback;
00298   UpdateDataCallbackType            UpdateDataCallback;
00299   DataExtentCallbackType            DataExtentCallback;
00300   BufferPointerCallbackType         BufferPointerCallback;
00301   //ETX
00302   
00303   virtual void ExecuteData(vtkDataObject *d);
00304 
00305 private:
00306   vtkImageImport(const vtkImageImport&);  // Not implemented.
00307   void operator=(const vtkImageImport&);  // Not implemented.
00308 };
00309 
00310 #endif

Generated on Thu Jan 8 14:38:45 2009 for VTK by  doxygen 1.4.7