]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Config.h.in
Cast image filter added. ROI filter modified.
[cpPlugins.git] / lib / cpPlugins / Config.h.in
index 105f8b5330444243d353f3f0567501d6d0b9babf..c58039cd24fe19e4ba59ea79904c922c9727c642 100644 (file)
@@ -49,7 +49,9 @@
 #if cpPlugins_QT4_USED == 1
 #  define cpPlugins_QT4
 #  define cpPlugins_QVTKWidget @cpPlugins_Qt4_VTKWidget@
-#  include <@cpPlugins_Qt4_VTKWidget@.h>
+/* TODO
+   #  include <@cpPlugins_Qt4_VTKWidget@.h>
+*/
 #else // cpPlugins_QT4_USED == 1
 #  undef cpPlugins_QT4
 #endif // cpPlugins_QT4_USED == 1
  * =========================================================================
  */
 
+#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          \