]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Config.h.in
debug finished
[cpPlugins.git] / lib / cpPlugins / Config.h.in
index 1eb05a3552b35dfe7a2ad88af57ceb911c45138c..c58039cd24fe19e4ba59ea79904c922c9727c642 100644 (file)
  * =========================================================================
  */
 
+#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          \
   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          \