]> Creatis software - bbtk.git/blobdiff - packages/vtk/src/bbvtkMIPCreator.cxx
comment out useless std::cout
[bbtk.git] / packages / vtk / src / bbvtkMIPCreator.cxx
index c4a04b87fd53180391e47c9cbe4b11066734929f..58ee8ae42ec02c5da30f1e1239a353239079f01f 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbvtkMIPCreator.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/10/17 08:18:30 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2010/04/08 14:37:59 $
+  Version:   $Revision: 1.7 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
  *  \brief 
  */
 
-
-
 #ifdef _USE_VTK_
 
-
 #include "bbvtkMIPCreator.h"
 #include "bbvtkPackage.h"
 
 namespace bbvtk
 {
-
-
    BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,MIPCreator)
    BBTK_BLACK_BOX_IMPLEMENTATION(MIPCreator,bbtk::AtomicBlackBox);
-
-
-
-
-
-   void MIPCreator::bbUserConstructor() 
-   { 
-     Init();
-     bbSetInputShift(0);
-     bbSetInputScale(1.);
-   }
-   void MIPCreator::bbUserCopyConstructor() 
+   
+       //---------------------------------------------------------------------
+   void MIPCreator::bbUserSetDefaultValues() 
    { 
-     Init();
+          bbSetInputShift(0);
+          bbSetInputScale(1.0);
+          mCast        = NULL;  
+          mMIP         = NULL;  
+          mMapper      = NULL;  
+          mVolume      = NULL;  
    }
-
-   void MIPCreator::Init() 
-   { 
-
+       //---------------------------------------------------------------------
+   void MIPCreator::bbUserInitializeProcessing() 
+   {   
     // Create the pipeline
     mCast = vtkImageShiftScale::New();
     mCast->SetOutputScalarTypeToUnsignedChar();
@@ -82,25 +72,44 @@ namespace bbvtk
     mVolume->SetMapper(mMapper);
 
     //  mMapper->ScalarVisibilityOff();
-    //    mMapper->ImmediateModeRenderingOn();
+    //  mMapper->ImmediateModeRenderingOn();
 
     bbSetOutputOut(mVolume);
 }
 
-   void MIPCreator::bbUserDestructor() 
+//---------------------------------------------------------------------
+   void MIPCreator::bbUserFinalizeProcessing() 
    { 
-     mCast->Delete();
-     mMIP->Delete();
-     mMapper->Delete();
-     mVolume->Delete();
-
+          if (mCast!=NULL)
+          {
+                  mCast->Delete();
+                  mCast=NULL;
+          }
+
+          if (mMIP!=NULL)
+          {
+                  mMIP->Delete();
+                  mMIP=NULL;
+          }
+
+          if (mMapper!=NULL)
+          {
+                  mMapper->Delete();
+                  mMapper=NULL;
+          }
+
+          if (mVolume!=NULL)
+          {
+                  mVolume->Delete();
+                  mVolume=NULL;
+          }
    }
 //---------------------------------------------------------------------
 
    void MIPCreator::Process()
    {
      mCast->SetInput( bbGetInputIn() );
-     mCast->SetScale( bbGetInputScale() / 100. );
+     mCast->SetScale( bbGetInputScale() / 100.0 );
      mCast->SetShift( -bbGetInputShift() );
 
      mMapper->Update();