ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
00001 /*========================================================================= 00002 * 00003 * Copyright Insight Software Consortium 00004 * 00005 * Licensed under the Apache License, Version 2.0 (the "License"); 00006 * you may not use this file except in compliance with the License. 00007 * You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0.txt 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 * 00017 *=========================================================================*/ 00018 #ifndef __itkVTKImageExportBase_h 00019 #define __itkVTKImageExportBase_h 00020 00021 #include "itkProcessObject.h" 00022 00023 namespace itk 00024 { 00036 class ITK_EXPORT VTKImageExportBase:public ProcessObject 00037 { 00038 public: 00040 typedef VTKImageExportBase Self; 00041 typedef ProcessObject Superclass; 00042 typedef SmartPointer< Self > Pointer; 00043 typedef SmartPointer< const Self > ConstPointer; 00044 00046 itkTypeMacro(VTKImageExportBase, ProcessObject); 00047 00049 void * GetCallbackUserData(); 00050 00052 typedef void ( * UpdateInformationCallbackType )(void *); 00053 typedef int ( * PipelineModifiedCallbackType )(void *); 00054 typedef int * ( * WholeExtentCallbackType )(void *); 00055 typedef double * ( * SpacingCallbackType )(void *); 00056 typedef double * ( * OriginCallbackType )(void *); 00057 typedef const char * ( *ScalarTypeCallbackType )(void *); 00058 typedef int ( * NumberOfComponentsCallbackType )(void *); 00059 typedef void ( * PropagateUpdateExtentCallbackType )(void *, int *); 00060 typedef void ( * UpdateDataCallbackType )(void *); 00061 typedef int * ( * DataExtentCallbackType )(void *); 00062 typedef void * ( * BufferPointerCallbackType )(void *); 00064 00066 typedef float * ( *FloatSpacingCallbackType )(void *); 00067 typedef float * ( *FloatOriginCallbackType )(void *); 00069 00074 class CallbackTypeProxy 00075 { 00076 public: 00077 typedef double * ( *DoubleCallbackType )(void *); 00078 typedef float * ( * FloatCallbackType )(void *); 00079 operator DoubleCallbackType() 00080 { 00081 return m_DoubleCallback; 00082 } 00083 00084 operator FloatCallbackType() 00085 { 00086 return m_FloatCallback; 00087 } 00088 CallbackTypeProxy(DoubleCallbackType d, FloatCallbackType f): 00089 m_DoubleCallback(d), m_FloatCallback(f) {} 00090 private: 00091 DoubleCallbackType m_DoubleCallback; 00092 FloatCallbackType m_FloatCallback; 00093 }; 00094 00096 UpdateInformationCallbackType GetUpdateInformationCallback() const; 00097 00098 PipelineModifiedCallbackType GetPipelineModifiedCallback() const; 00099 00100 WholeExtentCallbackType GetWholeExtentCallback() const; 00101 00102 CallbackTypeProxy GetSpacingCallback() const; 00103 00104 CallbackTypeProxy GetOriginCallback() const; 00105 00106 ScalarTypeCallbackType GetScalarTypeCallback() const; 00107 00108 NumberOfComponentsCallbackType GetNumberOfComponentsCallback() const; 00109 00110 PropagateUpdateExtentCallbackType GetPropagateUpdateExtentCallback() const; 00111 00112 UpdateDataCallbackType GetUpdateDataCallback() const; 00113 00114 DataExtentCallbackType GetDataExtentCallback() const; 00115 00116 BufferPointerCallbackType GetBufferPointerCallback() const; 00117 00118 protected: 00119 VTKImageExportBase(); 00120 ~VTKImageExportBase() {} 00121 void PrintSelf(std::ostream & os, Indent indent) const; 00122 00123 typedef DataObject::Pointer DataObjectPointer; 00124 00125 virtual void UpdateInformationCallback(); 00126 00127 virtual int PipelineModifiedCallback(); 00128 00129 virtual void UpdateDataCallback(); 00130 00133 virtual int * WholeExtentCallback() = 0; 00134 00135 virtual double * SpacingCallback() = 0; 00136 00137 virtual double * OriginCallback() = 0; 00138 00139 virtual float * FloatSpacingCallback() = 0; 00140 00141 virtual float * FloatOriginCallback() = 0; 00142 00143 virtual const char * ScalarTypeCallback() = 0; 00144 00145 virtual int NumberOfComponentsCallback() = 0; 00146 00147 virtual void PropagateUpdateExtentCallback(int *) = 0; 00148 00149 virtual int * DataExtentCallback() = 0; 00150 00151 virtual void * BufferPointerCallback() = 0; 00152 00153 private: 00154 VTKImageExportBase(const Self &); //purposely not implemented 00155 void operator=(const Self &); //purposely not implemented 00156 00160 static void UpdateInformationCallbackFunction(void *); 00161 00162 static int PipelineModifiedCallbackFunction(void *); 00163 00164 static int * WholeExtentCallbackFunction(void *); 00165 00166 static double * SpacingCallbackFunction(void *); 00167 00168 static double * OriginCallbackFunction(void *); 00169 00170 static float * FloatSpacingCallbackFunction(void *); 00171 00172 static float * FloatOriginCallbackFunction(void *); 00173 00174 static const char * ScalarTypeCallbackFunction(void *); 00175 00176 static int NumberOfComponentsCallbackFunction(void *); 00177 00178 static void PropagateUpdateExtentCallbackFunction(void *, int *); 00179 00180 static void UpdateDataCallbackFunction(void *); 00181 00182 static int * DataExtentCallbackFunction(void *); 00183 00184 static void * BufferPointerCallbackFunction(void *); 00185 00186 private: 00188 unsigned long m_LastPipelineMTime; 00189 }; 00190 } // end namespace itk 00191 00192 #endif 00193