]> Creatis software - bbtk.git/blobdiff - kernel/appli/bbfy/bbfy.cpp
.
[bbtk.git] / kernel / appli / bbfy / bbfy.cpp
index d528eb916e4e5ae60a104655e136064b33f67a44..48f8bb0e452de049f530202d7d267dbe94823ae2 100644 (file)
@@ -568,11 +568,12 @@ void bbfy::CreateHeader()
     {
       mFile << "   public " << mItkParent <<",\n";
     }
-  else if ( (mType == vtkImageAlgorithm) ||
-           (mType == vtkPolyDataAlgorithm) )
-    {
-      mFile << "   public " << mVtkParent <<",\n";
-    }
+//EED 15mai2009        
+//  else if ( (mType == vtkImageAlgorithm) ||
+//         (mType == vtkPolyDataAlgorithm) )
+//   {
+//      mFile << "   public " << mVtkParent <<",\n";
+//    }
 
   mFile << "   public "<<mParentBlackBox << "\n";
 
@@ -599,6 +600,7 @@ void bbfy::CreateHeader()
            << mVtkParent 
            << ");\n";
     }
+       
   // Default
   else 
     {
@@ -1074,21 +1076,36 @@ void bbfy::CreateCode()
       mFile << "}\n";
     }
 
-  // User constr / copy constr / destr implementation
+               
+  // User Set Default Values  
   mFile <<"void "<<mName<<"::bbUserSetDefaultValues()"<<std::endl;
   mFile << "{"<<std::endl;  
-  mFile << mUserSetDefaultValues << std::endl;
+       if ( (mType == vtkImageAlgorithm) || (mType == vtkPolyDataAlgorithm) )
+       {
+               mFile << "   mVtkObject = NULL;\n";
+       }
+       mFile << mUserSetDefaultValues << std::endl;
   mFile << "}" << std::endl;
 
+  // User Initialize Processing
   mFile <<"void "<<mName<<"::bbUserInitializeProcessing()"
        <<std::endl;
   mFile << "{"<<std::endl;
-  mFile << mUserInitializeProcessing << std::endl;
+       if ( (mType == vtkImageAlgorithm) || (mType == vtkPolyDataAlgorithm) )
+       {
+               mFile <<  "  mVtkObject = "<< mVtkParent <<"::New();\n";
+       }
+       mFile << mUserInitializeProcessing << std::endl;
   mFile << "}" << std::endl;
 
+       // User Finalize Processing
   mFile <<"void "<<mName<<"::bbUserFinalizeProcessing()"<<std::endl;
   mFile << "{"<<std::endl;
-  mFile << mUserFinalizeProcessing << std::endl;
+       if ( (mType == vtkImageAlgorithm) || (mType == vtkPolyDataAlgorithm) )
+       {
+               mFile << "   mVtkObject->Delete();\n";
+       }
+       mFile << mUserFinalizeProcessing << std::endl;
   mFile << "}" << std::endl;