From f5db17702a2c51a5933f6c556d070167e4db9cfd Mon Sep 17 00:00:00 2001 From: guigues Date: Thu, 7 Feb 2008 07:58:53 +0000 Subject: [PATCH] Renamed UserBlackBox into AtomicBlackBox which is a better name (versus ComplexBlackBox). Made all the induced changes (many !!!!) --- kernel/src/bbtkBlackBoxDescriptor.cxx | 10 +- kernel/src/bbtkUserBlackBox.cxx | 288 -------- kernel/src/bbtkUserBlackBox.h | 143 ---- kernel/src/bbtkUserBlackBoxDescriptor.h | 78 -- kernel/src/bbtkUserBlackBoxGetSetFunctor.h | 268 ------- .../src/bbtkUserBlackBoxInputDescriptor.cxx | 60 -- kernel/src/bbtkUserBlackBoxInputDescriptor.h | 83 --- kernel/src/bbtkUserBlackBoxMacros.h | 683 ------------------ .../src/bbtkUserBlackBoxOutputDescriptor.cxx | 57 -- kernel/src/bbtkUserBlackBoxOutputDescriptor.h | 78 -- kernel/src/bbtkWxBlackBox.cxx | 6 +- kernel/src/bbtkWxBlackBox.h | 14 +- .../itk/src/bbitkAnyImageToTypedImage.cxx | 4 +- packages/itk/src/bbitkAnyImageToTypedImage.h | 18 +- .../src/bbitkBinaryThresholdImageFilter.cxx | 4 +- .../itk/src/bbitkBinaryThresholdImageFilter.h | 12 +- packages/itk/src/bbitkExtractImageFilter.cxx | 4 +- packages/itk/src/bbitkExtractImageFilter.h | 13 +- packages/itk/src/bbitkImage.cxx | 2 +- packages/itk/src/bbitkImageProperties.cxx | 6 +- packages/itk/src/bbitkImageProperties.h | 17 +- packages/itk/src/bbitkImageReader.cxx | 6 +- packages/itk/src/bbitkImageReader.h | 18 +- packages/itk/src/bbitkImageRegion.cxx | 2 +- packages/itk/src/bbitkImageRegion.h | 8 +- packages/itk/src/bbitkImageSeriesReader.cxx | 6 +- packages/itk/src/bbitkImageSeriesReader.h | 17 +- packages/itk/src/bbitkImageToString.cxx | 2 +- packages/itk/src/bbitkImageWriter.cxx | 6 +- packages/itk/src/bbitkImageWriter.h | 16 +- packages/itk/src/bbitkResampleImageFilter.cxx | 2 +- packages/itk/src/bbitkResampleImageFilter.h | 8 +- .../itk/src/bbitkTypedImageToAnyImage.cxx | 2 +- packages/itk/src/bbitkTypedImageToAnyImage.h | 10 +- packages/std/src/bbstdAdd.xml | 2 +- packages/std/src/bbstdConcatStrings.cxx | 2 +- packages/std/src/bbstdConcatStrings.h | 30 +- packages/std/src/bbstdConfiguration.cxx | 2 +- packages/std/src/bbstdConfiguration.h | 14 +- packages/std/src/bbstdMagicBox.cxx | 2 +- packages/std/src/bbstdMagicBox.h | 31 +- packages/std/src/bbstdMakeFileName.cxx | 2 +- packages/std/src/bbstdMakeFileName.h | 18 +- packages/std/src/bbstdMultipleInputs.xml | 4 +- packages/std/src/bbstdRelay.h | 15 +- packages/std/src/bbstdStringSelect.cxx | 2 +- packages/std/src/bbstdStringSelect.h | 39 +- packages/std/src/bbstdStringTo.cxx | 2 +- packages/std/src/bbstdStringTo.h | 22 +- packages/std/src/bbstdStringToVector.cxx | 2 +- packages/std/src/bbstdStringToVector.h | 106 +-- packages/std/src/bbstdToString.cxx | 2 +- packages/std/src/bbstdToString.h | 21 +- packages/std/src/bbstdVectorToString.cxx | 2 +- packages/std/src/bbstdVectorToString.h | 18 +- packages/wx/src/bbwxNotebook.h | 6 +- packages/wx/src/bbwxSizer.h | 6 +- packages/wx/src/bbwxSplit.h | 6 +- 58 files changed, 299 insertions(+), 2008 deletions(-) delete mode 100644 kernel/src/bbtkUserBlackBox.cxx delete mode 100644 kernel/src/bbtkUserBlackBox.h delete mode 100644 kernel/src/bbtkUserBlackBoxDescriptor.h delete mode 100644 kernel/src/bbtkUserBlackBoxGetSetFunctor.h delete mode 100644 kernel/src/bbtkUserBlackBoxInputDescriptor.cxx delete mode 100644 kernel/src/bbtkUserBlackBoxInputDescriptor.h delete mode 100644 kernel/src/bbtkUserBlackBoxMacros.h delete mode 100644 kernel/src/bbtkUserBlackBoxOutputDescriptor.cxx delete mode 100644 kernel/src/bbtkUserBlackBoxOutputDescriptor.h diff --git a/kernel/src/bbtkBlackBoxDescriptor.cxx b/kernel/src/bbtkBlackBoxDescriptor.cxx index c81206d..6f5ab20 100644 --- a/kernel/src/bbtkBlackBoxDescriptor.cxx +++ b/kernel/src/bbtkBlackBoxDescriptor.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkBlackBoxDescriptor.cxx,v $ Language: C++ - Date: $Date: 2008/02/06 14:14:22 $ - Version: $Revision: 1.9 $ + Date: $Date: 2008/02/07 07:58:53 $ + Version: $Revision: 1.10 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -24,7 +24,7 @@ #include "bbtkMessageManager.h" #include "bbtkPackage.h" #include "bbtkUtilities.h" -#include "bbtkUserBlackBoxDescriptor.h" +#include "bbtkAtomicBlackBoxDescriptor.h" #include "bbtkWxBlackBox.h" namespace bbtk @@ -280,7 +280,7 @@ namespace bbtk std::string col(usercol); int iotype = 0; if (in->second->GetCreatorTypeInfo() == - typeid(UserBlackBoxDescriptor)) + typeid(AtomicBlackBoxDescriptor)) { col = ubbcol; iotype = 1; @@ -343,7 +343,7 @@ namespace bbtk std::string col(usercol); int iotype = 0; if (o->second->GetCreatorTypeInfo() == - typeid(UserBlackBoxDescriptor)) + typeid(AtomicBlackBoxDescriptor)) { col = ubbcol; iotype = 1; diff --git a/kernel/src/bbtkUserBlackBox.cxx b/kernel/src/bbtkUserBlackBox.cxx deleted file mode 100644 index 3f0dc0e..0000000 --- a/kernel/src/bbtkUserBlackBox.cxx +++ /dev/null @@ -1,288 +0,0 @@ -/*========================================================================= - - Program: bbtk - Module: $RCSfile: bbtkUserBlackBox.cxx,v $ - Language: C++ - Date: $Date: 2008/02/05 13:23:46 $ - Version: $Revision: 1.2 $ - - Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de - l'Image). All rights reserved. See Doc/License.txt or - http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - - -/** - * \file - * \brief class bbtk::UserBlackBox : abstract user defined black boxes - */ -#include "bbtkUserBlackBox.h" - -namespace bbtk -{ - - //========================================================================= - UserBlackBox::UserBlackBox(const std::string &name, bool alloc) - : BlackBox(name) - { - bbtkDebugMessageInc("Kernel",7, - "UserBlackBox::UserBlackBox(\"" - < UserBlackBox::bbBackwardUpdate() [" - < UserBlackBox::bbForwardUpdate() [" - <GetOutputDescriptor(name))->GetGetFunctor()->Get(this); - - bbtkDebugDecTab("Data",7); - return p; - } - //========================================================================= - - - //========================================================================= - /// Gets the input Data of a given name - Data UserBlackBox::bbGetInput( const std::string &name ) - { - bbtkDebugMessageInc("Data",7, - "UserBlackBox::bbGetInput(\""<GetInputDescriptor(name))->GetGetFunctor()->Get(this); - - bbtkDebugDecTab("Data",7); - return p; - } - //========================================================================= - - - //========================================================================= - /// Sets the data of the output called - void UserBlackBox::bbSetOutput( const std::string &name, Data data) - { - bbtkDebugMessageInc("Data",7, - "UserBlackBox::bbSetOutput(\""<GetOutputDescriptor(name))->GetSetFunctor()->Set(this,data); - - bbtkDebugDecTab("Data",7); - } - //========================================================================= - - - //========================================================================= - /// Sets the data of the input called - void UserBlackBox::bbSetInput( const std::string &name, Data data, - bool setModified ) - { - bbtkDebugMessageInc("Data",7, - "UserBlackBox::bbSetInput(\""<GetInputDescriptor(name))->GetSetFunctor()->Set(this,data); - - if (setModified) - { - bbSetModifiedStatus(); - } - - bbtkDebugDecTab("Data",7); - } - //========================================================================= - - //========================================================================= - /// Sets the data of the input called - void UserBlackBox::bbBruteForceSetInputPointer( const std::string &name, - void* data, - bool setModified ) - { - bbtkDebugMessageInc("Data",7, - "UserBlackBox::bbBruteForceSetInputPointer(\"" - <GetInputDescriptor(name))->GetSetFunctor()->BruteForceSetPointer(this,data); - - if (setModified) - { - bbSetModifiedStatus(); - } - - bbtkDebugDecTab("Data",7); - } - //========================================================================= - -} -// EO namespace bbtk diff --git a/kernel/src/bbtkUserBlackBox.h b/kernel/src/bbtkUserBlackBox.h deleted file mode 100644 index 900fc08..0000000 --- a/kernel/src/bbtkUserBlackBox.h +++ /dev/null @@ -1,143 +0,0 @@ -/*========================================================================= - - Program: bbtk - Module: $RCSfile: bbtkUserBlackBox.h,v $ - Language: C++ - Date: $Date: 2008/01/22 15:41:34 $ - Version: $Revision: 1.2 $ - - Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de - l'Image). All rights reserved. See Doc/License.txt or - http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - - -/** - * \file - * \brief class bbtk::UserBlackBox : Ancestor of all user defined (concrete) black boxes - */ - -/** - * \class bbtk::UserBlackBox - * \brief Ancestor of all user defined (concrete) black boxes. - */ - -#ifndef __bbtkUserBlackBox_h__ -#define __bbtkUserBlackBox_h__ - -#include "bbtkBlackBox.h" -#include "bbtkUserBlackBoxDescriptor.h" - -namespace bbtk -{ - - - //================================================================== - class BBTK_EXPORT UserBlackBox : public bbtk::BlackBox - { - //================================================================== - public: - //================================================================== - /// Gets the output Data of a given label - Data bbGetOutput( const std::string &label ); - /// Gets the input Data of a given label - Data bbGetInput( const std::string &label ); - /// Sets the data of the output called - void bbSetOutput( const std::string &name, Data data); - /// Sets the data of the input called - void bbSetInput( const std::string &name, Data data, - bool setModified = true); - /// Sets the data of the input called - void bbBruteForceSetInputPointer( const std::string &name, - void* data, - bool setModified = true); - //================================================================== - - //================================================================== - /// Destructor - virtual ~UserBlackBox(); - //================================================================== - - //================================================================== - protected: - //================================================================== - /// Constructor with the UserBlackBox's instance name - UserBlackBox(const std::string &name, bool alloc = true); - /// Constructor from an existing box (copy) with a new instance name - UserBlackBox(UserBlackBox& from, const std::string &name, - bool alloc = true); - //================================================================== - - public: - //================================================================== - /// Recursive pipeline processing in backward direction - /// (recursion is in backward direction however execution always goes forward). - /// - /// \returns The final status of the box (UPTODATE or MODIFIED) - /// - /// First checks that re-processing is needed (either Status==MODIFIED or InputProcessMode==Always) - /// then : - /// - updates its inputs by calling bbUpdateInputs (which recursively calls bbBackwardUpdate on amont boxes) - /// - calls bbProcess which here simply calls the user callback bbUserProcess which does the actual processing. - /// bbProcess is overloaded in WxBlackBox to handle widget creation and show - IOStatus bbBackwardUpdate(Connection* caller); - //================================================================== - - //================================================================== - protected: - //================================================================== - /// Calls the user defined processing method. - /// Overloaded in WxBlackBox to handle widget creation and show - virtual void bbProcess() { this->bbUserProcess(); } - //================================================================== - - //================================================================== - /// User callback which computes the outputs as a function of the inputs. - /// It is assumed to be deterministic and thus is only called is the inputs have changed - /// (i.e. if the black box is marked as modified) - virtual void bbUserProcess() - { - bbtkWarning("UserBlackBox::bbUserProcess() not overloaded for box '" - <(&BlackBox::bbGetInputBoxProcessMode), - new bbtk::UserBlackBoxTSetFunctor(&BlackBox::bbSetInputBoxProcessMode) ) ); - // Creates the input 'BoxExecute' - AddInputDescriptor - (new - bbtk::UserBlackBoxInputDescriptor - (typeid(UserBlackBoxDescriptor), - "BoxExecute", - "Any signal received by this input executes the box", - new bbtk::UserBlackBoxTGetFunctor(&BlackBox::bbGetInputBoxExecute), - new bbtk::UserBlackBoxTSetFunctor(&BlackBox::bbSetInputBoxExecute) ) ); - // Creates the output 'BoxChange' - AddOutputDescriptor - (new - bbtk::UserBlackBoxOutputDescriptor - (typeid(UserBlackBoxDescriptor), - "BoxChange", - "Signal modifications of the box", - new bbtk::UserBlackBoxTGetFunctor(&BlackBox::bbGetOutputBoxChange), - new bbtk::UserBlackBoxTSetFunctor(&BlackBox::bbSetOutputBoxChange) ) ); - // - AddToCategory("atomic box"); - } - }; - -} -// namespace bbtk -#endif diff --git a/kernel/src/bbtkUserBlackBoxGetSetFunctor.h b/kernel/src/bbtkUserBlackBoxGetSetFunctor.h deleted file mode 100644 index cbab151..0000000 --- a/kernel/src/bbtkUserBlackBoxGetSetFunctor.h +++ /dev/null @@ -1,268 +0,0 @@ -/*========================================================================= - - Program: bbtk - Module: $RCSfile: bbtkUserBlackBoxGetSetFunctor.h,v $ - Language: C++ - Date: $Date: 2008/02/05 13:23:46 $ - Version: $Revision: 1.2 $ - - Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de - l'Image). All rights reserved. See Doc/License.txt or - http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - - -/** - * \file - * \brief Class bbtk::UserBlackBoxGetFunctor / Class bbtk::UserBlackBoxSetFunctor : abstract functors of the Get and Set accessors of the inputs and outputs of a UserBlackBox ; Concrete derivatives. - */ - -/** - * \class bbtk::UserBlackBoxGetFunctor - * \brief Abstract functor of the Get accessors of the inputs and outputs of a UserBlackBox - * \class bbtk::UserBlackBoxSetFunctor - * \brief Abstract functor of the Set accessors of the inputs and outputs of a UserBlackBox - * \class bbtk::UserBlackBoxTGetFunctor - * \brief Template for concrete functors of the Get accessors of the inputs and outputs of a UserBlackBox (inherits from bbtk::UserBlackBoxGetFunctor). - * \class bbtk::UserBlackBoxTSetFunctor - * \brief Template for concrete functors of the Set accessors of the inputs and outputs of a UserBlackBox (inherits from bbtk::UserBlackBoxSetFunctor). - */ - -#ifndef __bbtkUserBlackBoxGetSetFunctor_h__ -#define __bbtkUserBlackBoxGetSetFunctor_h__ - -#include "bbtkData.h" -#include "bbtkMessageManager.h" - -namespace bbtk -{ - - // Forward declaration - class UserBlackBox; - - - //=========================================================================== - class BBTK_EXPORT UserBlackBoxGetFunctor - { - public: - /// Default constructor - UserBlackBoxGetFunctor() {} - /// Abstract method which applies the "Get" function of UserBlackBox o - virtual Data Get(UserBlackBox* o) = 0; - /// - virtual TypeInfo GetTypeInfo() const = 0; - /// - virtual std::string GetTypeName() const = 0; - /// - virtual std::string GetHumanTypeName() const = 0; - /// - virtual bool IsPointerType() const = 0; - - }; - //=========================================================================== - - - //=========================================================================== - class UserBlackBoxSetFunctor - { - public: - /// Default constructor - UserBlackBoxSetFunctor() {} - /// Abstract method which applies the "Set" function of UserBlackBox o - virtual void Set(UserBlackBox* o, const Data&) = 0; - /// - virtual TypeInfo GetTypeInfo() const = 0; - /// - virtual std::string GetTypeName() const = 0; - /// - virtual std::string GetHumanTypeName() const = 0; - /// - virtual bool IsPointerType() const = 0; - /// Abstract method which applies the "Set" function of UserBlackBox o - /// using brute force cast to the typed pointer required by the "Set" fun. - /// Only works if the param type of the "Set" function is a pointer - /// (see template specialization below). - /// !!! Use with care !!! - virtual void BruteForceSetPointer(UserBlackBox* o, void* p) = 0; - - }; - //=========================================================================== - - - - //=========================================================================== - template - class UserBlackBoxTGetFunctor : public bbtk::UserBlackBoxGetFunctor - { - public: - /// Type of pointer on a UBB::Get method - typedef TRETURN (UBB::*GetMethodPointerType)(void); //const - - /// Construction with the pointer on the Get method - UserBlackBoxTGetFunctor(GetMethodPointerType g) : - mGetMethodPointer(g) - { - bbtkDebugMessage("Data",9,"UserBlackBoxTGetFunctor<"<< - TypeName()<<","<< - TypeName()<<","<< - TypeName()<< - ">::UserBlackBoxTGetFunctor()"<()<<","<< - TypeName()<<","<< - TypeName()<< - ">::Get()"<*mGetMethodPointer)(); - } - /// - TypeInfo GetTypeInfo() const { return typeid(T); } - std::string GetTypeName() const { return TypeName(); } - std::string GetHumanTypeName() const { return HumanTypeName(); } - /// - virtual bool IsPointerType() const - { -#ifdef _USE_BOOST_ - return boost::is_pointer::value; -#else - return false; -#endif - } - - private: - /// Pointer on the Get method - GetMethodPointerType mGetMethodPointer; - }; - //=========================================================================== - - - - //=========================================================================== - template - class UserBlackBoxTSetFunctor : public UserBlackBoxSetFunctor - { - public: - /// Type of pointer on a UBB::Set method - typedef void (UBB::*SetMethodPointerType)(TACCESS); - - /// Construction with the pointer on the Set method - UserBlackBoxTSetFunctor(SetMethodPointerType s) : - mSetMethodPointer(s) - { - bbtkDebugMessage("Data",9,"UserBlackBoxTSetFunctor<"<< - TypeName()<<","<< - TypeName()<<","<< - TypeName()<< - ">::UserBlackBoxTSetFunctor()"<()<<","<< - TypeName()<<","<< - TypeName()<< - ">::Set()"<*mSetMethodPointer)(*(T*)d); - // bbtkAssert( bbtkEqualTypes( d.type(), typeid(T) ) ); - T t = d.unsafe_get(); - (((UBB*)o)->*mSetMethodPointer)(t); - // bbtkDebugMessage("Kernel",9,"SetOK"<(); } - std::string GetHumanTypeName() const { return HumanTypeName(); } - virtual bool IsPointerType() const { return false; } - virtual void BruteForceSetPointer(UserBlackBox* b, void* p) - { - bbtkInternalError("UserBlackBoxTSetFunctor<" - <()<<"," - <()<<"," - <() - <<">::BruteForceSetPointer(" - <() - <<"' is not a pointer type"); - } - private: - /// Pointer on the Set method - SetMethodPointerType mSetMethodPointer; - }; - //=========================================================================== - - - - //=========================================================================== - /// Template specialization of UserBlackBoxTSetFunctor for pointer types - template - class UserBlackBoxTSetFunctor - : public UserBlackBoxSetFunctor - { - public: - /// Type of pointer on a UBB::Set method - typedef void (UBB::*SetMethodPointerType)(TACCESS*); - - /// Construction with the pointer on the Set method - UserBlackBoxTSetFunctor(SetMethodPointerType s) : - mSetMethodPointer(s) - { - bbtkDebugMessage("Data",9,"UserBlackBoxTSetFunctor<"<< - TypeName()<<","<< - TypeName()<<","<< - TypeName()<< - ">::UserBlackBoxTSetFunctor()"<()<<","<< - TypeName()<<","<< - TypeName()<< - ">::Set()"<*mSetMethodPointer)(d.unsafe_get()); - - } - - /// - TypeInfo GetTypeInfo() const { return typeid(T*); } - std::string GetTypeName() const { return TypeName(); } - std::string GetHumanTypeName() const { return HumanTypeName(); } - virtual bool IsPointerType() const { return true; } - - - virtual void BruteForceSetPointer(UserBlackBox* o, void* p) - { - bbtkDebugMessage("Data",9,"UserBlackBoxTSetFunctor<" - <()<<"," - <()<<"," - <() - <<">::BruteForceSetPointer() (pointer specialization)"); - - (((UBB*)o)->*mSetMethodPointer)((T*)p); - - } - private: - /// Pointer on the Set method - SetMethodPointerType mSetMethodPointer; - }; - //=========================================================================== - -} -// namespace bbtk -#endif diff --git a/kernel/src/bbtkUserBlackBoxInputDescriptor.cxx b/kernel/src/bbtkUserBlackBoxInputDescriptor.cxx deleted file mode 100644 index 91d0ed6..0000000 --- a/kernel/src/bbtkUserBlackBoxInputDescriptor.cxx +++ /dev/null @@ -1,60 +0,0 @@ -/*========================================================================= - - Program: bbtk - Module: $RCSfile: bbtkUserBlackBoxInputDescriptor.cxx,v $ - Language: C++ - Date: $Date: 2008/02/06 14:14:22 $ - Version: $Revision: 1.3 $ - - Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de - l'Image). All rights reserved. See Doc/License.txt or - http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - -/** - * \file - * \brief Class bbtk::UserBlackBoxInputDescriptor : structure containing the description of a UserBlackBox input (name, description, type, functor) - */ -#include "bbtkUserBlackBoxInputDescriptor.h" - - -namespace bbtk -{ - - UserBlackBoxInputDescriptor:: - UserBlackBoxInputDescriptor( TypeInfo creator_type_info, - const std::string& name, - const std::string& description, - UserBlackBoxGetFunctor* getfunctor, - UserBlackBoxSetFunctor* setfunctor, - bool copy_construct) - : - BlackBoxInputDescriptor(creator_type_info, - name,description,MANDATORY,copy_construct), - mGetFunctor(getfunctor), - mSetFunctor(setfunctor) - { - bbtkDebugMessage("Kernel",9, - "UserBlackBoxInputDescriptor::" - <<"UserBlackBoxInputDescriptor(\"" - < - -namespace bbtk -{ - - - class BBTK_EXPORT UserBlackBoxInputDescriptor : - public bbtk::BlackBoxInputDescriptor - { - public: - //typedef enum { - // MANDATORY, - // OPTIONAL - //} InputType; - - - UserBlackBoxInputDescriptor( TypeInfo creator_type_info, - const std::string& name, - const std::string& description, - UserBlackBoxGetFunctor* getfunctor, - UserBlackBoxSetFunctor* setfunctor, - bool copy_construct = true); - - ~UserBlackBoxInputDescriptor(); - /// Returns the type of the input - TypeInfo GetTypeInfo() const { return mGetFunctor->GetTypeInfo(); } - /// Returns the name of the type of the input - std::string GetTypeName() const { return mGetFunctor->GetTypeName(); } - /// Returns the name of the type of the input - std::string GetHumanTypeName() const { return mGetFunctor->GetHumanTypeName(); } - /// Returns true iff the type is a pointer to class - virtual bool IsPointerType() const { return mGetFunctor->IsPointerType(); } - /// Returns the functor on the Get method - UserBlackBoxGetFunctor* GetGetFunctor() { return mGetFunctor; } - /// Returns the functor on the Set method - UserBlackBoxSetFunctor* GetSetFunctor() { return mSetFunctor; } - - - private: - /// Default ctor is private - UserBlackBoxInputDescriptor() : - BlackBoxInputDescriptor(typeid(void),"","") {} - /// The functor on the Get method - UserBlackBoxGetFunctor* mGetFunctor; - /// The functor on the Set method - UserBlackBoxSetFunctor* mSetFunctor; - }; - -} -// namespace bbtk -#endif diff --git a/kernel/src/bbtkUserBlackBoxMacros.h b/kernel/src/bbtkUserBlackBoxMacros.h deleted file mode 100644 index 10b12ac..0000000 --- a/kernel/src/bbtkUserBlackBoxMacros.h +++ /dev/null @@ -1,683 +0,0 @@ -/*========================================================================= - - Program: bbtk - Module: $RCSfile: bbtkUserBlackBoxMacros.h,v $ - Language: C++ - Date: $Date: 2008/02/06 14:14:22 $ - Version: $Revision: 1.7 $ - - Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de - l'Image). All rights reserved. See Doc/License.txt or - http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - - -/** - * \file - * \brief Defines macros for the creation of new user black boxes - */ -#ifndef __bbtkUserBlackBoxMacros_h__ -#define __bbtkUserBlackBoxMacros_h__ - -//============================================================================ -/// Declares the standard interface of a UserBlackBox -/// (ctor, New, descriptor related methods) -#define BBTK_USER_BLACK_BOX_INTERFACE(CLASS,PARENT) \ - private: \ - inline static void bbCreateDescriptorIfNeeded(); \ - protected: \ - CLASS(const std::string& name, bool allocate_connectors = true); \ - CLASS(CLASS& from, const std::string& name, \ - bool allocate_connectors = true); \ - ~CLASS(); \ - public: \ - inline static CLASS* bbNew(const std::string& name) \ - { \ - bbtkDebugMessageInc("Kernel",9,#CLASS<<"::bbNew(\""< "<bbGetFullName()<<"]"< \ - (&CLASS::bbGetInput##NAME), \ - new bbtk::UserBlackBoxTSetFunctor \ - (&CLASS::bbSetInput##NAME) ) ) -//============================================================================ - -//============================================================================ -/// Describes a UserBlackBox output (to be put inside the UBB description block) -#define BBTK_OUTPUT(CLASS,NAME,DESCR,TYPE) \ - AddOutputDescriptor(new bbtk::UserBlackBoxOutputDescriptor \ - (typeid(CLASS ## Descriptor),#NAME,DESCR, \ - new bbtk::UserBlackBoxTGetFunctor \ - (&CLASS::bbGetOutput##NAME), \ - new bbtk::UserBlackBoxTSetFunctor \ - (&CLASS::bbSetOutput##NAME) ) ) -//============================================================================ - -//============================================================================ -/// Describes a UserBlackBox input (to be put inside the UBB description block) -#define BBTK_INPUT_NOCOPY(CLASS,NAME,DESCR,TYPE) \ - AddInputDescriptor(new bbtk::UserBlackBoxInputDescriptor \ - (typeid(CLASS ## Descriptor),#NAME,DESCR, \ - new bbtk::UserBlackBoxTGetFunctor \ - (&CLASS::bbGetInput##NAME), \ - new bbtk::UserBlackBoxTSetFunctor \ - (&CLASS::bbSetInput##NAME), \ - false) ) -//============================================================================ - -//============================================================================ -/// Describes a UserBlackBox output (to be put inside the UBB description block) -#define BBTK_OUTPUT_NOCOPY(CLASS,NAME,DESCR,TYPE) \ - AddOutputDescriptor(new bbtk::UserBlackBoxOutputDescriptor \ - (typeid(CLASS ## Descriptor),#NAME,DESCR, \ - new bbtk::UserBlackBoxTGetFunctor \ - (&CLASS::bbGetOutput##NAME), \ - new bbtk::UserBlackBoxTSetFunctor \ - (&CLASS::bbSetOutput##NAME),\ - false) ) -//============================================================================ - - - - - - - - - - -//============================================================================ -//============================================================================ -// Template user black boxes macros -//============================================================================ -//============================================================================ - -//============================================================================ -/// Begins a template UserBlackBox of template param T description block -#define BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(CLASS) \ - template \ - class /*BBTK_EXPORT*/ CLASS ## Descriptor : public bbtk::BlackBoxDescriptor \ - { \ - public: \ - bbtk::BlackBox::Pointer CreateInstance(const std::string& name) \ - { \ - return CLASS::bbNew(name); \ - } \ - CLASS ## Descriptor() \ - { \ - bbtkDebugMessageInc("Kernel",9,#CLASS<<"Descriptor::"<<#CLASS \ - <<"Descriptor()"< \ - void CLASS::bbCreateDescriptorIfNeeded() \ - { \ - if ( !bbDescriptorPointer() ) \ - bbDescriptorPointer() = new CLASS ## Descriptor; \ - } -//============================================================================ - -//============================================================================ -/// Describes a template UserBlackBox input (to be put inside the template UBB description block) -#define BBTK_TEMPLATE_INPUT(CLASS,NAME,DESCR,TYPE) \ - AddInputDescriptor(new bbtk::UserBlackBoxInputDescriptor \ - (typeid(CLASS ## Descriptor),#NAME,DESCR, \ - new bbtk::UserBlackBoxTGetFunctor,TYPE,TYPE > \ - (&CLASS::bbGetInput##NAME), \ - new bbtk::UserBlackBoxTSetFunctor,TYPE,TYPE > \ - (&CLASS::bbSetInput##NAME) ) ) -//============================================================================ - -//============================================================================ -/// Describes a template UserBlackBox output (to be put inside the template UBB description block) -#define BBTK_TEMPLATE_OUTPUT(CLASS,NAME,DESCR,TYPE) \ - AddOutputDescriptor(new bbtk::UserBlackBoxOutputDescriptor \ - (typeid(CLASS ## Descriptor),#NAME,DESCR, \ - new bbtk::UserBlackBoxTGetFunctor,TYPE,TYPE > \ - (&CLASS::bbGetOutput##NAME), \ - new bbtk::UserBlackBoxTSetFunctor,TYPE,TYPE > \ - (&CLASS::bbSetOutput##NAME) ) ) -//============================================================================ - -//============================================================================ -/// Template UserBlackBox std implementation of ctor and dtor -#define BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION(CLASS,PARENT) \ - template \ - CLASS::CLASS(const std::string& name, bool alloc) \ - : PARENT(name,false) \ - { \ - BBTK_BEGIN_BLACK_BOX_CONSTRUCTOR(CLASS,alloc); \ - CLASS::bbUserConstructor(); \ - BBTK_END_BLACK_BOX_CONSTRUCTOR; \ - } \ - template \ - CLASS::CLASS(CLASS& from, \ - const std::string& name, bool allocate_connectors) \ - : PARENT(from,name,false) \ - { \ - BBTK_BEGIN_BLACK_BOX_COPY_CONSTRUCTOR(CLASS,from,allocate_connectors); \ - CLASS::bbUserCopyConstructor(); \ - BBTK_END_BLACK_BOX_CONSTRUCTOR; \ - } \ - template \ - CLASS::~CLASS() \ - { \ - BBTK_BEGIN_BLACK_BOX_DESTRUCTOR(CLASS); \ - CLASS::bbUserDestructor(); \ - BBTK_END_BLACK_BOX_DESTRUCTOR; \ - } -//============================================================================ - -//============================================================================ -// Two template params user black boxes macros - -/// Begins a template UserBlackBox description block of template param T1 and T2 -#define BBTK_BEGIN_DESCRIBE_TEMPLATE2_BLACK_BOX(CLASS) \ - template \ - class /*BBTK_EXPORT*/ CLASS ## Descriptor : public bbtk::BlackBoxDescriptor \ - { \ - public: \ - bbtk::BlackBox::Pointer CreateInstance(const std::string& name) \ - { \ - return CLASS::bbNew(name); \ - } \ - CLASS ## Descriptor() \ - { \ - bbtkDebugMessageInc("Kernel",9,#CLASS<<"Descriptor::"<<#CLASS \ - <<"Descriptor()"< \ - void CLASS::bbCreateDescriptorIfNeeded() \ - { \ - if ( !bbDescriptorPointer() ) \ - bbDescriptorPointer() = new CLASS ## Descriptor; \ - } -//============================================================================ - -//============================================================================ -// Two template params user black boxes macros - -/// Begins a template UserBlackBox description block of template param T1 and T2 -#define BBTK_BEGIN_DESCRIBE_TEMPLATE2_WITH_TYPES_BLACK_BOX(CLASS,TYPE1,TYPE2) \ - template \ - class /*BBTK_EXPORT*/ CLASS ## Descriptor : public bbtk::BlackBoxDescriptor \ - { \ - public: \ - bbtk::BlackBox::Pointer CreateInstance(const std::string& name) \ - { \ - return new CLASS(name); \ - } \ - CLASS ## Descriptor() \ - { \ - bbtkDebugMessageInc("Kernel",9,#CLASS<<"Descriptor::"<<#CLASS \ - <<"Descriptor()"< \ - void CLASS::bbCreateDescriptorIfNeeded() \ - { \ - if ( !bbDescriptorPointer() ) \ - bbDescriptorPointer() = new CLASS ## Descriptor; \ - } -//============================================================================ - - - -//============================================================================ -/// Describes a 2 template params UserBlackBox input (to be put inside the UBB description block) -#define BBTK_TEMPLATE2_INPUT(CLASS,NAME,DESCR,TYPE) \ - AddInputDescriptor(new bbtk::UserBlackBoxInputDescriptor \ - (typeid(CLASS ## Descriptor),#NAME,DESCR, \ - new bbtk::UserBlackBoxTGetFunctor,TYPE,TYPE > \ - (&CLASS::bbGetInput##NAME), \ - new bbtk::UserBlackBoxTSetFunctor,TYPE,TYPE > \ - (&CLASS::bbSetInput##NAME) ) ) -//============================================================================ - -//============================================================================ -/// Describes a 2 template params UserBlackBox output (to be put inside the UBB description block) -#define BBTK_TEMPLATE2_OUTPUT(CLASS,NAME,DESCR,TYPE) \ - AddOutputDescriptor(new bbtk::UserBlackBoxOutputDescriptor \ - (typeid(CLASS ## Descriptor),#NAME,DESCR, \ - new bbtk::UserBlackBoxTGetFunctor,TYPE,TYPE > \ - (&CLASS::bbGetOutput##NAME), \ - new bbtk::UserBlackBoxTSetFunctor,TYPE,TYPE > \ - (&CLASS::bbSetOutput##NAME) ) ) -//============================================================================ - -//============================================================================ -/// Template UserBlackBox std implementation of ctor and dtor -#define BBTK_USER_BLACK_BOX_TEMPLATE2_IMPLEMENTATION(CLASS,PARENT) \ - template \ - CLASS::CLASS(const std::string& name, bool alloc) \ - : PARENT(name,false) \ - { \ - BBTK_BEGIN_BLACK_BOX_CONSTRUCTOR(CLASS,alloc); \ - CLASS::bbUserConstructor(); \ - BBTK_END_BLACK_BOX_CONSTRUCTOR; \ - } \ - template \ - CLASS::CLASS(CLASS& from, \ - const std::string& name, bool allocate_connectors) \ - : PARENT(from,name,false) \ - { \ - BBTK_BEGIN_BLACK_BOX_COPY_CONSTRUCTOR(CLASS,from,allocate_connectors); \ - CLASS::bbUserCopyConstructor(); \ - BBTK_END_BLACK_BOX_CONSTRUCTOR; \ - } \ - template \ - CLASS::~CLASS() \ - { \ - BBTK_BEGIN_BLACK_BOX_DESTRUCTOR(CLASS); \ - CLASS::bbUserDestructor(); \ - BBTK_END_BLACK_BOX_DESTRUCTOR; \ - } -//============================================================================ - - -//============================================================================ -/// Template UserBlackBox std implementation of ctor and dtor -#define BBTK_USER_BLACK_BOX_TEMPLATE2_WITH_TYPES_IMPLEMENTATION(CLASS,PARENT,TYPE1,TYPE2) \ - template \ - CLASS::CLASS(const std::string& name, bool alloc) \ - : PARENT(name,false) \ - { \ - BBTK_BEGIN_BLACK_BOX_CONSTRUCTOR(CLASS,alloc); \ - this->bbUserConstructor(); \ - BBTK_END_BLACK_BOX_CONSTRUCTOR; \ - } \ - template \ - CLASS::CLASS(CLASS& from, \ - const std::string& name, bool allocate_connectors) \ - : PARENT(from,name,false) \ - { \ - BBTK_BEGIN_BLACK_BOX_COPY_CONSTRUCTOR(CLASS,from,allocate_connectors); \ - this->bbUserCopyConstructor(); \ - BBTK_END_BLACK_BOX_CONSTRUCTOR; \ - } \ - template \ - CLASS::~CLASS() \ - { \ - BBTK_BEGIN_BLACK_BOX_DESTRUCTOR(CLASS); \ - this->bbUserDestructor(); \ - BBTK_END_BLACK_BOX_DESTRUCTOR; \ - } -//============================================================================ - - - - - -//=========================================================================== -//============================================================================ -// ITK Specific macros -//=========================================================================== -//=========================================================================== - - -//=========================================================================== -/// Declares an itk-inherited UserBlackBox input -#define BBTK_DECLARE_ITK_INPUT(PARENT,NAME,TYPE) \ - public: \ - TYPE bbGetInput##NAME () \ - { return PARENT::GetInput(); } \ - void bbSetInput##NAME (TYPE d) \ - { PARENT::SetInput(d); \ - /*bbSetModifiedStatus();*/ } -//=========================================================================== - -//=========================================================================== -#define BBTK_DECLARE_ITK_OUTPUT(PARENT,NAME,TYPE) \ - public: \ - TYPE bbGetOutput##NAME () \ - { return PARENT::GetOutput(); } \ - void bbSetOutput##NAME (TYPE d) \ - { /*PARENT::GetOutput() = d;*/ } -//=========================================================================== - -//=========================================================================== -/// Declares an UserBlackBox input corresponding to an inherited itk parameter -/// which was declared by itkSetMacro/itkGetMacro -/// The NAME **MUST** be the same than the itk parameter name -#define BBTK_DECLARE_ITK_PARAM(PARENT,NAME,TYPE) \ - public: \ - TYPE bbGetInput##NAME () \ - { return PARENT::Get##NAME(); } \ - void bbSetInput##NAME (TYPE d) \ - { PARENT::Set##NAME(d); \ - /*bbSetModifiedStatus();*/ } -//=========================================================================== - - - - -//=========================================================================== -//============================================================================ -// VTK Specific macros -//=========================================================================== -//=========================================================================== - - -//=========================================================================== - -// EED sept 04 \ -// { return GetInput(); /*PARENT::GetInput();*/ } \ -// { PARENT::SetInput( /*(vtkDataObject*)*/ d); \ - - - -/// Declares a vtkImageAlgorithm-inherited UserBlackBox input -#define BBTK_DECLARE_VTK_IMAGE_ALGORITHM_INPUT(PARENT,NAME,TYPE) \ - public: \ - TYPE bbGetInput##NAME () \ - { return GetImageDataInput(0); /*PARENT::GetInput();*/ } \ - void bbSetInput##NAME (TYPE d) \ - { PARENT::SetInput( (vtkDataObject*) d); \ - /*bbSetModifiedStatus();*/ } -//=========================================================================== -/// Declares a vtkPolyDataAlgorithm-inherited UserBlackBox input -#define BBTK_DECLARE_VTK_POLY_DATA_ALGORITHM_INPUT(PARENT,NAME,TYPE) \ - public: \ - TYPE bbGetInput##NAME () \ - { return GetPolyDataInput(0); /*PARENT::GetInput();*/ } \ - void bbSetInput##NAME (TYPE d) \ - { PARENT::SetInput( (vtkDataObject*) d); \ - /*bbSetModifiedStatus();*/ } -//=========================================================================== - -//=========================================================================== -/// Declares a vtkImageAlgorithm-inherited UserBlackBox output -#define BBTK_DECLARE_VTK_OUTPUT(PARENT,NAME,TYPE) \ - public: \ - TYPE bbGetOutput##NAME () \ - { return PARENT::GetOutput(); } \ - void bbSetOutput##NAME (TYPE d) \ - { /*PARENT::GetOutput() = d;*/ } -//=========================================================================== - -//=========================================================================== -/// Declares a vtkAlgorithm-inherited UserBlackBox input -#define BBTK_DECLARE_VTK_INPUT(PARENT,NAME,TYPE) \ - public: \ - TYPE bbGetInput##NAME () \ - { return dynamic_cast(PARENT::GetInput()); } \ - void bbSetInput##NAME (TYPE d) \ - { PARENT::SetInput( (vtkDataObject*) d); /*PARENT::GetOutput() = d;*/ } - -//=========================================================================== - -//=========================================================================== -/// Declares an UserBlackBox input corresponding to an inherited vtk parameter -/// which was declared by vtkSetMacro/vtkGetMacro -/// The NAME **MUST** be the same than the vtk parameter name -#define BBTK_DECLARE_VTK_PARAM(PARENT,NAME,TYPE) \ - public: \ - TYPE bbGetInput##NAME () \ - { return PARENT::Get##NAME(); } \ - void bbSetInput##NAME (TYPE d) \ - { PARENT::Set##NAME(d); \ - /*bbSetModifiedStatus();*/ } -//=========================================================================== - - - -//=========================================================================== -/// EOF -//=========================================================================== -#endif diff --git a/kernel/src/bbtkUserBlackBoxOutputDescriptor.cxx b/kernel/src/bbtkUserBlackBoxOutputDescriptor.cxx deleted file mode 100644 index 484cd1e..0000000 --- a/kernel/src/bbtkUserBlackBoxOutputDescriptor.cxx +++ /dev/null @@ -1,57 +0,0 @@ -/*========================================================================= - - Program: bbtk - Module: $RCSfile: bbtkUserBlackBoxOutputDescriptor.cxx,v $ - Language: C++ - Date: $Date: 2008/02/06 14:14:22 $ - Version: $Revision: 1.3 $ - - Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de - l'Image). All rights reserved. See Doc/License.txt or - http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - -/** - * \file - * \brief Class bbtk::UserBlackBoxOutputDescriptor : structure containing the description of a UserBlackBox output (name, description, type, functor) - */ -#include "bbtkUserBlackBoxOutputDescriptor.h" - - -namespace bbtk -{ - - - UserBlackBoxOutputDescriptor:: - UserBlackBoxOutputDescriptor( TypeInfo creator_type_info, - const std::string& name, - const std::string& description, - UserBlackBoxGetFunctor* getfunctor, - UserBlackBoxSetFunctor* setfunctor, - bool copy_construct ) - : - BlackBoxOutputDescriptor(creator_type_info, - name,description,copy_construct), - mGetFunctor(getfunctor), - mSetFunctor(setfunctor) - { - - bbtkDebugMessage("Kernel",9, - "UserBlackBoxOutputDescriptor::UserBlackBoxOutputDescriptor(\"" - <GetTypeInfo(); } - /// Returns the name of the type of the input - std::string GetTypeName() const { return mGetFunctor->GetTypeName(); } - /// Returns the name of the type of the input - std::string GetHumanTypeName() const { return mGetFunctor->GetHumanTypeName(); } - /// Returns true iff the type is a pointer to class - virtual bool IsPointerType() const { return mGetFunctor->IsPointerType(); } /// Returns the functor on the Get method - UserBlackBoxGetFunctor* GetGetFunctor() { return mGetFunctor; } - /// Returns the functor on the Set method - UserBlackBoxSetFunctor* GetSetFunctor() { return mSetFunctor; } - - - private: - /// Default ctor is private - UserBlackBoxOutputDescriptor() : - BlackBoxOutputDescriptor(typeid(void),"","") {} - /// The functor on the Get method - UserBlackBoxGetFunctor* mGetFunctor; - /// The functor on the Set method - UserBlackBoxSetFunctor* mSetFunctor; - }; - - -} -// namespace bbtk -#endif diff --git a/kernel/src/bbtkWxBlackBox.cxx b/kernel/src/bbtkWxBlackBox.cxx index 954880d..4f791be 100644 --- a/kernel/src/bbtkWxBlackBox.cxx +++ b/kernel/src/bbtkWxBlackBox.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkWxBlackBox.cxx,v $ Language: C++ - Date: $Date: 2008/02/06 11:31:39 $ - Version: $Revision: 1.5 $ + Date: $Date: 2008/02/07 07:58:54 $ + Version: $Revision: 1.6 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -467,7 +467,7 @@ namespace bbtk //========================================================================= //========================================================================= //========================================================================= - BBTK_USER_BLACK_BOX_IMPLEMENTATION(WxBlackBox,UserBlackBox); + BBTK_USER_BLACK_BOX_IMPLEMENTATION(WxBlackBox,AtomicBlackBox); //========================================================================= //========================================================================= diff --git a/kernel/src/bbtkWxBlackBox.h b/kernel/src/bbtkWxBlackBox.h index 92fb3fe..c967fd1 100644 --- a/kernel/src/bbtkWxBlackBox.h +++ b/kernel/src/bbtkWxBlackBox.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkWxBlackBox.h,v $ Language: C++ - Date: $Date: 2008/02/06 14:58:41 $ - Version: $Revision: 1.5 $ + Date: $Date: 2008/02/07 07:58:54 $ + Version: $Revision: 1.6 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -38,7 +38,7 @@ #include "bbtkWx.h" -#include "bbtkUserBlackBox.h" +#include "bbtkAtomicBlackBox.h" namespace bbtk @@ -60,9 +60,9 @@ namespace bbtk //================================================================== /// Widget black boxes - class BBTK_EXPORT WxBlackBox : public bbtk::UserBlackBox + class BBTK_EXPORT WxBlackBox : public bbtk::AtomicBlackBox { - BBTK_USER_BLACK_BOX_INTERFACE(WxBlackBox,bbtk::UserBlackBox); + BBTK_USER_BLACK_BOX_INTERFACE(WxBlackBox,bbtk::AtomicBlackBox); // BBTK_DECLARE_INPUT(WinParent,WxParentToChildData*); BBTK_DECLARE_INPUT(WinTitle,std::string); BBTK_DECLARE_INPUT(WinWidth,int); @@ -186,8 +186,8 @@ namespace bbtk //====================================================================== //================================================================= - // UserBlackBox description - BBTK_BEGIN_DESCRIBE_BLACK_BOX(WxBlackBox,bbtk::UserBlackBox); + // WxBlackBoxDescriptor declaration + BBTK_BEGIN_DESCRIBE_BLACK_BOX(WxBlackBox,bbtk::AtomicBlackBox); BBTK_NAME("WxBlackBox"); // BBTK_DESCRIPTION("Widget box. The inputs marked with (*) are only used if the widget is not inserted in another widget.\n"); BBTK_CATEGORY("widget"); diff --git a/packages/itk/src/bbitkAnyImageToTypedImage.cxx b/packages/itk/src/bbitkAnyImageToTypedImage.cxx index 254b35c..75968dd 100644 --- a/packages/itk/src/bbitkAnyImageToTypedImage.cxx +++ b/packages/itk/src/bbitkAnyImageToTypedImage.cxx @@ -6,9 +6,9 @@ namespace bbitk { //==================================================================== BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION(AnyImageToTypedImage, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); BBTK_USER_BLACK_BOX_TEMPLATE2_IMPLEMENTATION(AnyImageToConstTypedImage, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); //==================================================================== diff --git a/packages/itk/src/bbitkAnyImageToTypedImage.h b/packages/itk/src/bbitkAnyImageToTypedImage.h index 5fad5fc..beb8a20 100644 --- a/packages/itk/src/bbitkAnyImageToTypedImage.h +++ b/packages/itk/src/bbitkAnyImageToTypedImage.h @@ -3,19 +3,19 @@ #ifndef __bbitkAnyImageToTypedImage_h_INCLUDED__ #define __bbitkAnyImageToTypedImage_h_INCLUDED__ -#include "bbtkUserBlackBox.h" +#include "bbtkAtomicBlackBox.h" #include "bbitkImage.h" namespace bbitk { //================================================================= - // UserBlackBox declaration + // BlackBox declaration template - class AnyImageToTypedImage : public bbtk::UserBlackBox + class AnyImageToTypedImage : public bbtk::AtomicBlackBox { BBTK_USER_BLACK_BOX_INTERFACE(AnyImageToTypedImage, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); BBTK_DECLARE_INPUT(In,anyImagePointer); BBTK_DECLARE_OUTPUT(Out,itkImageTypePointer); BBTK_PROCESS(DoIt); @@ -24,7 +24,7 @@ namespace bbitk //================================================================= //================================================================= - // UserBlackBox description + // BlackBox description BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(AnyImageToTypedImage); BBTK_NAME(bbtk::HumanTypeName() + "To"+bbtk::HumanTypeName()); BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr"); @@ -59,12 +59,12 @@ namespace bbitk //================================================================= //================================================================= - // UserBlackBox declaration + // BlackBox declaration template - class AnyImageToConstTypedImage : public bbtk::UserBlackBox + class AnyImageToConstTypedImage : public bbtk::AtomicBlackBox { BBTK_USER_BLACK_BOX_INTERFACE(AnyImageToConstTypedImage, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); BBTK_DECLARE_INPUT(In,anyImagePointer); BBTK_DECLARE_OUTPUT(Out,itkImageTypeConstPointer); BBTK_PROCESS(DoIt); @@ -73,7 +73,7 @@ namespace bbitk //================================================================= //================================================================= - // UserBlackBox description + // BlackBox description BBTK_BEGIN_DESCRIBE_TEMPLATE2_BLACK_BOX(AnyImageToConstTypedImage); BBTK_NAME("Convert<"+bbtk::TypeName() + "," + bbtk::TypeName()+">"); diff --git a/packages/itk/src/bbitkBinaryThresholdImageFilter.cxx b/packages/itk/src/bbitkBinaryThresholdImageFilter.cxx index 5d8bae2..be5b117 100644 --- a/packages/itk/src/bbitkBinaryThresholdImageFilter.cxx +++ b/packages/itk/src/bbitkBinaryThresholdImageFilter.cxx @@ -6,9 +6,9 @@ namespace bbitk { BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION(BinaryThresholdImageFilter, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); BBTK_USER_BLACK_BOX_IMPLEMENTATION(BinaryThresholdImageFilterGeneric, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); BBTK_ADD_BLACK_BOX_TO_PACKAGE(itk, BinaryThresholdImageFilterGeneric); } diff --git a/packages/itk/src/bbitkBinaryThresholdImageFilter.h b/packages/itk/src/bbitkBinaryThresholdImageFilter.h index 3f6ed3a..0ea322d 100644 --- a/packages/itk/src/bbitkBinaryThresholdImageFilter.h +++ b/packages/itk/src/bbitkBinaryThresholdImageFilter.h @@ -1,6 +1,6 @@ #ifdef _USE_ITK_ -#include "bbtkUserBlackBox.h" +#include "bbtkAtomicBlackBox.h" #include "itkBinaryThresholdImageFilter.h" #include "bbitkImage.h" @@ -10,11 +10,11 @@ namespace bbitk template class /*BBTK_EXPORT*/ BinaryThresholdImageFilter : - public bbtk::UserBlackBox, + public bbtk::AtomicBlackBox, public itk::BinaryThresholdImageFilter { BBTK_USER_BLACK_BOX_INTERFACE(BinaryThresholdImageFilter, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); typedef itk::BinaryThresholdImageFilter itkParent; BBTK_DECLARE_ITK_INPUT(itkParent,In,const T*); BBTK_DECLARE_ITK_PARAM(itkParent,LowerThreshold,typename T::PixelType); @@ -54,10 +54,10 @@ namespace bbitk //=================================================== class /*BBTK_EXPORT*/ BinaryThresholdImageFilterGeneric : - public bbtk::UserBlackBox + public bbtk::AtomicBlackBox { BBTK_USER_BLACK_BOX_INTERFACE(BinaryThresholdImageFilterGeneric, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); BBTK_DECLARE_INPUT(In,anyImagePointer); BBTK_DECLARE_INPUT(LowerThreshold,double); BBTK_DECLARE_INPUT(UpperThreshold,double); @@ -74,7 +74,7 @@ namespace bbitk }; BBTK_BEGIN_DESCRIBE_BLACK_BOX(BinaryThresholdImageFilterGeneric, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); BBTK_NAME("BinaryThresholdImageFilter"); BBTK_AUTHOR("laurent.guigues at creatis.insa-lyon.fr"); BBTK_CATEGORY("filter;image"); diff --git a/packages/itk/src/bbitkExtractImageFilter.cxx b/packages/itk/src/bbitkExtractImageFilter.cxx index b1dee2c..1a3f717 100644 --- a/packages/itk/src/bbitkExtractImageFilter.cxx +++ b/packages/itk/src/bbitkExtractImageFilter.cxx @@ -7,9 +7,9 @@ namespace bbitk { BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION(ExtractImageFilter, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); BBTK_USER_BLACK_BOX_IMPLEMENTATION(ExtractImageFilterGeneric, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); BBTK_ADD_BLACK_BOX_TO_PACKAGE(itk,ExtractImageFilterGeneric) diff --git a/packages/itk/src/bbitkExtractImageFilter.h b/packages/itk/src/bbitkExtractImageFilter.h index 4433d03..e659761 100644 --- a/packages/itk/src/bbitkExtractImageFilter.h +++ b/packages/itk/src/bbitkExtractImageFilter.h @@ -1,6 +1,6 @@ #ifdef _USE_ITK_ -#include "bbtkUserBlackBox.h" +#include "bbtkAtomicBlackBox.h" #include "itkExtractImageFilter.h" #include "bbitkImage.h" #include "bbitkImageRegion.h" @@ -12,10 +12,10 @@ namespace bbitk template class /*BBTK_EXPORT*/ ExtractImageFilter : - public bbtk::UserBlackBox, + public bbtk::AtomicBlackBox, public itk::ExtractImageFilter { - BBTK_USER_BLACK_BOX_INTERFACE(ExtractImageFilter,bbtk::UserBlackBox); + BBTK_USER_BLACK_BOX_INTERFACE(ExtractImageFilter,bbtk::AtomicBlackBox); typedef itk::ExtractImageFilter itkParent; BBTK_DECLARE_ITK_INPUT(itkParent,In,const T*); @@ -40,10 +40,10 @@ namespace bbitk // Generic "untemplatized" filter //=================================================== class /*BBTK_EXPORT*/ ExtractImageFilterGeneric - : public bbtk::UserBlackBox + : public bbtk::AtomicBlackBox { BBTK_USER_BLACK_BOX_INTERFACE(ExtractImageFilterGeneric, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); BBTK_DECLARE_INPUT(In,anyImagePointer); BBTK_DECLARE_INPUT(Region,anyImageRegion); BBTK_DECLARE_OUTPUT(Out,anyImagePointer); @@ -53,7 +53,8 @@ namespace bbitk template void Process(); }; - BBTK_BEGIN_DESCRIBE_BLACK_BOX(ExtractImageFilterGeneric,bbtk::UserBlackBox); + BBTK_BEGIN_DESCRIBE_BLACK_BOX(ExtractImageFilterGeneric, + bbtk::AtomicBlackBox); BBTK_NAME("ExtractImageFilter"); BBTK_AUTHOR("laurent.guigues at creatis.insa-lyon.fr"); BBTK_CATEGORY("image;filter"); diff --git a/packages/itk/src/bbitkImage.cxx b/packages/itk/src/bbitkImage.cxx index 36a2c99..5d4c883 100644 --- a/packages/itk/src/bbitkImage.cxx +++ b/packages/itk/src/bbitkImage.cxx @@ -9,7 +9,7 @@ namespace bbstd //==================================================================== BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION(Relay, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); //==================================================================== } using namespace bbstd; diff --git a/packages/itk/src/bbitkImageProperties.cxx b/packages/itk/src/bbitkImageProperties.cxx index 3202074..d46c01b 100644 --- a/packages/itk/src/bbitkImageProperties.cxx +++ b/packages/itk/src/bbitkImageProperties.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbitkImageProperties.cxx,v $ Language: C++ - Date: $Date: 2008/02/05 12:03:01 $ - Version: $Revision: 1.1 $ + Date: $Date: 2008/02/07 07:58:54 $ + Version: $Revision: 1.2 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -26,7 +26,7 @@ namespace bbitk { - BBTK_USER_BLACK_BOX_IMPLEMENTATION(ImageProperties,bbtk::UserBlackBox); + BBTK_USER_BLACK_BOX_IMPLEMENTATION(ImageProperties,bbtk::AtomicBlackBox); BBTK_ADD_BLACK_BOX_TO_PACKAGE(itk,ImageProperties); diff --git a/packages/itk/src/bbitkImageProperties.h b/packages/itk/src/bbitkImageProperties.h index 9a7c007..786fa53 100644 --- a/packages/itk/src/bbitkImageProperties.h +++ b/packages/itk/src/bbitkImageProperties.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbitkImageProperties.h,v $ Language: C++ - Date: $Date: 2008/02/05 13:48:00 $ - Version: $Revision: 1.3 $ + Date: $Date: 2008/02/07 07:58:54 $ + Version: $Revision: 1.4 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -28,18 +28,20 @@ #ifndef __bbtkITKImageProperties_h__ #define __bbtkITKImageProperties_h__ -#include "bbtkUserBlackBox.h" +#include "bbtkAtomicBlackBox.h" #include "bbitkImage.h" #include "bbitkImageRegion.h" namespace bbitk { - class ImageProperties : public bbtk::UserBlackBox + //================================================================= + // BlackBox declaration + class ImageProperties : public bbtk::AtomicBlackBox { BBTK_USER_BLACK_BOX_INTERFACE(ImageProperties, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); BBTK_DECLARE_INPUT(In,anyImagePointer); BBTK_DECLARE_OUTPUT(TypeName,std::string); @@ -55,11 +57,12 @@ namespace bbitk // Template doit method template void DoIt(); }; + //================================================================= //================================================================= - // UserBlackBox description - BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageProperties,bbtk::UserBlackBox); + // BlackBox description + BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageProperties,bbtk::AtomicBlackBox); BBTK_NAME("ImageProperties"); BBTK_AUTHOR("laurent.guigues at creatis.insa-lyon.fr"); BBTK_CATEGORY("image"); diff --git a/packages/itk/src/bbitkImageReader.cxx b/packages/itk/src/bbitkImageReader.cxx index bb7938d..329c579 100644 --- a/packages/itk/src/bbitkImageReader.cxx +++ b/packages/itk/src/bbitkImageReader.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbitkImageReader.cxx,v $ Language: C++ - Date: $Date: 2008/02/05 12:03:01 $ - Version: $Revision: 1.1 $ + Date: $Date: 2008/02/07 07:58:54 $ + Version: $Revision: 1.2 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -27,7 +27,7 @@ namespace bbitk { - BBTK_USER_BLACK_BOX_IMPLEMENTATION(ImageReader,bbtk::UserBlackBox); + BBTK_USER_BLACK_BOX_IMPLEMENTATION(ImageReader,bbtk::AtomicBlackBox); BBTK_ADD_BLACK_BOX_TO_PACKAGE(itk,ImageReader); diff --git a/packages/itk/src/bbitkImageReader.h b/packages/itk/src/bbitkImageReader.h index 5c3491b..2ad0f06 100644 --- a/packages/itk/src/bbitkImageReader.h +++ b/packages/itk/src/bbitkImageReader.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbitkImageReader.h,v $ Language: C++ - Date: $Date: 2008/02/05 12:11:51 $ - Version: $Revision: 1.2 $ + Date: $Date: 2008/02/07 07:58:54 $ + Version: $Revision: 1.3 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -28,17 +28,19 @@ #ifndef __bbitkImageReader_h_INCLUDED__ #define __bbitkImageReader_h_INCLUDED__ -#include "bbtkUserBlackBox.h" +#include "bbtkAtomicBlackBox.h" #include "bbitkImage.h" namespace bbitk { - class ImageReader : public bbtk::UserBlackBox + //================================================================= + // BlackBox declaration + class ImageReader : public bbtk::AtomicBlackBox { BBTK_USER_BLACK_BOX_INTERFACE(ImageReader, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); BBTK_DECLARE_INPUT(Filename,std::string); BBTK_DECLARE_OUTPUT(Out,anyImagePointer); @@ -49,11 +51,11 @@ namespace bbitk // Template read method template void Read(); }; - + //================================================================= //================================================================= - // UserBlackBox description - BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageReader,bbtk::UserBlackBox); + // BlackBox description + BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageReader,bbtk::AtomicBlackBox); BBTK_NAME("ImageReader"); BBTK_AUTHOR("laurent.guigues at creatis.insa-lyon.fr"); BBTK_CATEGORY("image;read/write"); diff --git a/packages/itk/src/bbitkImageRegion.cxx b/packages/itk/src/bbitkImageRegion.cxx index 746d97b..b1bcf8c 100644 --- a/packages/itk/src/bbitkImageRegion.cxx +++ b/packages/itk/src/bbitkImageRegion.cxx @@ -7,7 +7,7 @@ namespace bbitk { BBTK_USER_BLACK_BOX_IMPLEMENTATION(ImageRegionCreator, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); BBTK_ADD_BLACK_BOX_TO_PACKAGE(itk,ImageRegionCreator); diff --git a/packages/itk/src/bbitkImageRegion.h b/packages/itk/src/bbitkImageRegion.h index 7c98f8f..189067b 100644 --- a/packages/itk/src/bbitkImageRegion.h +++ b/packages/itk/src/bbitkImageRegion.h @@ -6,7 +6,7 @@ #include "itkImageRegion.h" #include "bbtkMessageManager.h" #include "bbtkAny.h" -#include "bbtkUserBlackBox.h" +#include "bbtkAtomicBlackBox.h" namespace bbitk { @@ -44,9 +44,9 @@ namespace bbitk //======================================================================= /// Black Box which creates an anyImageRegion class /*BBTK_EXPORT*/ ImageRegionCreator - : public bbtk::UserBlackBox + : public bbtk::AtomicBlackBox { - BBTK_USER_BLACK_BOX_INTERFACE(ImageRegionCreator,bbtk::UserBlackBox); + BBTK_USER_BLACK_BOX_INTERFACE(ImageRegionCreator,bbtk::AtomicBlackBox); BBTK_DECLARE_INPUT(Index,std::vector); BBTK_DECLARE_INPUT(Size,std::vector); BBTK_DECLARE_OUTPUT(Out,anyImageRegion); @@ -57,7 +57,7 @@ namespace bbitk }; - BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageRegionCreator,bbtk::UserBlackBox); + BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageRegionCreator,bbtk::AtomicBlackBox); BBTK_NAME("ImageRegion"); BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr"); BBTK_DESCRIPTION("Creates a generic ImageRegion ("+bbtk::TypeName()+") from two vectors providing the index and size of the region. The dimension D of the actual itk::ImageRegion created is the max of the sizes of Index and Size (the smallest vector is padded by zeros)."); diff --git a/packages/itk/src/bbitkImageSeriesReader.cxx b/packages/itk/src/bbitkImageSeriesReader.cxx index ac3c114..058c288 100644 --- a/packages/itk/src/bbitkImageSeriesReader.cxx +++ b/packages/itk/src/bbitkImageSeriesReader.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbitkImageSeriesReader.cxx,v $ Language: C++ - Date: $Date: 2008/02/05 12:03:01 $ - Version: $Revision: 1.1 $ + Date: $Date: 2008/02/07 07:58:54 $ + Version: $Revision: 1.2 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -27,7 +27,7 @@ namespace bbitk { - BBTK_USER_BLACK_BOX_IMPLEMENTATION(ImageSeriesReader,bbtk::UserBlackBox); + BBTK_USER_BLACK_BOX_IMPLEMENTATION(ImageSeriesReader,bbtk::AtomicBlackBox); BBTK_ADD_BLACK_BOX_TO_PACKAGE(itk,ImageSeriesReader); diff --git a/packages/itk/src/bbitkImageSeriesReader.h b/packages/itk/src/bbitkImageSeriesReader.h index 3bbac20..34a1b7a 100644 --- a/packages/itk/src/bbitkImageSeriesReader.h +++ b/packages/itk/src/bbitkImageSeriesReader.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbitkImageSeriesReader.h,v $ Language: C++ - Date: $Date: 2008/02/05 12:11:51 $ - Version: $Revision: 1.2 $ + Date: $Date: 2008/02/07 07:58:55 $ + Version: $Revision: 1.3 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -28,17 +28,19 @@ #ifndef __bbitkImageSeriesReader_h_INCLUDED__ #define __bbitkImageSeriesReader_h_INCLUDED__ -#include "bbtkUserBlackBox.h" +#include "bbtkAtomicBlackBox.h" #include "bbitkImage.h" namespace bbitk { - class ImageSeriesReader : public bbtk::UserBlackBox + //================================================================= + // BlackBox declaration + class ImageSeriesReader : public bbtk::AtomicBlackBox { BBTK_USER_BLACK_BOX_INTERFACE(ImageSeriesReader, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); BBTK_DECLARE_INPUT(FileNames,std::vector); BBTK_DECLARE_OUTPUT(Out,anyImagePointer); @@ -49,11 +51,12 @@ namespace bbitk // Template read method template void Read(); }; + //================================================================= //================================================================= - // UserBlackBox description - BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageSeriesReader,bbtk::UserBlackBox); + // BlackBox description + BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageSeriesReader,bbtk::AtomicBlackBox); BBTK_NAME("ImageSeriesReader"); BBTK_AUTHOR("laurent.guigues at creatis.insa-lyon.fr"); BBTK_DESCRIPTION("Generic itk image series reader"); diff --git a/packages/itk/src/bbitkImageToString.cxx b/packages/itk/src/bbitkImageToString.cxx index 23c30c4..327108e 100644 --- a/packages/itk/src/bbitkImageToString.cxx +++ b/packages/itk/src/bbitkImageToString.cxx @@ -11,7 +11,7 @@ namespace bbstd //==================================================================== BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION(ToString, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); //==================================================================== //==================================================================== diff --git a/packages/itk/src/bbitkImageWriter.cxx b/packages/itk/src/bbitkImageWriter.cxx index 8edcc04..820add6 100644 --- a/packages/itk/src/bbitkImageWriter.cxx +++ b/packages/itk/src/bbitkImageWriter.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbitkImageWriter.cxx,v $ Language: C++ - Date: $Date: 2008/02/05 12:03:02 $ - Version: $Revision: 1.1 $ + Date: $Date: 2008/02/07 07:58:55 $ + Version: $Revision: 1.2 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -27,7 +27,7 @@ namespace bbitk { - BBTK_USER_BLACK_BOX_IMPLEMENTATION(ImageWriter,bbtk::UserBlackBox); + BBTK_USER_BLACK_BOX_IMPLEMENTATION(ImageWriter,bbtk::AtomicBlackBox); BBTK_ADD_BLACK_BOX_TO_PACKAGE(itk,ImageWriter); diff --git a/packages/itk/src/bbitkImageWriter.h b/packages/itk/src/bbitkImageWriter.h index fde6da4..6457760 100644 --- a/packages/itk/src/bbitkImageWriter.h +++ b/packages/itk/src/bbitkImageWriter.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbitkImageWriter.h,v $ Language: C++ - Date: $Date: 2008/02/05 12:11:51 $ - Version: $Revision: 1.2 $ + Date: $Date: 2008/02/07 07:58:55 $ + Version: $Revision: 1.3 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -28,17 +28,19 @@ #ifndef __bbtkITKImageWriter_h__ #define __bbtkITKImageWriter_h__ -#include "bbtkUserBlackBox.h" +#include "bbtkAtomicBlackBox.h" #include "bbitkImage.h" namespace bbitk { - class ImageWriter : public bbtk::UserBlackBox + //================================================================= + // BlackBox declaration + class ImageWriter : public bbtk::AtomicBlackBox { BBTK_USER_BLACK_BOX_INTERFACE(ImageWriter, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); BBTK_DECLARE_INPUT(Filename,std::string); BBTK_DECLARE_INPUT(In,anyImagePointer); @@ -52,8 +54,8 @@ namespace bbitk //================================================================= - // UserBlackBox description - BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageWriter,bbtk::UserBlackBox); + // BlackBox description + BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageWriter,bbtk::AtomicBlackBox); BBTK_NAME("ImageWriter"); BBTK_AUTHOR("laurent.guigues at creatis.insa-lyon.fr"); BBTK_DESCRIPTION("Generic itk image writer"); diff --git a/packages/itk/src/bbitkResampleImageFilter.cxx b/packages/itk/src/bbitkResampleImageFilter.cxx index bb51c41..fd98e5e 100644 --- a/packages/itk/src/bbitkResampleImageFilter.cxx +++ b/packages/itk/src/bbitkResampleImageFilter.cxx @@ -5,7 +5,7 @@ namespace bbitk { - BBTK_USER_BLACK_BOX_IMPLEMENTATION(ResampleImageFilter,bbtk::UserBlackBox); + BBTK_USER_BLACK_BOX_IMPLEMENTATION(ResampleImageFilter,bbtk::AtomicBlackBox); BBTK_ADD_BLACK_BOX_TO_PACKAGE(itk,ResampleImageFilter); } diff --git a/packages/itk/src/bbitkResampleImageFilter.h b/packages/itk/src/bbitkResampleImageFilter.h index a773add..5d87c97 100644 --- a/packages/itk/src/bbitkResampleImageFilter.h +++ b/packages/itk/src/bbitkResampleImageFilter.h @@ -1,7 +1,7 @@ #ifdef _USE_ITK_ #include -#include "bbtkUserBlackBox.h" +#include "bbtkAtomicBlackBox.h" #include "itkResampleImageFilter.h" #include "bbitkImage.h" #include "itkNearestNeighborInterpolateImageFunction.h" @@ -14,10 +14,10 @@ namespace bbitk class /*BBTK_EXPORT*/ ResampleImageFilter : - public bbtk::UserBlackBox + public bbtk::AtomicBlackBox { BBTK_USER_BLACK_BOX_INTERFACE(ResampleImageFilter, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); BBTK_DECLARE_INPUT(In,anyImagePointer); BBTK_DECLARE_INPUT(Spacing,std::vector); BBTK_DECLARE_INPUT(Interpolation,std::string); @@ -33,7 +33,7 @@ namespace bbitk }; BBTK_BEGIN_DESCRIBE_BLACK_BOX(ResampleImageFilter, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); BBTK_NAME("ResampleImageFilter"); BBTK_AUTHOR("laurent.guigues at creatis.insa-lyon.fr"); BBTK_DESCRIPTION("Resamples an image"); diff --git a/packages/itk/src/bbitkTypedImageToAnyImage.cxx b/packages/itk/src/bbitkTypedImageToAnyImage.cxx index 165d7e7..9946c28 100644 --- a/packages/itk/src/bbitkTypedImageToAnyImage.cxx +++ b/packages/itk/src/bbitkTypedImageToAnyImage.cxx @@ -6,7 +6,7 @@ namespace bbitk { //==================================================================== BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION(TypedImageToAnyImage, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); //==================================================================== diff --git a/packages/itk/src/bbitkTypedImageToAnyImage.h b/packages/itk/src/bbitkTypedImageToAnyImage.h index 4d870f1..ed7ee35 100644 --- a/packages/itk/src/bbitkTypedImageToAnyImage.h +++ b/packages/itk/src/bbitkTypedImageToAnyImage.h @@ -3,7 +3,7 @@ #ifndef __bbTypedItkImage2GenericItkImage_h__ #define __bbTypedItkImage2GenericItkImage_h__ -#include "bbtkUserBlackBox.h" +#include "bbtkAtomicBlackBox.h" #include "bbitkImage.h" #include "bbtkSystem.h" @@ -11,12 +11,12 @@ namespace bbitk { //================================================================= - // UserBlackBox declaration + // BlackBox declaration template - class TypedImageToAnyImage : public bbtk::UserBlackBox + class TypedImageToAnyImage : public bbtk::AtomicBlackBox { BBTK_USER_BLACK_BOX_INTERFACE(TypedImageToAnyImage, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); BBTK_DECLARE_INPUT(In,itkImageTypePointer); BBTK_DECLARE_OUTPUT(Out,anyImagePointer); BBTK_PROCESS(DoIt); @@ -25,7 +25,7 @@ namespace bbitk //================================================================= //================================================================= - // UserBlackBox description + // BlackBox description BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(TypedImageToAnyImage); BBTK_NAME(bbtk::HumanTypeName() + "To" + bbtk::HumanTypeName()); diff --git a/packages/std/src/bbstdAdd.xml b/packages/std/src/bbstdAdd.xml index db3b9a1..e9fe11f 100644 --- a/packages/std/src/bbstdAdd.xml +++ b/packages/std/src/bbstdAdd.xml @@ -6,7 +6,7 @@ Adds its inputs math - bbtk::UserBlackBox + bbtk::AtomicBlackBox std bbstd diff --git a/packages/std/src/bbstdConcatStrings.cxx b/packages/std/src/bbstdConcatStrings.cxx index 9993645..ec70935 100644 --- a/packages/std/src/bbstdConcatStrings.cxx +++ b/packages/std/src/bbstdConcatStrings.cxx @@ -4,7 +4,7 @@ namespace bbstd { BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,ConcatStrings) - BBTK_USER_BLACK_BOX_IMPLEMENTATION(ConcatStrings,bbtk::UserBlackBox); + BBTK_USER_BLACK_BOX_IMPLEMENTATION(ConcatStrings,bbtk::AtomicBlackBox); void ConcatStrings::bbUserConstructor() { diff --git a/packages/std/src/bbstdConcatStrings.h b/packages/std/src/bbstdConcatStrings.h index deb62cd..78e55d4 100644 --- a/packages/std/src/bbstdConcatStrings.h +++ b/packages/std/src/bbstdConcatStrings.h @@ -1,15 +1,15 @@ #ifndef __bbstdConcatStrings_h_INCLUDED__ #define __bbstdConcatStrings_h_INCLUDED__ -#include "bbtkUserBlackBox.h" +#include "bbtkAtomicBlackBox.h" namespace bbstd { class ConcatStrings : - public bbtk::UserBlackBox + public bbtk::AtomicBlackBox { - BBTK_USER_BLACK_BOX_INTERFACE(ConcatStrings,bbtk::UserBlackBox); + BBTK_USER_BLACK_BOX_INTERFACE(ConcatStrings,bbtk::AtomicBlackBox); BBTK_DECLARE_INPUT(In1, std::string); BBTK_DECLARE_INPUT(In2, std::string); BBTK_DECLARE_INPUT(In3, std::string); @@ -28,22 +28,22 @@ namespace bbstd virtual void bbUserConstructor(); }; - BBTK_BEGIN_DESCRIBE_BLACK_BOX(ConcatStrings,bbtk::UserBlackBox); + BBTK_BEGIN_DESCRIBE_BLACK_BOX(ConcatStrings,bbtk::AtomicBlackBox); BBTK_NAME("ConcatStrings"); BBTK_AUTHOR("jean-pierre.roux@creatis.insa-lyon.fr"); BBTK_CATEGORY("misc"); BBTK_DESCRIPTION("String concatenation"); - BBTK_INPUT(ConcatStrings,In1, "String 1", std::string); - BBTK_INPUT(ConcatStrings,In2, "String 2", std::string); - BBTK_INPUT(ConcatStrings,In3, "String 3", std::string); - BBTK_INPUT(ConcatStrings,In4, "String 4", std::string); - BBTK_INPUT(ConcatStrings,In5, "String 5", std::string); - BBTK_INPUT(ConcatStrings,In6, "String 6", std::string); - BBTK_INPUT(ConcatStrings,In7, "String 7", std::string); - BBTK_INPUT(ConcatStrings,In8, "String 8", std::string); - BBTK_INPUT(ConcatStrings,In9, "String 9", std::string); - BBTK_INPUT(ConcatStrings,In10,"String 10",std::string); - BBTK_OUTPUT(ConcatStrings,Out,"Concatenated string",std::string); + BBTK_INPUT(ConcatStrings,In1, "String 1", std::string); + BBTK_INPUT(ConcatStrings,In2, "String 2", std::string); + BBTK_INPUT(ConcatStrings,In3, "String 3", std::string); + BBTK_INPUT(ConcatStrings,In4, "String 4", std::string); + BBTK_INPUT(ConcatStrings,In5, "String 5", std::string); + BBTK_INPUT(ConcatStrings,In6, "String 6", std::string); + BBTK_INPUT(ConcatStrings,In7, "String 7", std::string); + BBTK_INPUT(ConcatStrings,In8, "String 8", std::string); + BBTK_INPUT(ConcatStrings,In9, "String 9", std::string); + BBTK_INPUT(ConcatStrings,In10,"String 10",std::string); + BBTK_OUTPUT(ConcatStrings,Out,"Concatenated string",std::string); BBTK_END_DESCRIBE_BLACK_BOX(ConcatStrings); } diff --git a/packages/std/src/bbstdConfiguration.cxx b/packages/std/src/bbstdConfiguration.cxx index 89029b9..ec4fcc9 100644 --- a/packages/std/src/bbstdConfiguration.cxx +++ b/packages/std/src/bbstdConfiguration.cxx @@ -5,7 +5,7 @@ namespace bbstd { BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,Configuration) - BBTK_USER_BLACK_BOX_IMPLEMENTATION(Configuration,bbtk::UserBlackBox); + BBTK_USER_BLACK_BOX_IMPLEMENTATION(Configuration,bbtk::AtomicBlackBox); void Configuration::bbUserConstructor() { diff --git a/packages/std/src/bbstdConfiguration.h b/packages/std/src/bbstdConfiguration.h index f0b048d..241b370 100644 --- a/packages/std/src/bbstdConfiguration.h +++ b/packages/std/src/bbstdConfiguration.h @@ -1,15 +1,15 @@ #ifndef __bbstdConfiguration_h_INCLUDED__ #define __bbstdConfiguration_h_INCLUDED__ -#include "bbtkUserBlackBox.h" +#include "bbtkAtomicBlackBox.h" namespace bbstd { class Configuration : - public bbtk::UserBlackBox + public bbtk::AtomicBlackBox { - BBTK_USER_BLACK_BOX_INTERFACE(Configuration,bbtk::UserBlackBox); + BBTK_USER_BLACK_BOX_INTERFACE(Configuration,bbtk::AtomicBlackBox); BBTK_DECLARE_OUTPUT(DataPath,std::string); BBTK_DECLARE_OUTPUT(FileSeparator,std::string); BBTK_DECLARE_OUTPUT(SystemType,int); @@ -21,14 +21,14 @@ namespace bbstd }; - BBTK_BEGIN_DESCRIBE_BLACK_BOX(Configuration,bbtk::UserBlackBox); + BBTK_BEGIN_DESCRIBE_BLACK_BOX(Configuration,bbtk::AtomicBlackBox); BBTK_NAME("Configuration"); BBTK_AUTHOR("jpr@creatis.insa-lyon.fr"); BBTK_CATEGORY("misc"); BBTK_DESCRIPTION("Gets configuration informations"); - BBTK_OUTPUT(Configuration,DataPath,"Sample Data Path",std::string); - BBTK_OUTPUT(Configuration,FileSeparator,"/ or \\",std::string); - BBTK_OUTPUT(Configuration,SystemType,"0=Linux 1=Windows",int); + BBTK_OUTPUT(Configuration,DataPath,"Sample Data Path",std::string); + BBTK_OUTPUT(Configuration,FileSeparator,"/ or \\",std::string); + BBTK_OUTPUT(Configuration,SystemType,"0=Linux 1=Windows",int); BBTK_END_DESCRIBE_BLACK_BOX(Configuration); } // EO namespace bbstd diff --git a/packages/std/src/bbstdMagicBox.cxx b/packages/std/src/bbstdMagicBox.cxx index bf111dd..758467f 100644 --- a/packages/std/src/bbstdMagicBox.cxx +++ b/packages/std/src/bbstdMagicBox.cxx @@ -4,7 +4,7 @@ namespace bbstd { BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,MagicBox) -BBTK_USER_BLACK_BOX_IMPLEMENTATION(MagicBox,bbtk::UserBlackBox); +BBTK_USER_BLACK_BOX_IMPLEMENTATION(MagicBox,bbtk::AtomicBlackBox); } // EO namespace bbstd diff --git a/packages/std/src/bbstdMagicBox.h b/packages/std/src/bbstdMagicBox.h index 3b084b3..951f92e 100644 --- a/packages/std/src/bbstdMagicBox.h +++ b/packages/std/src/bbstdMagicBox.h @@ -1,16 +1,16 @@ #ifndef __bbstdMagicBox_h_INCLUDED_H__ #define __bbstdMagicBox_h_INCLUDED_H__ -#include "bbtkUserBlackBox.h" +#include "bbtkAtomicBlackBox.h" namespace bbstd { //================================================================== class MagicBox : - public bbtk::UserBlackBox + public bbtk::AtomicBlackBox { - BBTK_USER_BLACK_BOX_INTERFACE(MagicBox,bbtk::UserBlackBox); + BBTK_USER_BLACK_BOX_INTERFACE(MagicBox,bbtk::AtomicBlackBox); BBTK_DECLARE_INPUT(In,bbtk::Data); BBTK_DECLARE_OUTPUT(Out,bbtk::Data); BBTK_PROCESS(DoProcess); @@ -29,9 +29,9 @@ namespace bbstd // 1) an any cannot store an any (construction with an any invokes the copy constr.) // 2) we cannot invoke the Set method with the content of the any because // it expects an any - // hence the method Set **MUST NOT** extract the content of the Data - // prior to invoking the set method - class MagicBoxSetFunctor : public bbtk::UserBlackBoxSetFunctor + // hence the Set method of the functor **MUST NOT** extract the + // content of the Data prior to invoking the set method of the box + class MagicBoxSetFunctor : public bbtk::AtomicBlackBoxSetFunctor { public: /// Type of pointer on a UBB::Set method @@ -43,7 +43,7 @@ namespace bbstd {} /// Concrete application of the Set method of object o - void Set(bbtk::UserBlackBox* o, const bbtk::Data& d) + void Set(bbtk::AtomicBlackBox* o, const bbtk::Data& d) { bbtkDebugMessage("Data",9,"MagicBoxSetfunctor::Set()"<*mSetMethodPointer)(d); @@ -54,7 +54,7 @@ namespace bbstd std::string GetTypeName() const { return bbtk::TypeName(); } std::string GetHumanTypeName() const { return bbtk::HumanTypeName(); } bool IsPointerType() const { return false; } - void BruteForceSetPointer(bbtk::UserBlackBox*, void*) {} + void BruteForceSetPointer(bbtk::AtomicBlackBox*, void*) {} private: /// Pointer on the Set method SetMethodPointerType mSetMethodPointer; @@ -62,26 +62,29 @@ namespace bbstd //=========================================================================== - BBTK_BEGIN_DESCRIBE_BLACK_BOX(MagicBox,bbtk::UserBlackBox); + //=========================================================================== + BBTK_BEGIN_DESCRIBE_BLACK_BOX(MagicBox,bbtk::AtomicBlackBox); BBTK_NAME("MagicBox"); BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr"); BBTK_CATEGORY("adaptor"); - BBTK_DESCRIPTION("MagicBox"); + BBTK_DESCRIPTION("Takes *any kind* of data and copies it to its output. Is a magic box as any box output can be plugged into it and its output can be plugged into any other box input (dynamic type checking, see below), hence it can be put between **any** two boxes. Type matching between its output and the input of the box(es) to which it is connected is made at *run-time*. The pipeline will be executed if the data types : i) match exactly ii) can be transformed by an adaptor iii) are related pointers, i.e. if the output pointer can be upcasted (static_cast) or downcasted (dynamic_cast) to an input type pointer (see the bbtk::any output connection rule in the guide for details). Important uses of the MagicBox are : 1) performing run-time pointer cast, either upward or backward an object hierarchy 2) perform data adaptation (adaptor creation) at run-time vs. pipeline creation time."); AddInputDescriptor - (new bbtk::UserBlackBoxInputDescriptor + (new bbtk::AtomicBlackBoxInputDescriptor (typeid(MagicBoxDescriptor), "In","Input data", - new bbtk::UserBlackBoxTGetFunctor + new bbtk::AtomicBlackBoxTGetFunctor (&MagicBox::bbGetInputIn), new MagicBoxSetFunctor (&MagicBox::bbSetInputIn) ) ); AddOutputDescriptor - (new bbtk::UserBlackBoxOutputDescriptor + (new bbtk::AtomicBlackBoxOutputDescriptor (typeid(MagicBoxDescriptor), "Out","Output data", - new bbtk::UserBlackBoxTGetFunctor + new bbtk::AtomicBlackBoxTGetFunctor (&MagicBox::bbGetOutputOut), new MagicBoxSetFunctor (&MagicBox::bbSetOutputOut) ) ); BBTK_END_DESCRIBE_BLACK_BOX(MagicBox); + //=========================================================================== + } // namespace bbstd diff --git a/packages/std/src/bbstdMakeFileName.cxx b/packages/std/src/bbstdMakeFileName.cxx index 73a6ece..e450d2c 100644 --- a/packages/std/src/bbstdMakeFileName.cxx +++ b/packages/std/src/bbstdMakeFileName.cxx @@ -6,7 +6,7 @@ namespace bbstd { BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,MakeFileName) - BBTK_USER_BLACK_BOX_IMPLEMENTATION(MakeFileName,bbtk::UserBlackBox); + BBTK_USER_BLACK_BOX_IMPLEMENTATION(MakeFileName,bbtk::AtomicBlackBox); void MakeFileName::bbUserConstructor() { diff --git a/packages/std/src/bbstdMakeFileName.h b/packages/std/src/bbstdMakeFileName.h index bf61184..c370742 100644 --- a/packages/std/src/bbstdMakeFileName.h +++ b/packages/std/src/bbstdMakeFileName.h @@ -1,15 +1,15 @@ #ifndef __bbstdMakeFileName_h_INCLUDED__ #define __bbstdMakeFileName_h_INCLUDED__ -#include "bbtkUserBlackBox.h" +#include "bbtkAtomicBlackBox.h" namespace bbstd { class MakeFileName : - public bbtk::UserBlackBox + public bbtk::AtomicBlackBox { - BBTK_USER_BLACK_BOX_INTERFACE(MakeFileName,bbtk::UserBlackBox); + BBTK_USER_BLACK_BOX_INTERFACE(MakeFileName,bbtk::AtomicBlackBox); BBTK_DECLARE_INPUT(Directory,std::string); BBTK_DECLARE_INPUT(File,std::string); BBTK_DECLARE_INPUT(Extent,std::string); @@ -22,16 +22,16 @@ namespace bbstd }; - BBTK_BEGIN_DESCRIBE_BLACK_BOX(MakeFileName,bbtk::UserBlackBox); + BBTK_BEGIN_DESCRIBE_BLACK_BOX(MakeFileName,bbtk::AtomicBlackBox); BBTK_NAME("MakeFileName"); BBTK_AUTHOR("jpr@creatis.insa-lyon.fr"); BBTK_CATEGORY("misc"); BBTK_DESCRIPTION("Makes a kosher file name"); - BBTK_INPUT(MakeFileName,Directory,"Directory Name",std::string); - BBTK_INPUT(MakeFileName,File,"File Name",std::string); - BBTK_INPUT(MakeFileName,Extent,"Extention",std::string); - - BBTK_OUTPUT(MakeFileName,Out,"Full File Name",std::string); + BBTK_INPUT(MakeFileName,Directory,"Directory Name",std::string); + BBTK_INPUT(MakeFileName,File,"File Name",std::string); + BBTK_INPUT(MakeFileName,Extent,"Extention",std::string); + + BBTK_OUTPUT(MakeFileName,Out,"Full File Name",std::string); BBTK_END_DESCRIBE_BLACK_BOX(MakeFileName); } diff --git a/packages/std/src/bbstdMultipleInputs.xml b/packages/std/src/bbstdMultipleInputs.xml index fc8440c..cdb0254 100644 --- a/packages/std/src/bbstdMultipleInputs.xml +++ b/packages/std/src/bbstdMultipleInputs.xml @@ -3,10 +3,10 @@ laurent.guigues@creatis.insa-lyon.fr - This box has multiple Void inputs and one Void output. Hence it relays any input modification to its output. It is usefull to plug different BoxChange outputs into the same BoxExecute. + This box has multiple Void inputs and one Void output. Hence it relays any input modification to its output. It is usefull to plug different BoxChange outputs into the same BoxExecute input. misc - bbtk::UserBlackBox + bbtk::AtomicBlackBox std bbstd diff --git a/packages/std/src/bbstdRelay.h b/packages/std/src/bbstdRelay.h index 92b848c..8ce2f93 100644 --- a/packages/std/src/bbstdRelay.h +++ b/packages/std/src/bbstdRelay.h @@ -1,31 +1,36 @@ #ifndef __bbstdRelay_h_INCLUDED_H__ #define __bbstdRelay_h_INCLUDED_H__ -#include "bbtkUserBlackBox.h" +#include "bbtkAtomicBlackBox.h" namespace bbstd { + //======================================================================= template class Relay : - public bbtk::UserBlackBox + public bbtk::AtomicBlackBox { - BBTK_USER_BLACK_BOX_INTERFACE(Relay,bbtk::UserBlackBox); + BBTK_USER_BLACK_BOX_INTERFACE(Relay,bbtk::AtomicBlackBox); BBTK_DECLARE_INPUT(In,T); BBTK_DECLARE_OUTPUT(Out,T); BBTK_PROCESS(Process); protected: void Process() { bbSetOutputOut ( bbGetInputIn() ); } }; + //======================================================================= + //======================================================================= BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(Relay); BBTK_NAME(bbtk::HumanTypeName()+"Relay"); - BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr"); + BBTK_AUTHOR("laurent.guigues at creatis.insa-lyon.fr"); BBTK_CATEGORY("misc"); - BBTK_DESCRIPTION("Relays a "+bbtk::TypeName()); + BBTK_DESCRIPTION("Just copies the value of its input to its output. Usefull to plug an input of a complex box into different internal boxes."); BBTK_TEMPLATE_INPUT(Relay,In,"Input",T); BBTK_TEMPLATE_OUTPUT(Relay,Out,"Output",T); BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(Relay); + //======================================================================= + } // namespace bbstd diff --git a/packages/std/src/bbstdStringSelect.cxx b/packages/std/src/bbstdStringSelect.cxx index ff20216..6316d0a 100644 --- a/packages/std/src/bbstdStringSelect.cxx +++ b/packages/std/src/bbstdStringSelect.cxx @@ -5,7 +5,7 @@ namespace bbstd { BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,StringSelect) - BBTK_USER_BLACK_BOX_IMPLEMENTATION(StringSelect,bbtk::UserBlackBox); + BBTK_USER_BLACK_BOX_IMPLEMENTATION(StringSelect,bbtk::AtomicBlackBox); void StringSelect::bbUserConstructor() { diff --git a/packages/std/src/bbstdStringSelect.h b/packages/std/src/bbstdStringSelect.h index fe3ebaf..fe08851 100644 --- a/packages/std/src/bbstdStringSelect.h +++ b/packages/std/src/bbstdStringSelect.h @@ -1,15 +1,16 @@ #ifndef __bbstdStringSelect_h_INCLUDED__ #define __bbstdStringSelect_h_INCLUDED__ -#include "bbtkUserBlackBox.h" +#include "bbtkAtomicBlackBox.h" namespace bbstd { + //======================================================================= class /*BBTK_EXPORT*/ StringSelect : - public bbtk::UserBlackBox + public bbtk::AtomicBlackBox { - BBTK_USER_BLACK_BOX_INTERFACE(StringSelect,bbtk::UserBlackBox); + BBTK_USER_BLACK_BOX_INTERFACE(StringSelect,bbtk::AtomicBlackBox); BBTK_DECLARE_INPUT(In,int); BBTK_DECLARE_INPUT(In0,std::string); BBTK_DECLARE_INPUT(In1,std::string); @@ -29,25 +30,29 @@ namespace bbstd virtual void bbUserConstructor(); }; + //======================================================================= - BBTK_BEGIN_DESCRIBE_BLACK_BOX(StringSelect,bbtk::UserBlackBox); + //======================================================================= + BBTK_BEGIN_DESCRIBE_BLACK_BOX(StringSelect,bbtk::AtomicBlackBox); BBTK_NAME("StringSelect"); BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr"); BBTK_CATEGORY("misc"); - BBTK_DESCRIPTION("String selection with 0-9 entries"); - BBTK_INPUT(StringSelect,In,"Index of the string to select",int); - BBTK_INPUT(StringSelect,In0,"String of index 0",std::string); - BBTK_INPUT(StringSelect,In1,"String of index 1",std::string); - BBTK_INPUT(StringSelect,In2,"String of index 2",std::string); - BBTK_INPUT(StringSelect,In3,"String of index 3",std::string); - BBTK_INPUT(StringSelect,In4,"String of index 4",std::string); - BBTK_INPUT(StringSelect,In5,"String of index 4",std::string); - BBTK_INPUT(StringSelect,In6,"String of index 6",std::string); - BBTK_INPUT(StringSelect,In7,"String of index 7",std::string); - BBTK_INPUT(StringSelect,In8,"String of index 8",std::string); - BBTK_INPUT(StringSelect,In9,"String of index 9",std::string); - BBTK_OUTPUT(StringSelect,Out,"Selected string",std::string); + BBTK_DESCRIPTION("Outputs the string set to the ith input Ini (In0 ... In9) according to the value of the input In, hence selects a string according to an index."); + BBTK_INPUT(StringSelect,In,"Index of the string to select",int); + BBTK_INPUT(StringSelect,In0,"String of index 0",std::string); + BBTK_INPUT(StringSelect,In1,"String of index 1",std::string); + BBTK_INPUT(StringSelect,In2,"String of index 2",std::string); + BBTK_INPUT(StringSelect,In3,"String of index 3",std::string); + BBTK_INPUT(StringSelect,In4,"String of index 4",std::string); + BBTK_INPUT(StringSelect,In5,"String of index 4",std::string); + BBTK_INPUT(StringSelect,In6,"String of index 6",std::string); + BBTK_INPUT(StringSelect,In7,"String of index 7",std::string); + BBTK_INPUT(StringSelect,In8,"String of index 8",std::string); + BBTK_INPUT(StringSelect,In9,"String of index 9",std::string); + BBTK_OUTPUT(StringSelect,Out,"Selected string",std::string); BBTK_END_DESCRIBE_BLACK_BOX(StringSelect); + //======================================================================= + } // EO namespace bbstd diff --git a/packages/std/src/bbstdStringTo.cxx b/packages/std/src/bbstdStringTo.cxx index 6bd3cdc..9ab6b06 100644 --- a/packages/std/src/bbstdStringTo.cxx +++ b/packages/std/src/bbstdStringTo.cxx @@ -7,7 +7,7 @@ namespace bbstd //==================================================================== BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION(StringTo, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); //==================================================================== //==================================================================== diff --git a/packages/std/src/bbstdStringTo.h b/packages/std/src/bbstdStringTo.h index 748a439..b86e3b5 100644 --- a/packages/std/src/bbstdStringTo.h +++ b/packages/std/src/bbstdStringTo.h @@ -1,33 +1,35 @@ #ifndef __bbstdStringTo_h_INCLUDED__ #define __bbstdStringTo_h_INCLUDED__ -#include "bbtkUserBlackBox.h" +#include "bbtkAtomicBlackBox.h" namespace bbstd { //================================================================= - // UserBlackBox declaration + // BlackBox declaration template - class StringTo : public bbtk::UserBlackBox + class StringTo : public bbtk::AtomicBlackBox { - BBTK_USER_BLACK_BOX_INTERFACE(StringTo,bbtk::UserBlackBox); + BBTK_USER_BLACK_BOX_INTERFACE(StringTo,bbtk::AtomicBlackBox); BBTK_DECLARE_INPUT(In,std::string); BBTK_DECLARE_OUTPUT(Out,T); BBTK_PROCESS(DoIt); void DoIt(); }; - //================================================================= - - // UserBlackBox description + + //================================================================= + // BlackBox description BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(StringTo); BBTK_NAME("StringTo"+bbtk::HumanTypeName()); BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr"); BBTK_CATEGORY("adaptor"); BBTK_DEFAULT_ADAPTOR(); - BBTK_DESCRIPTION("Converts the content of the input string to a "+bbtk::TypeName()); - BBTK_TEMPLATE_INPUT(StringTo, In,"Input",std::string); - BBTK_TEMPLATE_OUTPUT(StringTo, Out,"Output",T); + BBTK_DESCRIPTION("Converts the content of the input string to a " + +bbtk::HumanTypeName() + +" ("+bbtk::TypeName()+")"); + BBTK_TEMPLATE_INPUT(StringTo, In,"Input",std::string); + BBTK_TEMPLATE_OUTPUT(StringTo, Out,"Output",T); BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(StringTo); //================================================================= diff --git a/packages/std/src/bbstdStringToVector.cxx b/packages/std/src/bbstdStringToVector.cxx index 69e2a46..18ed459 100644 --- a/packages/std/src/bbstdStringToVector.cxx +++ b/packages/std/src/bbstdStringToVector.cxx @@ -6,7 +6,7 @@ namespace bbstd { //==================================================================== BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION(StringToVector, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); //==================================================================== diff --git a/packages/std/src/bbstdStringToVector.h b/packages/std/src/bbstdStringToVector.h index bbb6de1..caf7c77 100644 --- a/packages/std/src/bbstdStringToVector.h +++ b/packages/std/src/bbstdStringToVector.h @@ -1,69 +1,71 @@ #ifndef __bbstdStringToVector_INCLUDED_h__ #define __bbstdStringToVector_INCLUDED_h__ -#include "bbtkUserBlackBox.h" +#include "bbtkAtomicBlackBox.h" namespace bbstd { -//================================================================= -// UserBlackBox declaration -template -class StringToVector : public bbtk::UserBlackBox -{ - BBTK_USER_BLACK_BOX_INTERFACE(StringToVector,bbtk::UserBlackBox); + //================================================================= + // BlackBox declaration + template + class StringToVector : public bbtk::AtomicBlackBox + { + BBTK_USER_BLACK_BOX_INTERFACE(StringToVector,bbtk::AtomicBlackBox); BBTK_DECLARE_INPUT(In,std::string); BBTK_DECLARE_OUTPUT(Out,std::vector); - BBTK_PROCESS(DoIt); - void DoIt(); - T decode_item(const std::string&); -}; + BBTK_PROCESS(DoIt); + void DoIt(); + T decode_item(const std::string&); + }; + //================================================================= -//================================================================= - -// UserBlackBox description + //================================================================= + // BlackBox description BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(StringToVector); - BBTK_NAME("StringTo"+bbtk::TypeName >()); + BBTK_NAME("StringTo"+bbtk::HumanTypeName >()); BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr"); BBTK_CATEGORY("adaptor"); BBTK_DEFAULT_ADAPTOR(); - BBTK_DESCRIPTION("Converts the content of the input string to a "+bbtk::TypeName >()); - BBTK_TEMPLATE_INPUT(StringToVector, In,"Input",std::string); - typedef std::vector Tvector; - BBTK_TEMPLATE_OUTPUT(StringToVector, Out,"Output",Tvector); + BBTK_DESCRIPTION("Converts the content of the input string to a " + +bbtk::TypeName >() + +" ("< >()+")"); + BBTK_TEMPLATE_INPUT(StringToVector, In,"Input",std::string); + typedef std::vector Tvector; + BBTK_TEMPLATE_OUTPUT(StringToVector, Out,"Output",Tvector); BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(StringToVector); - -//================================================================= - -template -void StringToVector::DoIt() -{ - // std::cout << "StringToVector<"<()<<">::DoIt()"<decode_item( str.substr(lastPos, pos - lastPos) ) ); - // std::cout << this->bbGetOutputOut().back() << std::endl; - // Skip delimiters. Note the "not_of" - lastPos = str.find_first_not_of(delimiters, pos); - // Find next "non-delimiter" - pos = str.find_first_of(delimiters, lastPos); - } - // std::cout << "s=" << this->bbGetOutputOut().size() << std::endl; -} -//================================================================= - - + //================================================================= + + //================================================================= + template + void StringToVector::DoIt() + { + // std::cout << "StringToVector<"<()<<">::DoIt()"<decode_item( str.substr(lastPos, pos - lastPos) ) ); + // std::cout << this->bbGetOutputOut().back() << std::endl; + // Skip delimiters. Note the "not_of" + lastPos = str.find_first_not_of(delimiters, pos); + // Find next "non-delimiter" + pos = str.find_first_of(delimiters, lastPos); + } + // std::cout << "s=" << this->bbGetOutputOut().size() << std::endl; + } + //================================================================= + + } // namespace bbstd #endif //__bbstdStringToVector_INCLUDED_h__ diff --git a/packages/std/src/bbstdToString.cxx b/packages/std/src/bbstdToString.cxx index 691a821..75022c6 100644 --- a/packages/std/src/bbstdToString.cxx +++ b/packages/std/src/bbstdToString.cxx @@ -8,7 +8,7 @@ namespace bbstd //==================================================================== BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION(ToString, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); //==================================================================== //==================================================================== diff --git a/packages/std/src/bbstdToString.h b/packages/std/src/bbstdToString.h index 8b887d2..f7bd2d3 100644 --- a/packages/std/src/bbstdToString.h +++ b/packages/std/src/bbstdToString.h @@ -1,33 +1,34 @@ #ifndef __bbstdToString_h_INCLUDED__ #define __bbstdToString_h_INCLUDED__ -#include "bbtkUserBlackBox.h" +#include "bbtkAtomicBlackBox.h" namespace bbstd { //================================================================= - // UserBlackBox declaration + // BlackBox declaration template - class ToString : public bbtk::UserBlackBox + class ToString : public bbtk::AtomicBlackBox { - BBTK_USER_BLACK_BOX_INTERFACE(ToString,bbtk::UserBlackBox); + BBTK_USER_BLACK_BOX_INTERFACE(ToString,bbtk::AtomicBlackBox); BBTK_DECLARE_INPUT(In,T); BBTK_DECLARE_OUTPUT(Out,std::string); BBTK_PROCESS(DoIt); void DoIt(); }; - //================================================================= - // UserBlackBox description + //================================================================= + // BlackBox description BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(ToString); - BBTK_NAME(bbtk::TypeName()+"ToString"); + BBTK_NAME(bbtk::HumanTypeName()+"ToString"); BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr"); BBTK_CATEGORY("adaptor"); BBTK_DEFAULT_ADAPTOR(); - BBTK_DESCRIPTION("Converts a "+bbtk::TypeName()+" into a string"); - BBTK_TEMPLATE_INPUT(ToString, In,"Input",T); - BBTK_TEMPLATE_OUTPUT(ToString, Out,"Output",std::string); + BBTK_DESCRIPTION("Converts a "+bbtk::HumanTypeName()+" (" + +bbtk::TypeName()+") into a string"); + BBTK_TEMPLATE_INPUT(ToString, In,"Input",T); + BBTK_TEMPLATE_OUTPUT(ToString, Out,"Output",std::string); BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(ToString); //================================================================= diff --git a/packages/std/src/bbstdVectorToString.cxx b/packages/std/src/bbstdVectorToString.cxx index 68cc28a..cd9d96a 100644 --- a/packages/std/src/bbstdVectorToString.cxx +++ b/packages/std/src/bbstdVectorToString.cxx @@ -6,7 +6,7 @@ namespace bbstd { //==================================================================== BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION(VectorToString, - bbtk::UserBlackBox); + bbtk::AtomicBlackBox); //==================================================================== diff --git a/packages/std/src/bbstdVectorToString.h b/packages/std/src/bbstdVectorToString.h index f5fc510..be651ca 100644 --- a/packages/std/src/bbstdVectorToString.h +++ b/packages/std/src/bbstdVectorToString.h @@ -1,16 +1,16 @@ #ifndef __bbstdVectorToString_INCLUDED_h__ #define __bbstdVectorToString_INCLUDED_h__ -#include "bbtkUserBlackBox.h" +#include "bbtkAtomicBlackBox.h" namespace bbstd { //================================================================= - // UserBlackBox declaration + // BlackBox declaration template - class VectorToString : public bbtk::UserBlackBox + class VectorToString : public bbtk::AtomicBlackBox { - BBTK_USER_BLACK_BOX_INTERFACE(VectorToString,bbtk::UserBlackBox); + BBTK_USER_BLACK_BOX_INTERFACE(VectorToString,bbtk::AtomicBlackBox); BBTK_DECLARE_INPUT(In,std::vector); BBTK_DECLARE_INPUT(Separator,std::string); BBTK_DECLARE_OUTPUT(Out,std::string); @@ -18,10 +18,10 @@ namespace bbstd void DoIt(); virtual void bbUserConstructor(); }; - //================================================================= - // UserBlackBox description + //================================================================= + // BlackBox description BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(VectorToString); BBTK_NAME(bbtk::TypeName >()+"ToString"); BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr"); @@ -33,9 +33,9 @@ namespace bbstd BBTK_TEMPLATE_INPUT(VectorToString, Separator,"Separator of item in the output string. Default is whitespace.",std::string); BBTK_TEMPLATE_OUTPUT(VectorToString, Out,"Output",std::string); BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(VectorToString); - //================================================================= + //================================================================= template void VectorToString::DoIt() { @@ -51,9 +51,9 @@ namespace bbstd } bbSetOutputOut(out); } - //================================================================= - + + //================================================================= template void VectorToString::bbUserConstructor() { diff --git a/packages/wx/src/bbwxNotebook.h b/packages/wx/src/bbwxNotebook.h index bc0ab8a..ec3f51b 100644 --- a/packages/wx/src/bbwxNotebook.h +++ b/packages/wx/src/bbwxNotebook.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbwxNotebook.h,v $ Language: C++ - Date: $Date: 2008/02/06 14:14:24 $ - Version: $Revision: 1.3 $ + Date: $Date: 2008/02/07 07:58:56 $ + Version: $Revision: 1.4 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -75,7 +75,7 @@ namespace bbwx //================================================================= -// UserBlackBox description +// BlackBox description BBTK_BEGIN_DESCRIBE_BLACK_BOX(Notebook,bbtk::WxBlackBox); BBTK_NAME("Notebook"); BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr"); diff --git a/packages/wx/src/bbwxSizer.h b/packages/wx/src/bbwxSizer.h index efb9b0d..d348919 100644 --- a/packages/wx/src/bbwxSizer.h +++ b/packages/wx/src/bbwxSizer.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbwxSizer.h,v $ Language: C++ - Date: $Date: 2008/02/06 14:14:24 $ - Version: $Revision: 1.3 $ + Date: $Date: 2008/02/07 07:58:56 $ + Version: $Revision: 1.4 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -75,7 +75,7 @@ namespace bbwx //================================================================= -// UserBlackBox description +// BlackBox description BBTK_BEGIN_DESCRIBE_BLACK_BOX(Sizer,bbtk::WxBlackBox); BBTK_NAME("Sizer"); BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr"); diff --git a/packages/wx/src/bbwxSplit.h b/packages/wx/src/bbwxSplit.h index 56a87f8..1400deb 100644 --- a/packages/wx/src/bbwxSplit.h +++ b/packages/wx/src/bbwxSplit.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbwxSplit.h,v $ Language: C++ - Date: $Date: 2008/02/06 14:14:24 $ - Version: $Revision: 1.6 $ + Date: $Date: 2008/02/07 07:58:56 $ + Version: $Revision: 1.7 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -94,7 +94,7 @@ namespace bbwx //================================================================= -// UserBlackBox description +// BlackBox description BBTK_BEGIN_DESCRIBE_BLACK_BOX(Split,bbtk::WxBlackBox); BBTK_NAME("Split"); BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr"); -- 2.45.1