]> Creatis software - bbtk.git/blobdiff - kernel/appli/bbfy/bbfy.cpp
*** empty log message ***
[bbtk.git] / kernel / appli / bbfy / bbfy.cpp
index e67bce9600757ff3c9c60d927a9cb56a9954b553..bb420978b4ec88ba69b36820dfb347958d8c77d3 100644 (file)
@@ -550,23 +550,34 @@ void bbfy::CreateHeader()
   mFile << "{\n";
 
   // Interface
-  mFile << "  BBTK_BLACK_BOX_INTERFACE("
-       << mName << ","
-       << mParentBlackBox << ");\n";
 
-  // typedef on itkfilter
+  // ITK 
   if (mType == itkImageToImageFilter)
     {
-      mFile << "  typedef " <<mItkParent <<" itkParent;"<<std::endl;
-      mFile << "  void bbDelete() { itkParent::UnRegister(); }"<<std::endl;
+      mFile << "  BBTK_ITK_BLACK_BOX_INTERFACE("
+           << mName << ","
+           << mParentBlackBox << ","
+           << mItkParent 
+           << ");\n";
     }
-  // typedef on itkfilter
-  if ( (mType == vtkImageAlgorithm) ||
+  // VTK
+  else if ( (mType == vtkImageAlgorithm) ||
        (mType == vtkPolyDataAlgorithm) )
     {
-      mFile << "  typedef " <<mVtkParent <<" vtkParent;"<<std::endl;
-      mFile << "  BBTK_VTK_DELETE(vtkParent);"<<std::endl;
+      mFile << "  BBTK_VTK_BLACK_BOX_INTERFACE("
+           << mName << ","
+           << mParentBlackBox << ","
+           << mVtkParent 
+           << ");\n";
+    }
+  // Default
+  else 
+    {
+      mFile << "  BBTK_BLACK_BOX_INTERFACE("
+           << mName << ","
+           << mParentBlackBox << ");\n";
     }
+
   for (i=mTypedef.begin(); i!=mTypedef.end(); ++i) 
     {
       mFile << *i <<"\n";
@@ -600,7 +611,6 @@ void bbfy::CreateHeader()
       else if (ioi->special=="itk input")
        {
          mFile << "  BBTK_DECLARE_ITK_INPUT(" 
-               << "itkParent,"
                << ioi->name
                << ","
                << ioi->type
@@ -610,7 +620,6 @@ void bbfy::CreateHeader()
        {
          if (mType == vtkImageAlgorithm) {
          mFile << "  BBTK_DECLARE_VTK_IMAGE_ALGORITHM_INPUT(" 
-               << "vtkParent,"
                << ioi->name
                << ","
                << ioi->type
@@ -618,7 +627,6 @@ void bbfy::CreateHeader()
          } 
          else if (mType == vtkPolyDataAlgorithm) {
          mFile << "  BBTK_DECLARE_POLY_DATA_ALGORITHM_INPUT(" 
-               << "vtkParent,"
                << ioi->name
                << ","
                << ioi->type
@@ -628,7 +636,6 @@ void bbfy::CreateHeader()
       else if (ioi->special=="itk parameter")
        {
          mFile << "  BBTK_DECLARE_ITK_PARAM(" 
-               << "itkParent,"
                << ioi->name
                << ","
                << ioi->type
@@ -637,7 +644,6 @@ void bbfy::CreateHeader()
       else if (ioi->special=="vtk parameter")
        {
          mFile << "  BBTK_DECLARE_VTK_PARAM(" 
-               << "vtkParent,"
                << ioi->name
                << ","
                << ioi->type
@@ -668,7 +674,6 @@ void bbfy::CreateHeader()
       else if (ioi->special=="itk output")
        {
          mFile << "  BBTK_DECLARE_ITK_OUTPUT(" 
-               << "itkParent,"
                << ioi->name
                << ","
                << ioi->type
@@ -677,7 +682,6 @@ void bbfy::CreateHeader()
       else if (ioi->special=="vtk output")
        {
          mFile << "  BBTK_DECLARE_VTK_OUTPUT(" 
-               << "vtkParent,"
                << ioi->name
                << ","
                << ioi->type
@@ -703,13 +707,13 @@ void bbfy::CreateHeader()
     }
   else if (mType == itkImageToImageFilter)
     {   
-      mFile << "  BBTK_PROCESS(itkParent::Update);\n" ;
+      mFile << "  BBTK_ITK_PROCESS();\n" ;
     }
   else if ((mType == vtkImageAlgorithm) ||
           (mType == vtkPolyDataAlgorithm) )
 
     {   
-      mFile << "  BBTK_PROCESS(vtkParent::Update);\n" ;
+      mFile << "  BBTK_VTK_PROCESS();\n" ;
     }
 
   // CreateWidget