Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #define MITK_TOOL_MACRO(EXPORT_SPEC, CLASS_NAME, DESCRIPTION) \
00020 \
00021 class EXPORT_SPEC CLASS_NAME ## Factory : public ::itk::ObjectFactoryBase \
00022 { \
00023 public: \
00024 \
00025 \
00026 typedef CLASS_NAME ## Factory Self; \
00027 typedef itk::ObjectFactoryBase Superclass; \
00028 typedef itk::SmartPointer<Self> Pointer; \
00029 typedef itk::SmartPointer<const Self> ConstPointer; \
00030 \
00031 \
00032 virtual const char* GetITKSourceVersion() const \
00033 { \
00034 return ITK_SOURCE_VERSION; \
00035 }\
00036 \
00037 virtual const char* GetDescription() const \
00038 { \
00039 return DESCRIPTION; \
00040 }\
00041 \
00042 \
00043 itkFactorylessNewMacro(Self); \
00044 \
00045 \
00046 itkTypeMacro(CLASS_NAME ## Factory, itkObjectFactoryBase); \
00047 \
00048 \
00049 static void RegisterOneFactory() \
00050 { \
00051 CLASS_NAME ## Factory::Pointer CLASS_NAME ## Factory = CLASS_NAME ## Factory::New(); \
00052 itk::ObjectFactoryBase::RegisterFactory(CLASS_NAME ## Factory); \
00053 } \
00054 \
00055 protected: \
00056 \
00057 CLASS_NAME ## Factory() \
00058 { \
00059 itk::ObjectFactoryBase::RegisterOverride("mitkTool", \
00060 #CLASS_NAME, \
00061 DESCRIPTION, \
00062 1, \
00063 itk::CreateObjectFunction<CLASS_NAME>::New()); \
00064 } \
00065 \
00066 ~CLASS_NAME ## Factory() \
00067 { \
00068 } \
00069 \
00070 private: \
00071 \
00072 CLASS_NAME ## Factory(const Self&); \
00073 void operator=(const Self&); \
00074 \
00075 }; \
00076 \
00077 class CLASS_NAME ## RegistrationMethod \
00078 { \
00079 public: \
00080 \
00081 CLASS_NAME ## RegistrationMethod() \
00082 { \
00083 \
00084 itk::ObjectFactoryBase::RegisterFactory( CLASS_NAME ## Factory::New() ); \
00085 } \
00086 }; \
00087 \
00088 static mitk::CLASS_NAME ## RegistrationMethod somestaticinitializer_ ## CLASS_NAME ;
00089
00090
00091
00092
00093 #define MITK_DERIVED_SM_TOOL_MACRO(EXPORT_SPEC, BASE_CLASS, CLASS_NAME, DESCRIPTION) \
00094 \
00095 class EXPORT_SPEC CLASS_NAME ## Tool : public BASE_CLASS \
00096 { \
00097 public: \
00098 \
00099 typedef CLASS_NAME ## Tool Self; \
00100 typedef BASE_CLASS Superclass; \
00101 typedef itk::SmartPointer<Self> Pointer; \
00102 typedef itk::SmartPointer<const Self> ConstPointer; \
00103 \
00104 itkNewMacro(CLASS_NAME ## Tool); \
00105 \
00106 protected: \
00107 \
00108 CLASS_NAME ## Tool() \
00109 { \
00110 m_SegmentationGenerator = CLASS_NAME::New(); \
00111 } \
00112 \
00113 void RegisterProgressObserver() \
00114 { \
00115 itk::ReceptorMemberCommand< CLASS_NAME ## Tool >::Pointer command = itk::ReceptorMemberCommand< CLASS_NAME ## Tool >::New(); \
00116 command->SetCallbackFunction(this, &CLASS_NAME ## Tool::OnProgressEvent); \
00117 m_SegmentationGenerator->AddSegmentationProgressObserver< CLASS_NAME ## Tool >( command ); \
00118 } \
00119 \
00120 void RegisterFinishedSegmentationObserver() \
00121 { \
00122 itk::ReceptorMemberCommand< CLASS_NAME ## Tool >::Pointer command = itk::ReceptorMemberCommand< CLASS_NAME ## Tool >::New(); \
00123 command->SetCallbackFunction(this, &CLASS_NAME ## Tool::OnSegmentationFinished); \
00124 m_SegmentationGenerator->AddSegmentationFinishedObserver< CLASS_NAME ## Tool >( command ); \
00125 } \
00126 \
00127 ~CLASS_NAME ## Tool() \
00128 { \
00129 } \
00130 }; \
00131 MITK_TOOL_MACRO(EXPORT_SPEC, CLASS_NAME ## Tool, DESCRIPTION);
00132
00133 #define MITK_EXTERNAL_TOOL_HEADER_MACRO(EXPORT_SPEC, CLASS_NAME, DESCRIPTION) \
00134 extern "C" { \
00135 EXPORT_SPEC itk::ObjectFactoryBase* itkLoad(); \
00136 }
00137
00138
00139 #define MITK_EXTERNAL_TOOL_CPP_MACRO(EXPORT_SPEC, CLASS_NAME, DESCRIPTION) \
00140 MITK_TOOL_MACRO(EXPORT_SPEC, CLASS_NAME, DESCRIPTION) \
00141 extern "C" { \
00142 EXPORT_SPEC itk::ObjectFactoryBase* itkLoad() { \
00143 static CLASS_NAME ## Factory::Pointer p = CLASS_NAME ## Factory::New(); \
00144 return p; \
00145 } \
00146 }
00147
00148
00149
00150 #define MITK_TOOL_GUI_MACRO(EXPORT_SPEC, CLASS_NAME, DESCRIPTION) \
00151 \
00152 class EXPORT_SPEC CLASS_NAME ## Factory : public ::itk::ObjectFactoryBase \
00153 { \
00154 public: \
00155 \
00156 \
00157 typedef CLASS_NAME ## Factory Self; \
00158 typedef itk::ObjectFactoryBase Superclass; \
00159 typedef itk::SmartPointer<Self> Pointer; \
00160 typedef itk::SmartPointer<const Self> ConstPointer; \
00161 \
00162 \
00163 virtual const char* GetITKSourceVersion() const \
00164 { \
00165 return ITK_SOURCE_VERSION; \
00166 }\
00167 \
00168 virtual const char* GetDescription() const \
00169 { \
00170 return DESCRIPTION; \
00171 }\
00172 \
00173 \
00174 itkFactorylessNewMacro(Self); \
00175 \
00176 \
00177 itkTypeMacro(CLASS_NAME ## Factory, itkObjectFactoryBase); \
00178 \
00179 \
00180 static void RegisterOneFactory() \
00181 { \
00182 CLASS_NAME ## Factory::Pointer CLASS_NAME ## Factory = CLASS_NAME ## Factory::New(); \
00183 itk::ObjectFactoryBase::RegisterFactory(CLASS_NAME ## Factory); \
00184 } \
00185 \
00186 protected: \
00187 \
00188 CLASS_NAME ## Factory() \
00189 { \
00190 itk::ObjectFactoryBase::RegisterOverride(#CLASS_NAME, \
00191 #CLASS_NAME, \
00192 DESCRIPTION, \
00193 1, \
00194 itk::CreateObjectFunction<CLASS_NAME>::New()); \
00195 } \
00196 \
00197 ~CLASS_NAME ## Factory() \
00198 { \
00199 } \
00200 \
00201 private: \
00202 \
00203 CLASS_NAME ## Factory(const Self&); \
00204 void operator=(const Self&); \
00205 \
00206 }; \
00207 \
00208 class CLASS_NAME ## RegistrationMethod \
00209 { \
00210 public: \
00211 \
00212 CLASS_NAME ## RegistrationMethod() \
00213 { \
00214 \
00215 itk::ObjectFactoryBase::RegisterFactory( CLASS_NAME ## Factory::New() ); \
00216 } \
00217 }; \
00218 \
00219 static CLASS_NAME ## RegistrationMethod somestaticinitializer_ ## CLASS_NAME ;
00220
00221
00222 #define MITK_EXTERNAL_TOOL_GUI_HEADER_MACRO(EXPORT_SPEC, CLASS_NAME, DESCRIPTION) \
00223 extern "C" { \
00224 EXPORT_SPEC itk::ObjectFactoryBase* itkLoad(); \
00225 }
00226
00227 #define MITK_EXTERNAL_TOOL_GUI_CPP_MACRO(EXPORT_SPEC, CLASS_NAME, DESCRIPTION) \
00228 MITK_TOOL_GUI_MACRO(EXPORT_SPEC, CLASS_NAME, DESCRIPTION) \
00229 extern "C" { \
00230 EXPORT_SPEC itk::ObjectFactoryBase* itkLoad() { \
00231 static CLASS_NAME ## Factory::Pointer p = CLASS_NAME ## Factory::New(); \
00232 return p; \
00233 } \
00234 }
00235
00236
00237