]> Creatis software - cpPlugins.git/blobdiff - lib/ivq/Config.h.in
...
[cpPlugins.git] / lib / ivq / Config.h.in
index 46a01449d114a919b9cb1cc4767fe0bb78791914..35b65ad8c72ca8fca6f3916fe9491b8a4e2b4e76 100644 (file)
@@ -6,6 +6,7 @@
 #define __ivq__Config__h__
 
 #include <ivq/ivq_export.h>
+#include <itkMacro.h>
 
 #if @cpPlugins_USE_VTK@ == 1
 #  define ivq_USE_VTK
 #  define ivq_USE_Qt5
 #endif // @cpPlugins_USE_Qt5@ == 1
 
+// -------------------------------------------------------------------------
+#define ivqITKInputMacro( __n__, __t__ )        \
+  private:                                      \
+  unsigned int m_##__n__##Idx;                  \
+  public:                                       \
+  __t__* Get##__n__( )                          \
+  {                                             \
+    return(                                     \
+      dynamic_cast< __t__* >(                   \
+        this->itk::ProcessObject::GetInput(     \
+          this->m_##__n__##Idx                  \
+          ) ) );                                \
+  }                                             \
+  const __t__* Get##__n__( ) const              \
+  {                                             \
+    return(                                     \
+      dynamic_cast< const __t__* >(             \
+        this->itk::ProcessObject::GetInput(     \
+          this->m_##__n__##Idx                  \
+          ) ) );                                \
+  }                                             \
+  void Set##__n__( const __t__* i )             \
+  {                                             \
+    this->itk::ProcessObject::SetNthInput(      \
+      this->m_##__n__##Idx,                     \
+      const_cast< __t__* >( i )                 \
+      );                                        \
+  }
+
+// -------------------------------------------------------------------------
+#define ivqITKInputConfigureMacro( __n__, __t__ )               \
+  this->m_##__n__##Idx = this->GetNumberOfRequiredInputs( );    \
+  this->itk::ProcessObject::SetNumberOfRequiredInputs(          \
+    this->m_##__n__##Idx + 1                                    \
+    )
+
+// -------------------------------------------------------------------------
+#define ivqITKOutputMacro( __n__, __t__ )       \
+  private:                                      \
+  unsigned int m_##__n__##Idx;                  \
+  public:                                       \
+  __t__* Get##__n__( )                          \
+  {                                             \
+    return(                                     \
+      dynamic_cast< __t__* >(                   \
+        this->itk::ProcessObject::GetOutput(    \
+          this->m_##__n__##Idx                  \
+          ) ) );                                \
+  }                                             \
+  const __t__* Get##__n__( ) const              \
+  {                                             \
+    return(                                     \
+      dynamic_cast< const __t__* >(             \
+        this->itk::ProcessObject::GetOutput(    \
+          this->m_##__n__##Idx                  \
+          ) ) );                                \
+  }
+
+// -------------------------------------------------------------------------
+#define ivqITKOutputConfigureMacro( __n__, __t__ )              \
+  this->m_##__n__##Idx = this->GetNumberOfRequiredOutputs( );   \
+  this->itk::ProcessObject::SetNumberOfRequiredOutputs(         \
+    this->m_##__n__##Idx + 1                                    \
+    );                                                          \
+  this->SetNthOutput( this->m_##__n__##Idx, __t__::New( ) )
+
 #endif // __ivq__Config__h__
 
 // eof - $RCSfile$