00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkVTKImageExportBase_h
00018 #define __itkVTKImageExportBase_h
00019
00020 #include "itkProcessObject.h"
00021
00022 namespace itk
00023 {
00024
00035 class ITK_EXPORT VTKImageExportBase: public ProcessObject
00036 {
00037 public:
00039 typedef VTKImageExportBase Self;
00040 typedef ProcessObject Superclass;
00041 typedef SmartPointer<Self> Pointer;
00042 typedef SmartPointer<const Self> ConstPointer;
00043
00045 itkTypeMacro(VTKImageExportBase,ProcessObject);
00046
00048 void* GetCallbackUserData();
00049
00051 typedef void (*UpdateInformationCallbackType)(void*);
00052 typedef int (*PipelineModifiedCallbackType)(void*);
00053 typedef int* (*WholeExtentCallbackType)(void*);
00054 typedef double* (*SpacingCallbackType)(void*);
00055 typedef double* (*OriginCallbackType)(void*);
00056 typedef const char* (*ScalarTypeCallbackType)(void*);
00057 typedef int (*NumberOfComponentsCallbackType)(void*);
00058 typedef void (*PropagateUpdateExtentCallbackType)(void*, int*);
00059 typedef void (*UpdateDataCallbackType)(void*);
00060 typedef int* (*DataExtentCallbackType)(void*);
00061 typedef void* (*BufferPointerCallbackType)(void*);
00063
00065 typedef float* (*FloatSpacingCallbackType)(void*);
00066 typedef float* (*FloatOriginCallbackType)(void*);
00068
00070 class CallbackTypeProxy
00071 {
00072 public:
00073 typedef double* (*DoubleCallbackType)(void*);
00074 typedef float* (*FloatCallbackType)(void*);
00075 operator DoubleCallbackType()
00076 {
00077 return m_DoubleCallback;
00078 }
00079 operator FloatCallbackType()
00080 {
00081 return m_FloatCallback;
00082 }
00083 CallbackTypeProxy(DoubleCallbackType d, FloatCallbackType f):
00084 m_DoubleCallback(d), m_FloatCallback(f) {}
00085 private:
00086 DoubleCallbackType m_DoubleCallback;
00087 FloatCallbackType m_FloatCallback;
00088 };
00090
00092 UpdateInformationCallbackType GetUpdateInformationCallback() const;
00093 PipelineModifiedCallbackType GetPipelineModifiedCallback() const;
00094 WholeExtentCallbackType GetWholeExtentCallback() const;
00095 CallbackTypeProxy GetSpacingCallback() const;
00096 CallbackTypeProxy GetOriginCallback() const;
00097 ScalarTypeCallbackType GetScalarTypeCallback() const;
00098 NumberOfComponentsCallbackType GetNumberOfComponentsCallback() const;
00099 PropagateUpdateExtentCallbackType GetPropagateUpdateExtentCallback() const;
00100 UpdateDataCallbackType GetUpdateDataCallback() const;
00101 DataExtentCallbackType GetDataExtentCallback() const;
00102 BufferPointerCallbackType GetBufferPointerCallback() const;
00104
00105 protected:
00106 VTKImageExportBase();
00107 ~VTKImageExportBase() {}
00108 void PrintSelf(std::ostream& os, Indent indent) const;
00109
00110 typedef DataObject::Pointer DataObjectPointer;
00111
00112 virtual void UpdateInformationCallback();
00113 virtual int PipelineModifiedCallback();
00114 virtual void UpdateDataCallback();
00115
00118 virtual int* WholeExtentCallback()=0;
00119 virtual double* SpacingCallback()=0;
00120 virtual double* OriginCallback()=0;
00121 virtual float* FloatSpacingCallback()=0;
00122 virtual float* FloatOriginCallback()=0;
00123 virtual const char* ScalarTypeCallback()=0;
00124 virtual int NumberOfComponentsCallback()=0;
00125 virtual void PropagateUpdateExtentCallback(int*)=0;
00126 virtual int* DataExtentCallback()=0;
00127 virtual void* BufferPointerCallback()=0;
00129
00130 private:
00131 VTKImageExportBase(const Self&);
00132 void operator=(const Self&);
00133
00137 static void UpdateInformationCallbackFunction(void*);
00138 static int PipelineModifiedCallbackFunction(void*);
00139 static int* WholeExtentCallbackFunction(void*);
00140 static double* SpacingCallbackFunction(void*);
00141 static double* OriginCallbackFunction(void*);
00142 static float* FloatSpacingCallbackFunction(void*);
00143 static float* FloatOriginCallbackFunction(void*);
00144 static const char* ScalarTypeCallbackFunction(void*);
00145 static int NumberOfComponentsCallbackFunction(void*);
00146 static void PropagateUpdateExtentCallbackFunction(void*, int*);
00147 static void UpdateDataCallbackFunction(void*);
00148 static int* DataExtentCallbackFunction(void*);
00149 static void* BufferPointerCallbackFunction(void*);
00151
00152 private:
00154 unsigned long m_LastPipelineMTime;
00155 };
00156
00157 }
00158
00159 #endif
00160