X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FConfig.h.in;h=c58039cd24fe19e4ba59ea79904c922c9727c642;hb=a0e33d8a43c431e3df4c9aba45839a324b3ac0bc;hp=1eb05a3552b35dfe7a2ad88af57ceb911c45138c;hpb=ff82c0202d0496bb65bc4cb07e63604616db2961;p=cpPlugins.git diff --git a/lib/cpPlugins/Config.h.in b/lib/cpPlugins/Config.h.in index 1eb05a3..c58039c 100644 --- a/lib/cpPlugins/Config.h.in +++ b/lib/cpPlugins/Config.h.in @@ -95,6 +95,27 @@ * ========================================================================= */ +#define cpPluginsNewMacro( x ) \ + static Pointer New( ) \ + { \ + Pointer smartPtr = new x( ); \ + smartPtr->UnRegister( ); \ + return( smartPtr ); \ + } \ + virtual itk::LightObject::Pointer \ + CreateAnother( ) const cpPlugins_OVERRIDE \ + { \ + itk::LightObject::Pointer smartPtr; \ + smartPtr = x::New( ).GetPointer( ); \ + return( smartPtr ); \ + } \ + Pointer Clone( ) const \ + { \ + Pointer rval = \ + dynamic_cast< x* >( this->InternalClone( ).GetPointer( ) ); \ + return( rval ); \ + } + #define cpPlugins_Id_Macro( _class, _category ) \ public: \ virtual const char* GetClassName( ) const cpPlugins_OVERRIDE \ @@ -109,7 +130,7 @@ typedef itk::SmartPointer< Self > Pointer; \ typedef itk::SmartPointer< const Self > ConstPointer; \ public: \ - itkNewMacro( Self ); \ + cpPluginsNewMacro( Self ); \ itkTypeMacro( _cls, _scls ); \ public: \ virtual const char* GetClassName( ) const cpPlugins_OVERRIDE \