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
#include "bbtkMessageManager.h"
#include "bbtkPackage.h"
#include "bbtkUtilities.h"
-#include "bbtkUserBlackBoxDescriptor.h"
+#include "bbtkAtomicBlackBoxDescriptor.h"
#include "bbtkWxBlackBox.h"
namespace bbtk
std::string col(usercol);
int iotype = 0;
if (in->second->GetCreatorTypeInfo() ==
- typeid(UserBlackBoxDescriptor))
+ typeid(AtomicBlackBoxDescriptor))
{
col = ubbcol;
iotype = 1;
std::string col(usercol);
int iotype = 0;
if (o->second->GetCreatorTypeInfo() ==
- typeid(UserBlackBoxDescriptor))
+ typeid(AtomicBlackBoxDescriptor))
{
col = ubbcol;
iotype = 1;
+++ /dev/null
-/*=========================================================================
-
- 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(\""
- <<name<<"\")"<<std::endl);
- bbtkDebugDecTab("Kernel",7);
- }
- //=========================================================================
-
- //=========================================================================
- /// Constructor from an existing box (copy) with a new name
- UserBlackBox::UserBlackBox(UserBlackBox& from,
- const std::string &name,
- bool alloc)
- : BlackBox(from,name)
- {
- bbtkDebugMessageInc("Kernel",7,
- "UserBlackBox::UserBlackBox("
- <<from.bbGetFullName()<<",\""
- <<name<<"\")"<<std::endl);
- bbtkDebugDecTab("Kernel",7);
-
- }
- //=========================================================================
-
-
- //=========================================================================
- /// Destructor
- UserBlackBox::~UserBlackBox()
- {
- bbtkDebugMessage("Kernel",7,"UserBlackBox::~UserBlackBox()"
- <<std::endl);
- }
- //=========================================================================
-
-
-
- //=========================================================================
- /// Main processing method of the box.
- IOStatus UserBlackBox::bbBackwardUpdate( Connection* caller )
- {
- bbtkDebugMessageInc("Process",1,
- "=> UserBlackBox::bbBackwardUpdate() ["
- <<bbGetFullName()<<"]"<<std::endl);
-
- bbtkDebugMessage("Process",5,"Initial Status = "<<bbGetStatus()<<std::endl);
- bbtkDebugMessage("Process",5,"BoxProcessMode = "<<bbGetInputBoxProcessMode()<<std::endl);
-
- /*
- if ( bbGetStatus() == UPDATING )
- {
- bbtkMessage("Warning",1,"!! WARNING !! Cyclic pipeline execution (bbBackwardUpdate ["<<bbGetFullName()<<"] reentered). This may indicate an error in pipeline conception"<<std::endl);
- // return UPTODATE;
- bbSetStatus(MODIFIED);
- }
- */
-
- if ( ( bbGetStatus() == MODIFIED ) ||
- ( bbBoxProcessModeIsAlways() ) )
- {
- bool wasExecuting = bbGlobalGetSomeBoxExecuting();
- bbGlobalSetSomeBoxExecuting(true);
-
- // bbSetStatus(UPDATING);
-
- // Updates its inputs
- IOStatus s = bbUpdateInputs();
-
- bbtkDebugMessage("Process",6,"Inputs post-update status = "<<s<<std::endl);
- // If all inputs are in UPTODATE post-update status
- // and mProcessMode is not "Always"
- // then the box is now UPTODATE
- if ( ( s == UPTODATE ) &&
- ( ! bbBoxProcessModeIsAlways() ) )
- {
- bbSetStatus(UPTODATE);
- }
- else
- {
- // else it remains MODIFIED
- bbSetStatus(MODIFIED);
- }
-
- // Creates the window (WxBlackbox)
- // bbCreateWindow();
-
- // Children update (WxContainerBlackBox)
- // bbUpdateChildren(caller);
-
- // User process
- bbProcess();
-
- // Displays the window (WxBlackbox)
- bbShowWindow(caller);
-
-
-
- bbGlobalSetSomeBoxExecuting(wasExecuting);
-
-
- }
- else
- {
- bbtkDebugMessage("Process",5,"Up-to-date : nothing to do"<<std::endl);
- }
-
- bbtkDebugMessage("Process",5,"Final Status = "
- <<bbGetStatus()<<std::endl);
- bbtkDebugMessage("Process",1,
- "<= UserBlackBox::bbBackwardUpdate() ["
- <<bbGetFullName()<<"]"<<std::endl);
- bbtkDebugDecTab("Process",1);
-
- return bbGetStatus();
-
- }
- //=========================================================================
-
- /*
- //=========================================================================
- /// Main processing method of the box.
- void UserBlackBox::bbForwardUpdate( Connection* caller )
- {
- bbtkDebugMessageInc("Process",1,
- "=> UserBlackBox::bbForwardUpdate() ["
- <<bbGetFullName()<<"]"<<std::endl);
-
- bbtkDebugMessage("Process",5,"Initial Status = "<<bbGetStatus()<<std::endl);
- bbtkDebugMessage("Process",5,"BoxProcessMode = "<<bbGetInputBoxProcessMode()<<std::endl);
-
- if ( ( bbGetStatus() == MODIFIED ) ||
- ( bbBoxProcessModeIsAlways() ) )
- {
- bool wasExecuting = bbGlobalGetSomeBoxExecuting();
- bbGlobalSetSomeBoxExecuting(true);
-
- // Updates its inputs ** EXCLUDING "Parent" **
- IOStatus s = bbUpdateInputs(true);
-
- // ??? Status management on ForwardUpdate ???
- bbSetStatus(UPTODATE);
-
- // Creates the window
- bbCreateWindow();
-
- // Children update (WxContainer)
- bbUpdateChildren(caller);
-
- // User process
- bbProcess();
-
- bbGlobalSetSomeBoxExecuting(wasExecuting);
- }
-
- bbtkDebugMessage("Process",1,
- "<= UserBlackBox::bbForwardUpdate() ["
- <<bbGetFullName()<<"]"<<std::endl);
-
- bbtkDebugDecTab("Process",1);
- }
- //=========================================================================
- */
-
-
-
- //=========================================================================
- Data UserBlackBox::bbGetOutput( const std::string &name )
- {
- bbtkDebugMessageInc("Data",7,
- "UserBlackBox::bbGetOutput(\""<<name<<"\") ["
- <<bbGetFullName()<<"]"
- <<std::endl);
-
- Data p = ((UserBlackBoxOutputDescriptor*)bbGetDescriptor()->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(\""<<name<<"\") ["
- <<bbGetFullName()<<"]"
- <<std::endl);
-
- Data p = ((UserBlackBoxInputDescriptor*)bbGetDescriptor()->GetInputDescriptor(name))->GetGetFunctor()->Get(this);
-
- bbtkDebugDecTab("Data",7);
- return p;
- }
- //=========================================================================
-
-
- //=========================================================================
- /// Sets the data of the output called <name>
- void UserBlackBox::bbSetOutput( const std::string &name, Data data)
- {
- bbtkDebugMessageInc("Data",7,
- "UserBlackBox::bbSetOutput(\""<<name<<"\",data) ["
- <<bbGetFullName()<<"]"
- <<std::endl);
-
- ((UserBlackBoxOutputDescriptor*)bbGetDescriptor()->GetOutputDescriptor(name))->GetSetFunctor()->Set(this,data);
-
- bbtkDebugDecTab("Data",7);
- }
- //=========================================================================
-
-
- //=========================================================================
- /// Sets the data of the input called <name>
- void UserBlackBox::bbSetInput( const std::string &name, Data data,
- bool setModified )
- {
- bbtkDebugMessageInc("Data",7,
- "UserBlackBox::bbSetInput(\""<<name<<"\",data) ["
- <<bbGetFullName()<<"]"
- <<std::endl);
- ((UserBlackBoxInputDescriptor*)bbGetDescriptor()->GetInputDescriptor(name))->GetSetFunctor()->Set(this,data);
-
- if (setModified)
- {
- bbSetModifiedStatus();
- }
-
- bbtkDebugDecTab("Data",7);
- }
- //=========================================================================
-
- //=========================================================================
- /// Sets the data of the input called <name>
- void UserBlackBox::bbBruteForceSetInputPointer( const std::string &name,
- void* data,
- bool setModified )
- {
- bbtkDebugMessageInc("Data",7,
- "UserBlackBox::bbBruteForceSetInputPointer(\""
- <<name<<"\",data) ["
- <<bbGetFullName()<<"]"
- <<std::endl);
- ((UserBlackBoxInputDescriptor*)bbGetDescriptor()->GetInputDescriptor(name))->GetSetFunctor()->BruteForceSetPointer(this,data);
-
- if (setModified)
- {
- bbSetModifiedStatus();
- }
-
- bbtkDebugDecTab("Data",7);
- }
- //=========================================================================
-
-}
-// EO namespace bbtk
+++ /dev/null
-/*=========================================================================
-
- 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 <name>
- void bbSetOutput( const std::string &name, Data data);
- /// Sets the data of the input called <name>
- void bbSetInput( const std::string &name, Data data,
- bool setModified = true);
- /// Sets the data of the input called <name>
- 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 '"
- <<bbGetFullName()
- <<"' : the box does nothing. Is it a bug or a feature ?"
- <<std::endl);
- }
- //==================================================================
-
- //==================================================================
- /// User callback called in the box contructor
- virtual void bbUserConstructor() {}
- /// User callback called in the box copy constructor
- virtual void bbUserCopyConstructor() {}
- /// User callback called in the box destructor
- virtual void bbUserDestructor() {}
- //==================================================================
-
- //==================================================================
- private:
- //==================================================================
- /// Default constructor is private :
- /// derived classes must use the constructor with the UserBlackBox's name
- UserBlackBox() : BlackBox("") {}
- //==================================================================
-
-
- };
- // Class UserBlackBox
- //===========================================================================
-
-
-
-}
-// namespace bbtk
-
-
-#include "bbtkUserBlackBoxMacros.h"
-
-#endif
-
+++ /dev/null
-/*=========================================================================
-
- Program: bbtk
- Module: $RCSfile: bbtkUserBlackBoxDescriptor.h,v $
- Language: C++
- Date: $Date: 2008/02/06 14:58:41 $
- 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::UserBlackBoxDescriptor : structure containing the description of a UserBlackBox input (name, description, type, functor)
- */
-/**
- * \class bbtk::UserBlackBoxDescriptor
- * \brief Structure containing the description of a UserBlackBox input (name, description, type, functor)
- */
-
-#ifndef __bbtkUserBlackBoxDescriptor_h__
-#define __bbtkUserBlackBoxDescriptor_h__
-
-#include "bbtkBlackBoxDescriptor.h"
-#include "bbtkUserBlackBoxInputDescriptor.h"
-#include "bbtkUserBlackBoxOutputDescriptor.h"
-
-namespace bbtk
-{
-
-
- class BBTK_EXPORT UserBlackBoxDescriptor : public bbtk::BlackBoxDescriptor
- {
- public:
- UserBlackBoxDescriptor()
- {
- // Creates the input 'BoxProcessMode'
- AddInputDescriptor
- (new
- bbtk::UserBlackBoxInputDescriptor
- (typeid(UserBlackBoxDescriptor),
- "BoxProcessMode",
- "Sets the processing mode of the box (Pipeline | Always | Reactive)",
- new bbtk::UserBlackBoxTGetFunctor<BlackBox,std::string,std::string>(&BlackBox::bbGetInputBoxProcessMode),
- new bbtk::UserBlackBoxTSetFunctor<BlackBox,std::string,std::string>(&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,Void,Void>(&BlackBox::bbGetInputBoxExecute),
- new bbtk::UserBlackBoxTSetFunctor<BlackBox,Void,Void>(&BlackBox::bbSetInputBoxExecute) ) );
- // Creates the output 'BoxChange'
- AddOutputDescriptor
- (new
- bbtk::UserBlackBoxOutputDescriptor
- (typeid(UserBlackBoxDescriptor),
- "BoxChange",
- "Signal modifications of the box",
- new bbtk::UserBlackBoxTGetFunctor<BlackBox,Void,Void>(&BlackBox::bbGetOutputBoxChange),
- new bbtk::UserBlackBoxTSetFunctor<BlackBox,Void,Void>(&BlackBox::bbSetOutputBoxChange) ) );
- //
- AddToCategory("atomic box");
- }
- };
-
-}
-// namespace bbtk
-#endif
+++ /dev/null
-/*=========================================================================
-
- 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 UBB, class T, class TRETURN>
- 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<UBB>()<<","<<
- TypeName<T>()<<","<<
- TypeName<TRETURN>()<<
- ">::UserBlackBoxTGetFunctor()"<<std::endl);
- }
-
- /// Concrete application of the Get method of object o
- Data Get(UserBlackBox* o)
- {
- bbtkDebugMessage("Data",9,"UserBlackBoxTGetFunctor<"<<
- TypeName<UBB>()<<","<<
- TypeName<T>()<<","<<
- TypeName<TRETURN>()<<
- ">::Get()"<<std::endl);
- return (((UBB*)o)->*mGetMethodPointer)();
- }
- ///
- TypeInfo GetTypeInfo() const { return typeid(T); }
- std::string GetTypeName() const { return TypeName<T>(); }
- std::string GetHumanTypeName() const { return HumanTypeName<T>(); }
- ///
- virtual bool IsPointerType() const
- {
-#ifdef _USE_BOOST_
- return boost::is_pointer<T>::value;
-#else
- return false;
-#endif
- }
-
- private:
- /// Pointer on the Get method
- GetMethodPointerType mGetMethodPointer;
- };
- //===========================================================================
-
-
-
- //===========================================================================
- template <class UBB, class T, class TACCESS>
- 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<UBB>()<<","<<
- TypeName<T>()<<","<<
- TypeName<TACCESS>()<<
- ">::UserBlackBoxTSetFunctor()"<<std::endl);
- }
-
- /// Concrete application of the Set method of object o
- void Set(UserBlackBox* o, const Data& d)
- {
- bbtkDebugMessage("Data",9,"UserBlackBoxTSetfunctor<"<<
- TypeName<UBB>()<<","<<
- TypeName<T>()<<","<<
- TypeName<TACCESS>()<<
- ">::Set()"<<std::endl);
- // (((UBB*)o)->*mSetMethodPointer)(*(T*)d);
- // bbtkAssert( bbtkEqualTypes( d.type(), typeid(T) ) );
- T t = d.unsafe_get<T>();
- (((UBB*)o)->*mSetMethodPointer)(t);
- // bbtkDebugMessage("Kernel",9,"SetOK"<<std::endl);
- }
-
- ///
- TypeInfo GetTypeInfo() const { return typeid(T); }
- std::string GetTypeName() const { return TypeName<T>(); }
- std::string GetHumanTypeName() const { return HumanTypeName<T>(); }
- virtual bool IsPointerType() const { return false; }
- virtual void BruteForceSetPointer(UserBlackBox* b, void* p)
- {
- bbtkInternalError("UserBlackBoxTSetFunctor<"
- <<TypeName<UBB>()<<","
- <<TypeName<T>()<<","
- <<TypeName<TACCESS>()
- <<">::BruteForceSetPointer("
- <<b<<","<<p<<")"
- <<" called whereas type '"
- <<TypeName<T>()
- <<"' is not a pointer type");
- }
- private:
- /// Pointer on the Set method
- SetMethodPointerType mSetMethodPointer;
- };
- //===========================================================================
-
-
-
- //===========================================================================
- /// Template specialization of UserBlackBoxTSetFunctor for pointer types
- template <class UBB, class T, class TACCESS>
- class UserBlackBoxTSetFunctor<UBB,T*,TACCESS*>
- : 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<UBB>()<<","<<
- TypeName<T*>()<<","<<
- TypeName<TACCESS*>()<<
- ">::UserBlackBoxTSetFunctor()"<<std::endl);
- }
-
- /// Concrete application of the Set method of object o
- void Set(UserBlackBox* o, const Data& d)
- {
- bbtkDebugMessage("Data",9,"UserBlackBoxTSetfunctor<"<<
- TypeName<UBB>()<<","<<
- TypeName<T*>()<<","<<
- TypeName<TACCESS*>()<<
- ">::Set()"<<std::endl);
-
- (((UBB*)o)->*mSetMethodPointer)(d.unsafe_get<T*>());
-
- }
-
- ///
- TypeInfo GetTypeInfo() const { return typeid(T*); }
- std::string GetTypeName() const { return TypeName<T*>(); }
- std::string GetHumanTypeName() const { return HumanTypeName<T*>(); }
- virtual bool IsPointerType() const { return true; }
-
-
- virtual void BruteForceSetPointer(UserBlackBox* o, void* p)
- {
- bbtkDebugMessage("Data",9,"UserBlackBoxTSetFunctor<"
- <<TypeName<UBB>()<<","
- <<TypeName<T*>()<<","
- <<TypeName<TACCESS*>()
- <<">::BruteForceSetPointer() (pointer specialization)");
-
- (((UBB*)o)->*mSetMethodPointer)((T*)p);
-
- }
- private:
- /// Pointer on the Set method
- SetMethodPointerType mSetMethodPointer;
- };
- //===========================================================================
-
-}
-// namespace bbtk
-#endif
+++ /dev/null
-/*=========================================================================
-
- 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(\""
- <<name<<"\",\""<<description<<"\","
- <<getfunctor<<","<<setfunctor<<","
- <<copy_construct<<")"<<std::endl);
- }
-
-
-
- UserBlackBoxInputDescriptor::~UserBlackBoxInputDescriptor()
- {
- bbtkDebugMessage("Kernel",9,
- "UserBlackBoxInputDescriptor::"
- <<"~UserBlackBoxInputDescriptor(\""
- <<GetName()<<"\",\""<<GetDescription()<<"\","
- <<mGetFunctor<<","<<mSetFunctor<<")"<<std::endl);
- }
-}
+++ /dev/null
-/*=========================================================================
-
- Program: bbtk
- Module: $RCSfile: bbtkUserBlackBoxInputDescriptor.h,v $
- Language: C++
- Date: $Date: 2008/02/06 14:14:22 $
- 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::UserBlackBoxInputDescriptor : structure containing the description of a UserBlackBox input (name, description, type, functor)
- */
-/**
- * \class bbtk::UserBlackBoxInputDescriptor
- * \brief Structure containing the description of a UserBlackBox input (name, description, type, functor)
- */
-
-#ifndef __bbtkUserBlackBoxInputDescriptor_h__
-#define __bbtkUserBlackBoxInputDescriptor_h__
-
-#include "bbtkBlackBoxInputDescriptor.h"
-#include "bbtkUserBlackBoxGetSetFunctor.h"
-#include <typeinfo>
-
-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
+++ /dev/null
-/*=========================================================================
-
- 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(\""<<name<<"\")"<<std::endl); \
- bbCreateDescriptorIfNeeded(); \
- CLASS* c = new CLASS(name); \
- bbtkDebugDecTab("Kernel",9); \
- return c; \
- } \
- inline bbtk::BlackBox* bbClone(const std::string& name) \
- { \
- bbtkDebugMessageInc("Kernel",9,#CLASS<<"::bbClone(\""<<name<<"\")"<<std::endl); \
- bbCreateDescriptorIfNeeded(); \
- CLASS* c = new CLASS(*this,name); \
- bbtkDebugDecTab("Kernel",9); \
- return c; \
- } \
- bbtk::BlackBoxDescriptor* bbGetDescriptor() const \
- { \
- return (bbtk::BlackBoxDescriptor*)bbDescriptor(); \
- } \
- static bbtk::BlackBoxDescriptor* bbDescriptor() \
- { \
- bbCreateDescriptorIfNeeded(); \
- return bbDescriptorPointer(); \
- } \
- private: \
- CLASS() : PARENT("") {} \
- static bbtk::BlackBoxDescriptor*& bbDescriptorPointer() \
- { \
- static bbtk::BlackBoxDescriptor* d = 0; \
- return d; \
- }
-//============================================================================
-
-
-//============================================================================
-/// Defines the bbUserProcess method
-#define BBTK_PROCESS(CALLBACK) \
- public: \
- inline void bbUserProcess() \
- { \
- bbtkDebugMessageInc("Process",1,"=> "<<bbGetTypeName()<<"::bbUserProcess() [" \
- <<bbGetFullName()<<"]"<<std::endl); \
- CALLBACK(); \
- bbtkDebugMessageDec("Process",1,"<= "<<bbGetTypeName()<<"::bbUserProcess() [" \
- <<bbGetFullName()<<"]"<<std::endl); \
- }
-//============================================================================
-
-
-//============================================================================
-/// Declares a new UserBlackBox input (to be put in the class interface)
-#define BBTK_DECLARE_INPUT(NAME,TYPE) \
- protected: \
- TYPE bbmInput##NAME; \
- public: \
- TYPE bbGetInput##NAME () \
- { return bbmInput##NAME; } \
- void bbSetInput##NAME (TYPE d) \
- { bbmInput##NAME = d; \
- /*bbSetModifiedStatus();*/ }
-//============================================================================
-
-//============================================================================
-/// Declares a new UserBlackBox output (to be put in the class interface)
-#define BBTK_DECLARE_OUTPUT(NAME,TYPE) \
- protected: \
- TYPE bbmOutput##NAME; \
- public: \
- TYPE bbGetOutput##NAME () \
- { return bbmOutput##NAME; } \
- void bbSetOutput##NAME (TYPE d) \
- { bbmOutput##NAME = d; }
-//============================================================================
-
-//============================================================================
-/// Declares an inherited UserBlackBox input (to be put in the class interface)
-#define BBTK_DECLARE_INHERITED_INPUT(NAME,TYPE,GETMETHOD,SETMETHOD) \
- public: \
- TYPE bbGetInput##NAME () \
- { return GETMETHOD(); } \
- void bbSetInput##NAME (TYPE d) \
- { SETMETHOD(d); \
- /*bbSetModifiedStatus();*/ }
-//============================================================================
-
-
-//============================================================================
-/// Declares an inherited UserBlackBox output (to be put in the class interface)
-#define BBTK_DECLARE_INHERITED_OUTPUT(NAME,TYPE,GETMETHOD,SETMETHOD) \
- public: \
- TYPE bbGetOutput##NAME () const \
- { return GETMETHOD(); } \
- void bbSetOutput##NAME (TYPE d) \
- { SETMETHOD(d); }
-//============================================================================
-
-
-
-//============================================================================
-#define BBTK_BEGIN_BLACK_BOX_CONSTRUCTOR(CLASS,ALLOC) \
- bbtkDebugMessageInc("Kernel",7,#CLASS<<"::"<<#CLASS \
- <<"(\""<<bbGetName()<<"\")"<<std::endl); \
- if (ALLOC) bbAllocateConnectors();
-//============================================================================
-
-//============================================================================
-#define BBTK_BEGIN_BLACK_BOX_COPY_CONSTRUCTOR(CLASS,FROM,ALLOC) \
- bbtkDebugMessageInc("Kernel",7,#CLASS<<"::"<<#CLASS \
- <<"("<<FROM.bbGetFullName()<<",\"" \
- <<bbGetName()<<"\")"<<std::endl); \
- if (ALLOC) \
- { \
- bbAllocateConnectors(); \
- bbCopyIOValues(FROM); \
- }
-//============================================================================
-
-
-//============================================================================
-#define BBTK_END_BLACK_BOX_CONSTRUCTOR \
- bbtkDebugDecTab("Kernel",7)
-//============================================================================
-
-//============================================================================
-#define BBTK_BEGIN_BLACK_BOX_DESTRUCTOR(CLASS) \
- bbtkDebugMessageInc("Kernel",7,#CLASS <<"::~"<< #CLASS \
- <<"() ["<<this->bbGetFullName()<<"]"<<std::endl);
-//============================================================================
-
-
-
-
-//============================================================================
-#define BBTK_END_BLACK_BOX_DESTRUCTOR \
- bbtkDebugDecTab("Kernel",7)
-//============================================================================
-
-
-//============================================================================
-/// UserBlackBox std implementation of ctor and dtor
-#define BBTK_USER_BLACK_BOX_IMPLEMENTATION(CLASS,PARENT) \
- CLASS::CLASS(const std::string& name, bool allocate_connectors) \
- : PARENT(name,false) \
- { \
- BBTK_BEGIN_BLACK_BOX_CONSTRUCTOR(CLASS,allocate_connectors); \
- CLASS::bbUserConstructor(); \
- BBTK_END_BLACK_BOX_CONSTRUCTOR; \
- } \
- 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; \
- } \
- CLASS::~CLASS() \
- { \
- BBTK_BEGIN_BLACK_BOX_DESTRUCTOR(CLASS); \
- CLASS::bbUserDestructor(); \
- BBTK_END_BLACK_BOX_DESTRUCTOR; \
- }
-//============================================================================
-
-
-//============================================================================
-/// Begins the UserBlackBox description block
-#define BBTK_BEGIN_DESCRIBE_BLACK_BOX(CLASS,PARENT) \
- class /*BBTK_EXPORT*/ CLASS ## Descriptor : public PARENT ## Descriptor \
- { \
- public: \
- bbtk::BlackBox::Pointer CreateInstance(const std::string& name) \
- { \
- return CLASS::bbNew(name); \
- } \
- CLASS ## Descriptor() \
- { \
- bbtkDebugMessageInc("Kernel",9,#CLASS<<"Descriptor::"<<#CLASS \
- <<"Descriptor()"<<std::endl)
-//============================================================================
-
-//============================================================================
-/// Ends the UserBlackBox description block
-#define BBTK_END_DESCRIBE_BLACK_BOX(CLASS) \
- bbtkDecTab("Kernel",9); \
- } \
- }; \
- void CLASS::bbCreateDescriptorIfNeeded() \
- { \
- if ( !bbDescriptorPointer() ) \
- bbDescriptorPointer() = new CLASS ## Descriptor; \
- }
-//============================================================================
-
-
-//============================================================================
-/// Declares the name of a UserBlackBox (to be put inside the UBB description block)
-#define BBTK_NAME(NAME) SetTypeName(NAME)
-//============================================================================
-
-//============================================================================
-/// Declares the author of a UserBlackBox (to be put inside the UBB description block)
-#define BBTK_AUTHOR(AUTHOR) AddToAuthor(AUTHOR)
-//============================================================================
-
-//============================================================================
-/// Declares the categories of a UserBlackBox (to be put inside the UBB description block)
-#define BBTK_CATEGORY(CATEGORY) AddToCategory(CATEGORY)
-//============================================================================
-
-//============================================================================
-/// Declares the description of a UserBlackBox (to be put inside the UBB description block)
-#define BBTK_DESCRIPTION(DESCR) AddToDescription(DESCR)
-//============================================================================
-
-//============================================================================
-/// Declares the kind of a UserBlackBox (to be put inside the UBB description block)
-//#define BBTK_KIND(KIND) SetKind(KIND)
-//============================================================================
-
-//============================================================================
-/// Declares that the UserBlackBox is an adaptor (to be put inside the UBB description block)
-#define BBTK_ADAPTOR() SetKInd(bbtk::BlackBoxDescriptor::ADAPTOR)
-//============================================================================
-
-//============================================================================
-/// Declares that the UserBlackBox is the default adaptor of the package (to be put inside the UBB description block)
-#define BBTK_DEFAULT_ADAPTOR() SetKind(bbtk::BlackBoxDescriptor::DEFAULT_ADAPTOR)
-//============================================================================
-
-//============================================================================
-/// Describes a UserBlackBox input (to be put inside the UBB description block)
-#define BBTK_INPUT(CLASS,NAME,DESCR,TYPE) \
- AddInputDescriptor(new bbtk::UserBlackBoxInputDescriptor \
- (typeid(CLASS ## Descriptor), \
- #NAME,DESCR, \
- new bbtk::UserBlackBoxTGetFunctor<CLASS,TYPE,TYPE > \
- (&CLASS::bbGetInput##NAME), \
- new bbtk::UserBlackBoxTSetFunctor<CLASS,TYPE,TYPE > \
- (&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,TYPE,TYPE > \
- (&CLASS::bbGetOutput##NAME), \
- new bbtk::UserBlackBoxTSetFunctor<CLASS,TYPE,TYPE > \
- (&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,TYPE,TYPE > \
- (&CLASS::bbGetInput##NAME), \
- new bbtk::UserBlackBoxTSetFunctor<CLASS,TYPE,TYPE > \
- (&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,TYPE,TYPE > \
- (&CLASS::bbGetOutput##NAME), \
- new bbtk::UserBlackBoxTSetFunctor<CLASS,TYPE,TYPE > \
- (&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 T> \
- class /*BBTK_EXPORT*/ CLASS ## Descriptor : public bbtk::BlackBoxDescriptor \
- { \
- public: \
- bbtk::BlackBox::Pointer CreateInstance(const std::string& name) \
- { \
- return CLASS<T>::bbNew(name); \
- } \
- CLASS ## Descriptor() \
- { \
- bbtkDebugMessageInc("Kernel",9,#CLASS<<"Descriptor::"<<#CLASS \
- <<"Descriptor()"<<std::endl)
-//============================================================================
-
-//============================================================================
-/// Ends a template UserBlackBox of template param T description block
-#define BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(CLASS) \
- bbtkDecTab("Kernel",9); \
- } \
- }; \
- template <class T> \
- void CLASS<T>::bbCreateDescriptorIfNeeded() \
- { \
- if ( !bbDescriptorPointer() ) \
- bbDescriptorPointer() = new CLASS ## Descriptor<T>; \
- }
-//============================================================================
-
-//============================================================================
-/// 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<CLASS<T>,TYPE,TYPE > \
- (&CLASS<T>::bbGetInput##NAME), \
- new bbtk::UserBlackBoxTSetFunctor<CLASS<T>,TYPE,TYPE > \
- (&CLASS<T>::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<CLASS<T>,TYPE,TYPE > \
- (&CLASS<T>::bbGetOutput##NAME), \
- new bbtk::UserBlackBoxTSetFunctor<CLASS<T>,TYPE,TYPE > \
- (&CLASS<T>::bbSetOutput##NAME) ) )
-//============================================================================
-
-//============================================================================
-/// Template UserBlackBox std implementation of ctor and dtor
-#define BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION(CLASS,PARENT) \
- template <class T> \
- CLASS<T>::CLASS(const std::string& name, bool alloc) \
- : PARENT(name,false) \
- { \
- BBTK_BEGIN_BLACK_BOX_CONSTRUCTOR(CLASS<T>,alloc); \
- CLASS<T>::bbUserConstructor(); \
- BBTK_END_BLACK_BOX_CONSTRUCTOR; \
- } \
- template <class T> \
- CLASS<T>::CLASS(CLASS<T>& from, \
- const std::string& name, bool allocate_connectors) \
- : PARENT(from,name,false) \
- { \
- BBTK_BEGIN_BLACK_BOX_COPY_CONSTRUCTOR(CLASS<T>,from,allocate_connectors); \
- CLASS<T>::bbUserCopyConstructor(); \
- BBTK_END_BLACK_BOX_CONSTRUCTOR; \
- } \
- template <class T> \
- CLASS<T>::~CLASS() \
- { \
- BBTK_BEGIN_BLACK_BOX_DESTRUCTOR(CLASS<T>); \
- CLASS<T>::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 T1, class T2> \
- class /*BBTK_EXPORT*/ CLASS ## Descriptor : public bbtk::BlackBoxDescriptor \
- { \
- public: \
- bbtk::BlackBox::Pointer CreateInstance(const std::string& name) \
- { \
- return CLASS<T1,T2>::bbNew(name); \
- } \
- CLASS ## Descriptor() \
- { \
- bbtkDebugMessageInc("Kernel",9,#CLASS<<"Descriptor::"<<#CLASS \
- <<"Descriptor()"<<std::endl)
-//============================================================================
-
-//============================================================================
-/// Ends a template UserBlackBox description block of template param T1 and T2
-#define BBTK_END_DESCRIBE_TEMPLATE2_BLACK_BOX(CLASS) \
- bbtkDecTab("Kernel",9); \
- } \
- }; \
- template <class T1, class T2> \
- void CLASS<T1,T2>::bbCreateDescriptorIfNeeded() \
- { \
- if ( !bbDescriptorPointer() ) \
- bbDescriptorPointer() = new CLASS ## Descriptor<T1,T2>; \
- }
-//============================================================================
-
-//============================================================================
-// 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 <TYPE1 T1, TYPE2 T2> \
- class /*BBTK_EXPORT*/ CLASS ## Descriptor : public bbtk::BlackBoxDescriptor \
- { \
- public: \
- bbtk::BlackBox::Pointer CreateInstance(const std::string& name) \
- { \
- return new CLASS<T1,T2>(name); \
- } \
- CLASS ## Descriptor() \
- { \
- bbtkDebugMessageInc("Kernel",9,#CLASS<<"Descriptor::"<<#CLASS \
- <<"Descriptor()"<<std::endl)
-//============================================================================
-
-//============================================================================
-/// Ends a template UserBlackBox description block of template param T1 and T2
-#define BBTK_END_DESCRIBE_TEMPLATE2_WITH_TYPES_BLACK_BOX(CLASS,TYPE1,TYPE2) \
- bbtkDecTab("Kernel",9); \
- } \
- }; \
- template <TYPE1 T1, TYPE2 T2> \
- void CLASS<T1,T2>::bbCreateDescriptorIfNeeded() \
- { \
- if ( !bbDescriptorPointer() ) \
- bbDescriptorPointer() = new CLASS ## Descriptor<T1,T2>; \
- }
-//============================================================================
-
-
-
-//============================================================================
-/// 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<CLASS<T1,T2>,TYPE,TYPE > \
- (&CLASS<T1,T2>::bbGetInput##NAME), \
- new bbtk::UserBlackBoxTSetFunctor<CLASS<T1,T2>,TYPE,TYPE > \
- (&CLASS<T1,T2>::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<CLASS<T1,T2>,TYPE,TYPE > \
- (&CLASS<T1,T2>::bbGetOutput##NAME), \
- new bbtk::UserBlackBoxTSetFunctor<CLASS<T1,T2>,TYPE,TYPE > \
- (&CLASS<T1,T2>::bbSetOutput##NAME) ) )
-//============================================================================
-
-//============================================================================
-/// Template UserBlackBox std implementation of ctor and dtor
-#define BBTK_USER_BLACK_BOX_TEMPLATE2_IMPLEMENTATION(CLASS,PARENT) \
- template <class T1, class T2> \
- CLASS<T1,T2>::CLASS(const std::string& name, bool alloc) \
- : PARENT(name,false) \
- { \
- BBTK_BEGIN_BLACK_BOX_CONSTRUCTOR(CLASS,alloc); \
- CLASS<T1,T2>::bbUserConstructor(); \
- BBTK_END_BLACK_BOX_CONSTRUCTOR; \
- } \
- template <class T1, class T2> \
- CLASS<T1,T2>::CLASS(CLASS<T1,T2>& from, \
- const std::string& name, bool allocate_connectors) \
- : PARENT(from,name,false) \
- { \
- BBTK_BEGIN_BLACK_BOX_COPY_CONSTRUCTOR(CLASS,from,allocate_connectors); \
- CLASS<T1,T2>::bbUserCopyConstructor(); \
- BBTK_END_BLACK_BOX_CONSTRUCTOR; \
- } \
- template <class T1, class T2> \
- CLASS<T1,T2>::~CLASS() \
- { \
- BBTK_BEGIN_BLACK_BOX_DESTRUCTOR(CLASS); \
- CLASS<T1,T2>::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 <TYPE1 T1, TYPE2 T2> \
- CLASS<T1,T2>::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 <TYPE1 T1, TYPE2 T2> \
- CLASS<T1,T2>::CLASS(CLASS<T1,T2>& 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 <TYPE1 T1, TYPE2 T2> \
- CLASS<T1,T2>::~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<TYPE>(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
+++ /dev/null
-/*=========================================================================
-
- 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(\""
- <<name<<"\",\""<<description
- <<"\""<<getfunctor<<","<<setfunctor
- <<","<<copy_construct<<")"<<std::endl);
- }
-
-
- UserBlackBoxOutputDescriptor::~UserBlackBoxOutputDescriptor()
- {
- bbtkDebugMessage("Kernel",9,"UserBlackBoxOutputDescriptor::~UserBlackBoxOutputDescriptor(\""<<GetName()<<"\",\""<<GetDescription()<<"\""<<mGetFunctor<<","<<mSetFunctor<<")"<<std::endl);
- }
-
-}
+++ /dev/null
-/*=========================================================================
-
- Program: bbtk
- Module: $RCSfile: bbtkUserBlackBoxOutputDescriptor.h,v $
- Language: C++
- Date: $Date: 2008/02/06 14:14:22 $
- 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::UserBlackBoxOutputDescriptor : structure containing the description of a UserBlackBox output (name, description, type, functor)
- */
-/**
- * \class bbtk::UserBlackBoxOutputDescriptor
- * \brief Structure containing the description of a UserBlackBox output (name, description, type, functor)
- */
-
-#ifndef __bbtkUserBlackBoxOutputDescriptor_h__
-#define __bbtkUserBlackBoxOutputDescriptor_h__
-
-#include "bbtkBlackBoxOutputDescriptor.h"
-#include "bbtkUserBlackBoxGetSetFunctor.h"
-#include "bbtkMessageManager.h"
-
-namespace bbtk
-{
-
-
- class BBTK_EXPORT UserBlackBoxOutputDescriptor :
- public bbtk::BlackBoxOutputDescriptor
- {
- public:
-
- UserBlackBoxOutputDescriptor( TypeInfo creator_type_info,
- const std::string& name,
- const std::string& description,
- UserBlackBoxGetFunctor* getfunctor,
- UserBlackBoxSetFunctor* setfunctor,
- bool copy_construct = true);
- ~UserBlackBoxOutputDescriptor();
-
- /// 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
- UserBlackBoxOutputDescriptor() :
- BlackBoxOutputDescriptor(typeid(void),"","") {}
- /// The functor on the Get method
- UserBlackBoxGetFunctor* mGetFunctor;
- /// The functor on the Set method
- UserBlackBoxSetFunctor* mSetFunctor;
- };
-
-
-}
-// namespace bbtk
-#endif
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
//=========================================================================
//=========================================================================
//=========================================================================
- BBTK_USER_BLACK_BOX_IMPLEMENTATION(WxBlackBox,UserBlackBox);
+ BBTK_USER_BLACK_BOX_IMPLEMENTATION(WxBlackBox,AtomicBlackBox);
//=========================================================================
//=========================================================================
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
#include "bbtkWx.h"
-#include "bbtkUserBlackBox.h"
+#include "bbtkAtomicBlackBox.h"
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);
//======================================================================
//=================================================================
- // 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");
{
//====================================================================
BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION(AnyImageToTypedImage,
- bbtk::UserBlackBox);
+ bbtk::AtomicBlackBox);
BBTK_USER_BLACK_BOX_TEMPLATE2_IMPLEMENTATION(AnyImageToConstTypedImage,
- bbtk::UserBlackBox);
+ bbtk::AtomicBlackBox);
//====================================================================
#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 itkImageTypePointer>
- 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);
//=================================================================
//=================================================================
- // UserBlackBox description
+ // BlackBox description
BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(AnyImageToTypedImage);
BBTK_NAME(bbtk::HumanTypeName<anyImagePointer>() + "To"+bbtk::HumanTypeName<T>());
BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
//=================================================================
//=================================================================
- // UserBlackBox declaration
+ // BlackBox declaration
template <class itkImageTypePointer, class itkImageTypeConstPointer>
- 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);
//=================================================================
//=================================================================
- // UserBlackBox description
+ // BlackBox description
BBTK_BEGIN_DESCRIBE_TEMPLATE2_BLACK_BOX(AnyImageToConstTypedImage);
BBTK_NAME("Convert<"+bbtk::TypeName<anyImagePointer>() + "," +
bbtk::TypeName<T2>()+">");
{
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);
}
#ifdef _USE_ITK_
-#include "bbtkUserBlackBox.h"
+#include "bbtkAtomicBlackBox.h"
#include "itkBinaryThresholdImageFilter.h"
#include "bbitkImage.h"
template <class T>
class /*BBTK_EXPORT*/ BinaryThresholdImageFilter
:
- public bbtk::UserBlackBox,
+ public bbtk::AtomicBlackBox,
public itk::BinaryThresholdImageFilter<T,T>
{
BBTK_USER_BLACK_BOX_INTERFACE(BinaryThresholdImageFilter,
- bbtk::UserBlackBox);
+ bbtk::AtomicBlackBox);
typedef itk::BinaryThresholdImageFilter<T,T> itkParent;
BBTK_DECLARE_ITK_INPUT(itkParent,In,const T*);
BBTK_DECLARE_ITK_PARAM(itkParent,LowerThreshold,typename T::PixelType);
//===================================================
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);
};
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");
{
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)
#ifdef _USE_ITK_
-#include "bbtkUserBlackBox.h"
+#include "bbtkAtomicBlackBox.h"
#include "itkExtractImageFilter.h"
#include "bbitkImage.h"
#include "bbitkImageRegion.h"
template <class T>
class /*BBTK_EXPORT*/ ExtractImageFilter
:
- public bbtk::UserBlackBox,
+ public bbtk::AtomicBlackBox,
public itk::ExtractImageFilter<T,T>
{
- BBTK_USER_BLACK_BOX_INTERFACE(ExtractImageFilter,bbtk::UserBlackBox);
+ BBTK_USER_BLACK_BOX_INTERFACE(ExtractImageFilter,bbtk::AtomicBlackBox);
typedef itk::ExtractImageFilter<T,T> itkParent;
BBTK_DECLARE_ITK_INPUT(itkParent,In,const T*);
// 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);
template <class T> 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");
//====================================================================
BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION(Relay,
- bbtk::UserBlackBox);
+ bbtk::AtomicBlackBox);
//====================================================================
}
using namespace bbstd;
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
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);
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
#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);
// Template doit method
template<class ImageType> 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");
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
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);
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
#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);
// Template read method
template<class itkImageType> 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");
{
BBTK_USER_BLACK_BOX_IMPLEMENTATION(ImageRegionCreator,
- bbtk::UserBlackBox);
+ bbtk::AtomicBlackBox);
BBTK_ADD_BLACK_BOX_TO_PACKAGE(itk,ImageRegionCreator);
#include "itkImageRegion.h"
#include "bbtkMessageManager.h"
#include "bbtkAny.h"
-#include "bbtkUserBlackBox.h"
+#include "bbtkAtomicBlackBox.h"
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<long>);
BBTK_DECLARE_INPUT(Size,std::vector<long>);
BBTK_DECLARE_OUTPUT(Out,anyImageRegion);
};
- 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<anyImageRegion>()+") from two vectors providing the index and size of the region. The dimension D of the actual itk::ImageRegion<D> created is the max of the sizes of Index and Size (the smallest vector is padded by zeros).");
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
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);
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
#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<std::string>);
BBTK_DECLARE_OUTPUT(Out,anyImagePointer);
// Template read method
template<class T> 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");
//====================================================================
BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION(ToString,
- bbtk::UserBlackBox);
+ bbtk::AtomicBlackBox);
//====================================================================
//====================================================================
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
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);
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
#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);
//=================================================================
- // 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");
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);
}
#ifdef _USE_ITK_
#include <math.h>
-#include "bbtkUserBlackBox.h"
+#include "bbtkAtomicBlackBox.h"
#include "itkResampleImageFilter.h"
#include "bbitkImage.h"
#include "itkNearestNeighborInterpolateImageFunction.h"
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<double>);
BBTK_DECLARE_INPUT(Interpolation,std::string);
};
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");
{
//====================================================================
BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION(TypedImageToAnyImage,
- bbtk::UserBlackBox);
+ bbtk::AtomicBlackBox);
//====================================================================
#ifndef __bbTypedItkImage2GenericItkImage_h__
#define __bbTypedItkImage2GenericItkImage_h__
-#include "bbtkUserBlackBox.h"
+#include "bbtkAtomicBlackBox.h"
#include "bbitkImage.h"
#include "bbtkSystem.h"
{
//=================================================================
- // UserBlackBox declaration
+ // BlackBox declaration
template <class itkImageTypePointer>
- 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);
//=================================================================
//=================================================================
- // UserBlackBox description
+ // BlackBox description
BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(TypedImageToAnyImage);
BBTK_NAME(bbtk::HumanTypeName<T>()
+ "To" + bbtk::HumanTypeName<anyImagePointer>());
<description>Adds its inputs</description>
<category>math</category>
- <parentblackbox>bbtk::UserBlackBox</parentblackbox>
+ <parentblackbox>bbtk::AtomicBlackBox</parentblackbox>
<package>std</package>
<namespace>bbstd</namespace>
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()
{
#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);
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);
}
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()
{
#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);
};
- 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
{
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
#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);
// 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
{}
/// 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()"<<std::endl);
(((MagicBox*)o)->*mSetMethodPointer)(d);
std::string GetTypeName() const { return bbtk::TypeName<bbtk::Data>(); }
std::string GetHumanTypeName() const { return bbtk::HumanTypeName<bbtk::Data>(); }
bool IsPointerType() const { return false; }
- void BruteForceSetPointer(bbtk::UserBlackBox*, void*) {}
+ void BruteForceSetPointer(bbtk::AtomicBlackBox*, void*) {}
private:
/// Pointer on the Set method
SetMethodPointerType mSetMethodPointer;
//===========================================================================
- 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<MagicBox,bbtk::Data,bbtk::Data>
+ new bbtk::AtomicBlackBoxTGetFunctor<MagicBox,bbtk::Data,bbtk::Data>
(&MagicBox::bbGetInputIn),
new MagicBoxSetFunctor (&MagicBox::bbSetInputIn) ) );
AddOutputDescriptor
- (new bbtk::UserBlackBoxOutputDescriptor
+ (new bbtk::AtomicBlackBoxOutputDescriptor
(typeid(MagicBoxDescriptor),
"Out","Output data",
- new bbtk::UserBlackBoxTGetFunctor<MagicBox,bbtk::Data,bbtk::Data>
+ new bbtk::AtomicBlackBoxTGetFunctor<MagicBox,bbtk::Data,bbtk::Data>
(&MagicBox::bbGetOutputOut),
new MagicBoxSetFunctor (&MagicBox::bbSetOutputOut) ) );
BBTK_END_DESCRIBE_BLACK_BOX(MagicBox);
+ //===========================================================================
+
}
// 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()
{
#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);
};
- 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);
}
<blackbox name="MultipleInputs">
<author>laurent.guigues@creatis.insa-lyon.fr</author>
- <description>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.</description>
+ <description>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.</description>
<category>misc</category>
- <parentblackbox>bbtk::UserBlackBox</parentblackbox>
+ <parentblackbox>bbtk::AtomicBlackBox</parentblackbox>
<package>std</package>
<namespace>bbstd</namespace>
#ifndef __bbstdRelay_h_INCLUDED_H__
#define __bbstdRelay_h_INCLUDED_H__
-#include "bbtkUserBlackBox.h"
+#include "bbtkAtomicBlackBox.h"
namespace bbstd
{
+ //=======================================================================
template <class T>
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<T>()+"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<T>());
+ 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
{
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()
{
#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);
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
//====================================================================
BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION(StringTo,
- bbtk::UserBlackBox);
+ bbtk::AtomicBlackBox);
//====================================================================
//====================================================================
#ifndef __bbstdStringTo_h_INCLUDED__
#define __bbstdStringTo_h_INCLUDED__
-#include "bbtkUserBlackBox.h"
+#include "bbtkAtomicBlackBox.h"
namespace bbstd
{
//=================================================================
- // UserBlackBox declaration
+ // BlackBox declaration
template <class T>
- 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<T>());
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<T>());
- 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<T>()
+ +" ("+bbtk::TypeName<T>()+")");
+ BBTK_TEMPLATE_INPUT(StringTo, In,"Input",std::string);
+ BBTK_TEMPLATE_OUTPUT(StringTo, Out,"Output",T);
BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(StringTo);
//=================================================================
{
//====================================================================
BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION(StringToVector,
- bbtk::UserBlackBox);
+ bbtk::AtomicBlackBox);
//====================================================================
#ifndef __bbstdStringToVector_INCLUDED_h__
#define __bbstdStringToVector_INCLUDED_h__
-#include "bbtkUserBlackBox.h"
+#include "bbtkAtomicBlackBox.h"
namespace bbstd
{
-//=================================================================
-// UserBlackBox declaration
-template <class T>
-class StringToVector : public bbtk::UserBlackBox
-{
- BBTK_USER_BLACK_BOX_INTERFACE(StringToVector,bbtk::UserBlackBox);
+ //=================================================================
+ // BlackBox declaration
+ template <class T>
+ 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<T>);
- 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<std::vector<T> >());
+ BBTK_NAME("StringTo"+bbtk::HumanTypeName<std::vector<T> >());
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<std::vector<T> >());
- BBTK_TEMPLATE_INPUT(StringToVector, In,"Input",std::string);
- typedef std::vector<T> Tvector;
- BBTK_TEMPLATE_OUTPUT(StringToVector, Out,"Output",Tvector);
+ BBTK_DESCRIPTION("Converts the content of the input string to a "
+ +bbtk::TypeName<std::vector<T> >()
+ +" ("<<bbtk::TypeName<std::vector<T> >()+")");
+ BBTK_TEMPLATE_INPUT(StringToVector, In,"Input",std::string);
+ typedef std::vector<T> Tvector;
+ BBTK_TEMPLATE_OUTPUT(StringToVector, Out,"Output",Tvector);
BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(StringToVector);
-
-//=================================================================
-
-template <class T>
-void StringToVector<T>::DoIt()
-{
- // std::cout << "StringToVector<"<<bbtk::TypeName<T>()<<">::DoIt()"<<std::endl;
-
- typedef T type;
- std::string delimiters(" ,;");
- std::string str(bbGetInputIn());
- // std::cout << "'"<< str << "'"<<std::endl;
- // Skip delimiters at beginning.
- std::string::size_type lastPos = str.find_first_not_of(delimiters, 0);
- // Find first "non-delimiter".
- std::string::size_type pos = str.find_first_of(delimiters, lastPos);
- bbmOutputOut.clear();
- while (std::string::npos != pos || std::string::npos != lastPos)
- {
- // Found a token, add it to the vector.
- bbmOutputOut.push_back(
- this->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 <class T>
+ void StringToVector<T>::DoIt()
+ {
+ // std::cout << "StringToVector<"<<bbtk::TypeName<T>()<<">::DoIt()"<<std::endl;
+
+ typedef T type;
+ std::string delimiters(" ,;");
+ std::string str(bbGetInputIn());
+ // std::cout << "'"<< str << "'"<<std::endl;
+ // Skip delimiters at beginning.
+ std::string::size_type lastPos = str.find_first_not_of(delimiters, 0);
+ // Find first "non-delimiter".
+ std::string::size_type pos = str.find_first_of(delimiters, lastPos);
+ bbmOutputOut.clear();
+ while (std::string::npos != pos || std::string::npos != lastPos)
+ {
+ // Found a token, add it to the vector.
+ bbmOutputOut.push_back(
+ this->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__
//====================================================================
BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION(ToString,
- bbtk::UserBlackBox);
+ bbtk::AtomicBlackBox);
//====================================================================
//====================================================================
#ifndef __bbstdToString_h_INCLUDED__
#define __bbstdToString_h_INCLUDED__
-#include "bbtkUserBlackBox.h"
+#include "bbtkAtomicBlackBox.h"
namespace bbstd
{
//=================================================================
- // UserBlackBox declaration
+ // BlackBox declaration
template <class T>
- 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<T>()+"ToString");
+ BBTK_NAME(bbtk::HumanTypeName<T>()+"ToString");
BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
BBTK_CATEGORY("adaptor");
BBTK_DEFAULT_ADAPTOR();
- BBTK_DESCRIPTION("Converts a "+bbtk::TypeName<T>()+" into a string");
- BBTK_TEMPLATE_INPUT(ToString, In,"Input",T);
- BBTK_TEMPLATE_OUTPUT(ToString, Out,"Output",std::string);
+ BBTK_DESCRIPTION("Converts a "+bbtk::HumanTypeName<T>()+" ("
+ +bbtk::TypeName<T>()+") 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);
//=================================================================
{
//====================================================================
BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION(VectorToString,
- bbtk::UserBlackBox);
+ bbtk::AtomicBlackBox);
//====================================================================
#ifndef __bbstdVectorToString_INCLUDED_h__
#define __bbstdVectorToString_INCLUDED_h__
-#include "bbtkUserBlackBox.h"
+#include "bbtkAtomicBlackBox.h"
namespace bbstd
{
//=================================================================
- // UserBlackBox declaration
+ // BlackBox declaration
template <class T>
- 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<T>);
BBTK_DECLARE_INPUT(Separator,std::string);
BBTK_DECLARE_OUTPUT(Out,std::string);
void DoIt();
virtual void bbUserConstructor();
};
-
//=================================================================
- // UserBlackBox description
+ //=================================================================
+ // BlackBox description
BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(VectorToString);
BBTK_NAME(bbtk::TypeName<std::vector<T> >()+"ToString");
BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
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 <class T>
void VectorToString<T>::DoIt()
{
}
bbSetOutputOut(out);
}
-
//=================================================================
-
+
+ //=================================================================
template <class T>
void VectorToString<T>::bbUserConstructor()
{
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
//=================================================================
-// UserBlackBox description
+// BlackBox description
BBTK_BEGIN_DESCRIBE_BLACK_BOX(Notebook,bbtk::WxBlackBox);
BBTK_NAME("Notebook");
BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr");
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
//=================================================================
-// UserBlackBox description
+// BlackBox description
BBTK_BEGIN_DESCRIBE_BLACK_BOX(Sizer,bbtk::WxBlackBox);
BBTK_NAME("Sizer");
BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr");
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
//=================================================================
-// UserBlackBox description
+// BlackBox description
BBTK_BEGIN_DESCRIBE_BLACK_BOX(Split,bbtk::WxBlackBox);
BBTK_NAME("Split");
BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");