From 64953af6e7389a36c4fb533b58bf720ba1342cd7 Mon Sep 17 00:00:00 2001 From: Eduardo Davila Date: Thu, 14 May 2009 16:21:13 +0000 Subject: [PATCH] defaultBalues InitializeProcessing FinalizeProcessing --- .../src/bbgdcmvtkGetInfoGdcmReader.cxx | 25 +++++++---- .../gdcmvtk/src/bbgdcmvtkGetInfoGdcmReader.h | 8 ---- .../bbgdcmvtkGetXCoherentInfoGdcmReader.cxx | 17 +++++--- .../src/bbgdcmvtkGetXCoherentInfoGdcmReader.h | 8 ---- .../src/bbitkvtkitkImage2vtkImageData.cxx | 24 +++++------ .../src/bbitkvtkitkImage2vtkImageData.h | 7 +--- .../src/bbitkvtkvtkImageData2itkImage.cxx | 13 +++--- packages/qt/src/bbqtLayoutLine.cxx | 15 +++++-- packages/qt/src/bbqtLayoutLine.h | 5 +-- packages/qt/src/bbqtLayoutSplit.cxx | 19 +++++++-- packages/qt/src/bbqtLayoutSplit.h | 5 +-- packages/qt/src/bbqtOutputText.cxx | 41 +++++++++---------- packages/qt/src/bbqtOutputText.h | 9 +--- packages/qt/src/bbqtSlider.cxx | 22 ++++++++-- packages/qt/src/bbqtSlider.h | 5 +-- 15 files changed, 121 insertions(+), 102 deletions(-) diff --git a/packages/gdcmvtk/src/bbgdcmvtkGetInfoGdcmReader.cxx b/packages/gdcmvtk/src/bbgdcmvtkGetInfoGdcmReader.cxx index d99d025..07da598 100644 --- a/packages/gdcmvtk/src/bbgdcmvtkGetInfoGdcmReader.cxx +++ b/packages/gdcmvtk/src/bbgdcmvtkGetInfoGdcmReader.cxx @@ -14,7 +14,9 @@ BBTK_ADD_BLACK_BOX_TO_PACKAGE(gdcmvtk,GetInfoGdcmReader) BBTK_BLACK_BOX_IMPLEMENTATION(GetInfoGdcmReader,bbtk::AtomicBlackBox); void GetInfoGdcmReader::Process() { - + // Reset de reader, f + bbUserFinalizeProcessing(); + f = GDCM_NAME_SPACE::File::New(); f->SetFileName( bbGetInputIn() ); bool res = f->Load(); @@ -61,21 +63,30 @@ void GetInfoGdcmReader::Process() bbSetOutputOut( reader->GetOutput() ); } -void GetInfoGdcmReader::bbUserConstructor() +void GetInfoGdcmReader::bbUserSetDefaultValues() { + reader=NULL; + f=NULL; bbSetInputIn(""); } -void GetInfoGdcmReader::bbUserCopyConstructor(bbtk::BlackBox::Pointer) +void GetInfoGdcmReader::bbUserInitializeProcessing() { - } -void GetInfoGdcmReader::bbUserDestructor() + + + +void GetInfoGdcmReader::bbUserFinalizeProcessing() { - if(reader) + if(reader){ reader->Delete(); - if(f) + reader=NULL; + } + if(f){ f->Delete(); + f=NULL; + } + } } diff --git a/packages/gdcmvtk/src/bbgdcmvtkGetInfoGdcmReader.h b/packages/gdcmvtk/src/bbgdcmvtkGetInfoGdcmReader.h index f676af2..d5dd7a0 100644 --- a/packages/gdcmvtk/src/bbgdcmvtkGetInfoGdcmReader.h +++ b/packages/gdcmvtk/src/bbgdcmvtkGetInfoGdcmReader.h @@ -17,14 +17,6 @@ class bbgdcmvtk_EXPORT GetInfoGdcmReader public bbtk::AtomicBlackBox { BBTK_BLACK_BOX_INTERFACE(GetInfoGdcmReader,bbtk::AtomicBlackBox); -//================================================================== -/// User callback called in the box contructor -virtual void bbUserConstructor(); -/// User callback called in the box copy constructor -virtual void bbUserCopyConstructor(bbtk::BlackBox::Pointer); -/// User callback called in the box destructor -virtual void bbUserDestructor(); -//================================================================== BBTK_DECLARE_INPUT(In, std::string); BBTK_DECLARE_OUTPUT(Out, vtkImageData *); diff --git a/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx b/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx index 93437d0..924048d 100644 --- a/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx +++ b/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx @@ -74,8 +74,12 @@ void GetXCoherentInfoGdcmReader::Process() - - reader = vtkGdcmReader::New(); + if (reader!=NULL) + { + reader->Delete(); + reader=NULL; + } + reader = vtkGdcmReader::New(); //reader->SetFileName( bbGetInputIn().c_str() ); reader->SetCoherentFileList(l); reader->Update(); @@ -84,19 +88,20 @@ void GetXCoherentInfoGdcmReader::Process() bbSetOutputOut( reader->GetOutput() ); } -void GetXCoherentInfoGdcmReader::bbUserConstructor() +void GetXCoherentInfoGdcmReader::bbUserSetDefaultValues() { std::vector init; init.push_back(""); bbSetInputIn(init); + reader=NULL; } -void GetXCoherentInfoGdcmReader::bbUserCopyConstructor(bbtk::BlackBox::Pointer) +void GetXCoherentInfoGdcmReader::bbUserInitializeProcessing() { - + } -void GetXCoherentInfoGdcmReader::bbUserDestructor() +void GetXCoherentInfoGdcmReader::bbUserFinalizeProcessing() { if(reader) reader->Delete(); diff --git a/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.h b/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.h index 224bdcc..d0e470f 100644 --- a/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.h +++ b/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.h @@ -19,14 +19,6 @@ class bbgdcmvtk_EXPORT GetXCoherentInfoGdcmReader public bbtk::AtomicBlackBox { BBTK_BLACK_BOX_INTERFACE(GetXCoherentInfoGdcmReader,bbtk::AtomicBlackBox); -//================================================================== -/// User callback called in the box contructor -virtual void bbUserConstructor(); -/// User callback called in the box copy constructor -virtual void bbUserCopyConstructor(bbtk::BlackBox::Pointer); -/// User callback called in the box destructor -virtual void bbUserDestructor(); -//================================================================== BBTK_DECLARE_INPUT(In, std::vector); BBTK_DECLARE_INPUT(IPPSort, bool); diff --git a/packages/itkvtk/src/bbitkvtkitkImage2vtkImageData.cxx b/packages/itkvtk/src/bbitkvtkitkImage2vtkImageData.cxx index e3a4631..6536641 100644 --- a/packages/itkvtk/src/bbitkvtkitkImage2vtkImageData.cxx +++ b/packages/itkvtk/src/bbitkvtkitkImage2vtkImageData.cxx @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbitkvtkitkImage2vtkImageData.cxx,v $ Language: C++ - Date: $Date: 2008/11/25 11:17:17 $ - Version: $Revision: 1.7 $ + Date: $Date: 2009/05/14 16:21:15 $ + Version: $Revision: 1.8 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -133,21 +133,21 @@ namespace bbitkvtk } - void itkImage2vtkImageData::bbUserConstructor() + void itkImage2vtkImageData::bbUserSetDefaultValues() { bbSetOutputOut(NULL); mConverter = 0; } - void itkImage2vtkImageData::bbUserCopyConstructor(bbtk::BlackBox::Pointer) - { - bbSetOutputOut(NULL); - mConverter = 0; - } - void itkImage2vtkImageData::bbUserDestructor() - { - } - + void GetXCoherentInfoGdcmReader::bbUserInitializeProcessing() + { + } + + void GetXCoherentInfoGdcmReader::bbUserFinalizeProcessing() + { + } + + } // eo namespace bbitkvtk diff --git a/packages/itkvtk/src/bbitkvtkitkImage2vtkImageData.h b/packages/itkvtk/src/bbitkvtkitkImage2vtkImageData.h index 8e52ec6..dd773b9 100644 --- a/packages/itkvtk/src/bbitkvtkitkImage2vtkImageData.h +++ b/packages/itkvtk/src/bbitkvtkitkImage2vtkImageData.h @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbitkvtkitkImage2vtkImageData.h,v $ Language: C++ - Date: $Date: 2008/11/25 11:17:18 $ - Version: $Revision: 1.8 $ + Date: $Date: 2009/05/14 16:21:15 $ + Version: $Revision: 1.9 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -59,9 +59,6 @@ namespace bbitkvtk BBTK_DECLARE_OUTPUT(Out,vtkImageData*); BBTK_PROCESS(Convert); void Convert(); - void bbUserConstructor(); - void bbUserCopyConstructor(bbtk::BlackBox::Pointer); - void bbUserDestructor(); private: // Convert method template on type of the itk image // embedded in the input itkImage* diff --git a/packages/itkvtk/src/bbitkvtkvtkImageData2itkImage.cxx b/packages/itkvtk/src/bbitkvtkvtkImageData2itkImage.cxx index a378afe..c1fb034 100644 --- a/packages/itkvtk/src/bbitkvtkvtkImageData2itkImage.cxx +++ b/packages/itkvtk/src/bbitkvtkvtkImageData2itkImage.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbitkvtkvtkImageData2itkImage.cxx,v $ Language: C++ - Date: $Date: 2008/11/25 11:17:18 $ - Version: $Revision: 1.4 $ + Date: $Date: 2009/05/14 16:21:15 $ + Version: $Revision: 1.5 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -131,21 +131,18 @@ namespace bbitkvtk } - void vtkImageData2itkImage::bbUserConstructor() + void vtkImageData2itkImage::bbUserSetDefaultValues() { // bbSetOutputOut(NULL); mConverter = 0; } - void vtkImageData2itkImage::bbUserCopyConstructor(bbtk::BlackBox::Pointer) + void vtkImageData2itkImage::bbUserInitializeProcessing() { - // bbSetOutputOut(NULL); - mConverter = 0; } - void vtkImageData2itkImage::bbUserDestructor() + void vtkImageData2itkImage::bbUserFinalizeProcessing() { - // if (mConverter) mConverter->UnRegister(); } diff --git a/packages/qt/src/bbqtLayoutLine.cxx b/packages/qt/src/bbqtLayoutLine.cxx index 031fff9..1919d15 100644 --- a/packages/qt/src/bbqtLayoutLine.cxx +++ b/packages/qt/src/bbqtLayoutLine.cxx @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbqtLayoutLine.cxx,v $ Language: C++ - Date: $Date: 2009/04/08 08:35:59 $ - Version: $Revision: 1.1 $ + Date: $Date: 2009/05/14 16:21:19 $ + Version: $Revision: 1.2 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -48,7 +48,7 @@ namespace bbqt BBTK_ADD_BLACK_BOX_TO_PACKAGE(qt, LayoutLine); BBTK_BLACK_BOX_IMPLEMENTATION(LayoutLine,bbtk::QtBlackBox); - void LayoutLine::bbUserConstructor() + void LayoutLine::bbUserSetDefaultValues() { bbSetInputOrientation("VERTICAL"); bbSetInputWidget1(NULL); @@ -62,6 +62,15 @@ namespace bbqt bbSetInputWidget9(NULL); } + void LayoutLine::bbUserInitializeProcessing() + { + } + + void LayoutLine::bbUserFinalizeProcessing() + { + } + + void LayoutLine::Process() { } diff --git a/packages/qt/src/bbqtLayoutLine.h b/packages/qt/src/bbqtLayoutLine.h index 3265a19..ae26cc4 100644 --- a/packages/qt/src/bbqtLayoutLine.h +++ b/packages/qt/src/bbqtLayoutLine.h @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbqtLayoutLine.h,v $ Language: C++ - Date: $Date: 2009/04/08 08:35:59 $ - Version: $Revision: 1.1 $ + Date: $Date: 2009/05/14 16:21:19 $ + Version: $Revision: 1.2 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -84,7 +84,6 @@ namespace bbqt void OnShowWidget(); protected: - virtual void bbUserConstructor(); // void TryInsertWindow(QWidget *parent, QWidget *w,qtBoxSizer *sizer); // }; diff --git a/packages/qt/src/bbqtLayoutSplit.cxx b/packages/qt/src/bbqtLayoutSplit.cxx index 7e3cfdc..a7c6ba1 100644 --- a/packages/qt/src/bbqtLayoutSplit.cxx +++ b/packages/qt/src/bbqtLayoutSplit.cxx @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbqtLayoutSplit.cxx,v $ Language: C++ - Date: $Date: 2009/04/08 08:35:59 $ - Version: $Revision: 1.1 $ + Date: $Date: 2009/05/14 16:21:19 $ + Version: $Revision: 1.2 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -47,7 +47,8 @@ namespace bbqt BBTK_ADD_BLACK_BOX_TO_PACKAGE(qt,LayoutSplit); BBTK_BLACK_BOX_IMPLEMENTATION(LayoutSplit,bbtk::QtBlackBox); - void LayoutSplit::bbUserConstructor() + + void LayoutSplit::bbUserSetDefaultValues() { bbSetInputOrientation("VERTICAL"); // bbSetInputProportion(50); @@ -73,6 +74,18 @@ namespace bbqt bbSetInputWeight9(1); } + + void LayoutSplit::bbUserInitializeProcessing() + { + } + + void LayoutSplit::bbUserFinalizeProcessing() + { + } + + + + void LayoutSplit::Process() { } diff --git a/packages/qt/src/bbqtLayoutSplit.h b/packages/qt/src/bbqtLayoutSplit.h index b9d9b1b..6c90362 100644 --- a/packages/qt/src/bbqtLayoutSplit.h +++ b/packages/qt/src/bbqtLayoutSplit.h @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbqtLayoutSplit.h,v $ Language: C++ - Date: $Date: 2009/04/08 08:35:59 $ - Version: $Revision: 1.1 $ + Date: $Date: 2009/05/14 16:21:19 $ + Version: $Revision: 1.2 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -92,7 +92,6 @@ namespace bbqt void OnShowWidget(); protected: - virtual void bbUserConstructor(); }; //================================================================= diff --git a/packages/qt/src/bbqtOutputText.cxx b/packages/qt/src/bbqtOutputText.cxx index aa8a14b..170cdf7 100644 --- a/packages/qt/src/bbqtOutputText.cxx +++ b/packages/qt/src/bbqtOutputText.cxx @@ -7,9 +7,9 @@ namespace bbqt BBTK_ADD_BLACK_BOX_TO_PACKAGE(qt,QOutputText) BBTK_BLACK_BOX_IMPLEMENTATION(QOutputText,bbtk::QtBlackBox); + void QOutputText::Process() { - std::string msg; if (bbGetInputTitle()!="") { @@ -21,36 +21,33 @@ void QOutputText::Process() } ((QLabel*)bbGetOutputWidget())->setText( msg.c_str() ); //SetLabel( bbtk::std2wx( msg ) ); - } + + void QOutputText::CreateWidget(QWidget* parent) { - bbSetOutputWidget( new QLabel( parent ) ); //wxStaticText ( bbGetWxParent() , -1 , _T("") ) ); Process(); - -} -void QOutputText::bbUserConstructor() -{ - - bbSetInputIn(""); - bbSetInputTitle(""); - } -void QOutputText::bbUserCopyConstructor(bbtk::BlackBox::Pointer) -{ - + + + void QOutputText::bbUserSetDefaultValues() + { + bbSetInputIn(""); + bbSetInputTitle(""); + } + + void QOutputText::bbUserInitializeProcessing() + { + } + + void QOutputText::bbUserFinalizeProcessing() + { + } + - -} -void QOutputText::bbUserDestructor() -{ - - - -} } // EO namespace bbqt diff --git a/packages/qt/src/bbqtOutputText.h b/packages/qt/src/bbqtOutputText.h index d61db3c..bef500b 100644 --- a/packages/qt/src/bbqtOutputText.h +++ b/packages/qt/src/bbqtOutputText.h @@ -13,14 +13,7 @@ class bbqt_EXPORT QOutputText public bbtk::QtBlackBox { BBTK_BLACK_BOX_INTERFACE(QOutputText,bbtk::QtBlackBox); -//================================================================== -/// User callback called in the box contructor -virtual void bbUserConstructor(); -/// User callback called in the box copy constructor -virtual void bbUserCopyConstructor(bbtk::BlackBox::Pointer); -/// User callback called in the box destructor -virtual void bbUserDestructor(); -//================================================================== + BBTK_DECLARE_INPUT(Title,std::string); BBTK_DECLARE_INPUT(In,std::string); BBTK_PROCESS(Process); diff --git a/packages/qt/src/bbqtSlider.cxx b/packages/qt/src/bbqtSlider.cxx index c456c7c..913697d 100644 --- a/packages/qt/src/bbqtSlider.cxx +++ b/packages/qt/src/bbqtSlider.cxx @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbqtSlider.cxx,v $ Language: C++ - Date: $Date: 2009/04/08 08:36:00 $ - Version: $Revision: 1.1 $ + Date: $Date: 2009/05/14 16:21:19 $ + Version: $Revision: 1.2 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -59,7 +59,7 @@ namespace bbqt BBTK_ADD_BLACK_BOX_TO_PACKAGE(qt,Slider); //-------------------------------------------------------------------------- - void Slider::bbUserConstructor() + void Slider::bbUserSetDefaultValues() { bbSetInputIn(0); bbSetInputMin(0); @@ -72,6 +72,22 @@ namespace bbqt } //-------------------------------------------------------------------------- + + //-------------------------------------------------------------------------- + void Slider::bbUserInitializeProcessing() + { + } + //-------------------------------------------------------------------------- + + + //-------------------------------------------------------------------------- + void Slider::bbUserFinalizeProcessing() + { + } + //-------------------------------------------------------------------------- + + + //-------------------------------------------------------------------------- void Slider::Process() { diff --git a/packages/qt/src/bbqtSlider.h b/packages/qt/src/bbqtSlider.h index 66b3823..dbba168 100644 --- a/packages/qt/src/bbqtSlider.h +++ b/packages/qt/src/bbqtSlider.h @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbqtSlider.h,v $ Language: C++ - Date: $Date: 2009/04/08 08:36:00 $ - Version: $Revision: 1.1 $ + Date: $Date: 2009/05/14 16:21:19 $ + Version: $Revision: 1.2 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -95,7 +95,6 @@ namespace bbqt protected: - virtual void bbUserConstructor(); // QSlider* mSlider; }; -- 2.45.1