--- /dev/null
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /tmpEED/creaTools/creatools_source/bbtk/packages/std/bbs/appli/exampleSetElementVector.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
+BOXES:5
+BOX
+std:GetVectorStringPointer:Box01
+ISEXEC:FALSE
+6.522014:14.475352:-900.000000
+77.697014:4.475352:-900.000000
+PORT
+In:"A B C D E"
+FIN_BOX
+BOX
+std:SetElementVectorVectorString:Box02
+ISEXEC:FALSE
+-11.680621:-19.993209:-900.000000
+59.494379:-29.993209:-900.000000
+PORT
+I:"2"
+PORT
+Value:"2"
+FIN_BOX
+BOX
+wx:OutputText:Box03
+ISEXEC:FALSE
+-54.917469:-70.666633:-900.000000
+-9.342469:-80.666633:-900.000000
+FIN_BOX
+BOX
+wx:LayoutSplit:Box04
+ISEXEC:TRUE
+-73.506336:-93.307343:-900.000000
+-27.931336:-103.307343:-900.000000
+FIN_BOX
+BOX
+wx:Slider:Box05
+ISEXEC:FALSE
+-59.907189:56.689901:-900.000000
+-8.507189:46.689901:-900.000000
+PORT
+ReactiveOnTrack:"true"
+FIN_BOX
+CONNECTIONS:7
+CONNECTION
+Box05:Widget:Box04:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box05:BoxChange:Box03:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box05:BoxChange:Box02:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box05:Out:Box02:Value
+NumberOfControlPoints:0
+CONNECTION
+Box03:Widget:Box04:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box01:PVec:Box02:PVec
+NumberOfControlPoints:0
+CONNECTION
+Box02:Vec:Box03:In
+NumberOfControlPoints:0
+APP_END
--- /dev/null
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /tmpEED/creaTools/creatools_source/bbtk/packages/std/bbs/appli/exampleSetElementVector.bbs
+# ----------------------------------
+
+# BBTK GEditor Script
+# ----------------------
+
+include std
+include itkvtk
+include std
+include wx
+
+author "Author ??"
+description "Description ??"
+category "<VOID>"
+
+new std:GetVectorStringPointer Box01
+ set Box01.In "A B C D E"
+
+new std:SetElementVectorVectorString Box02
+ set Box02.I "2"
+ set Box02.Value "2"
+
+new wx:OutputText Box03
+
+new wx:LayoutSplit Box04
+
+new wx:Slider Box05
+ set Box05.ReactiveOnTrack "true"
+
+
+connect Box05.Widget Box04.Widget1
+
+connect Box05.BoxChange Box03.BoxExecute
+
+connect Box05.BoxChange Box02.BoxExecute
+
+connect Box05.Out Box02.Value
+
+connect Box03.Widget Box04.Widget2
+
+connect Box01.PVec Box02.PVec
+
+connect Box02.Vec Box03.In
+
+
+
+# Complex input ports
+exec Box04
--- /dev/null
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ # pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ # This software is governed by the CeCILL-B license under French law and
+ # abiding by the rules of distribution of free software. You can use,
+ # modify and/ or redistribute the software under the terms of the CeCILL-B
+ # license as circulated by CEA, CNRS and INRIA at the following URL
+ # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ # or in the file LICENSE.txt.
+ #
+ # As a counterpart to the access to the source code and rights to copy,
+ # modify and redistribute granted by the license, users are provided only
+ # with a limited warranty and the software's author, the holder of the
+ # economic rights, and the successive licensors have only limited
+ # liability.
+ #
+ # The fact that you are presently reading this means that you have had
+ # knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+/*=========================================================================
+ Program: bbtk
+ Module: $RCSfile: bbstdGetVectorElement.cxx,v $
+ Language: C++
+ Date: $Date: 2012/11/16 08:51:32 $
+ Version: $Revision: 1.4 $
+=========================================================================*/
+
+
+#include "bbstdGetVectorPointer.h"
+#include "bbstdPackage.h"
+
+
+namespace bbstd
+{
+ //====================================================================
+ BBTK_BLACK_BOX_TEMPLATE_IMPLEMENTATION(GetVectorPointer,
+ bbtk::AtomicBlackBox);
+ //====================================================================
+
+//====================================================================
+// Add the specialized boxes to the package
+
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetVectorPointer,int8_t);
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetVectorPointer,uint8_t);
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetVectorPointer,int16_t);
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetVectorPointer,uint16_t);
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetVectorPointer,int32_t);
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetVectorPointer,uint32_t);
+///\todo : diff between uint32_t and long?
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetVectorPointer,long);
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetVectorPointer,float);
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetVectorPointer,double);
+typedef std::string string;
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetVectorPointer,string);
+//====================================================================
+
+} // namespace bbstd
--- /dev/null
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ # pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ # This software is governed by the CeCILL-B license under French law and
+ # abiding by the rules of distribution of free software. You can use,
+ # modify and/ or redistribute the software under the terms of the CeCILL-B
+ # license as circulated by CEA, CNRS and INRIA at the following URL
+ # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ # or in the file LICENSE.txt.
+ #
+ # As a counterpart to the access to the source code and rights to copy,
+ # modify and redistribute granted by the license, users are provided only
+ # with a limited warranty and the software's author, the holder of the
+ # economic rights, and the successive licensors have only limited
+ # liability.
+ #
+ # The fact that you are presently reading this means that you have had
+ # knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+/*=========================================================================
+ Program: bbtk
+ Module: $RCSfile: bbstdGetVectorElement.h,v $
+ Language: C++
+ Date: $Date: 2012/11/16 08:51:32 $
+ Version: $Revision: 1.9 $
+=========================================================================*/
+
+
+#ifndef __bbstdGetVectorPointer_INCLUDED_h__
+#define __bbstdGetVectorPointer_INCLUDED_h__
+
+#include "bbtkAtomicBlackBox.h"
+#include "bbstd_EXPORT.h"
+
+namespace bbstd
+{
+ //=================================================================
+ // BlackBox declaration
+ template <class T>
+ class bbstd_EXPORT GetVectorPointer : public bbtk::AtomicBlackBox
+ {
+ BBTK_TEMPLATE_BLACK_BOX_INTERFACE(GetVectorPointer,bbtk::AtomicBlackBox,T);
+ BBTK_DECLARE_INPUT(In,std::vector<T>);
+ BBTK_DECLARE_OUTPUT(PVec,std::vector<T>*);
+ BBTK_PROCESS(DoIt);
+ void DoIt();
+ std::vector<T> vec;
+ };
+ //=================================================================
+
+ //=================================================================
+ // BlackBox description
+ BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(GetVectorPointer,bbtk::AtomicBlackBox);
+ BBTK_NAME("Get"+bbtk::HumanTypeName<std::vector<T> >()+"Pointer");
+ BBTK_AUTHOR("info-dev@creatis.insa-lyon.fr");
+ // BBTK_DEFAULT_ADAPTOR();
+ BBTK_DESCRIPTION("Gets the the pointer of the input vector ("+bbtk::TypeName<std::vector<T> >());
+ typedef std::vector<T> Tvector;
+ BBTK_TEMPLATE_INPUT(GetVectorPointer, In,"Input",Tvector);
+// BBTK_TEMPLATE_INPUT(GetVectorPointer, I, "Input",int);
+// BBTK_TEMPLATE_INPUT(GetVectorPointer, ErrorValue, "ErrorValue",T);
+// BBTK_TEMPLATE_OUTPUT(GetVectorPointer,Out,"Output",T);
+ BBTK_TEMPLATE_OUTPUT(GetVectorPointer,PVec,"Output Pointer Vector",std::vector<T>*);
+ BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(GetVectorPointer);
+ //=================================================================
+
+ //=================================================================
+ template <class T>
+ void GetVectorPointer<T>::DoIt()
+ {
+ vec = bbGetInputIn();
+ bbSetOutputPVec( &vec );
+ }
+ //=================================================================
+
+ //=================================================================
+ template <class T>
+ void GetVectorPointer<T>::bbUserSetDefaultValues()
+ {
+
+ }
+ //=================================================================
+ //=================================================================
+ template <class T>
+ void GetVectorPointer<T>::bbUserInitializeProcessing()
+ {
+
+ }
+ //=================================================================
+ //=================================================================
+ template <class T>
+ void GetVectorPointer<T>::bbUserFinalizeProcessing()
+ {
+
+ }
+ //=================================================================
+
+} // namespace bbstd
+
+#endif //__bbstdGetVectorPointer_INCLUDED_h__
+
void MixingVectors::Process()
{
// THE MAIN PROCESSING METHOD BODY
- int size1 = bbGetInputIn1().size();
- int size2 = bbGetInputIn2().size();
- int size3 = bbGetInputIn3().size();
- int size4 = bbGetInputIn4().size();
- int size5 = bbGetInputIn5().size();
- int size6 = bbGetInputIn6().size();
- int size7 = bbGetInputIn7().size();
- int size8 = bbGetInputIn8().size();
- int size9 = bbGetInputIn9().size();
- int size10 = bbGetInputIn10().size();
- std::vector<double> outputVector;
-
- for (int i = 0; i < size1; i++)
- {
+ int size1 = bbGetInputIn1().size();
+ int size2 = bbGetInputIn2().size();
+ int size3 = bbGetInputIn3().size();
+ int size4 = bbGetInputIn4().size();
+ int size5 = bbGetInputIn5().size();
+ int size6 = bbGetInputIn6().size();
+ int size7 = bbGetInputIn7().size();
+ int size8 = bbGetInputIn8().size();
+ int size9 = bbGetInputIn9().size();
+ int size10 = bbGetInputIn10().size();
+ std::vector<double> outputVector;
+ for (int i = 0; i < size1; i++)
+ {
outputVector.push_back( bbGetInputIn1()[i] );
- if (i < size2)
- outputVector.push_back( bbGetInputIn2()[i] );
- if (i < size3)
- outputVector.push_back( bbGetInputIn3()[i] );
- if (i < size4)
- outputVector.push_back( bbGetInputIn4()[i] );
- if (i < size5)
- outputVector.push_back( bbGetInputIn5()[i] );
- if (i < size6)
- outputVector.push_back( bbGetInputIn6()[i] );
- if (i < size7)
- outputVector.push_back( bbGetInputIn7()[i] );
- if (i < size8)
- outputVector.push_back( bbGetInputIn8()[i] );
- if (i < size9)
- outputVector.push_back( bbGetInputIn9()[i] );
- if (i < size10)
- outputVector.push_back( bbGetInputIn10()[i] );
+ if (i < size2) { outputVector.push_back( bbGetInputIn2()[i] ); }
+ if (i < size3) { outputVector.push_back( bbGetInputIn3()[i] ); }
+ if (i < size4) { outputVector.push_back( bbGetInputIn4()[i] ); }
+ if (i < size5) { outputVector.push_back( bbGetInputIn5()[i] ); }
+ if (i < size6) { outputVector.push_back( bbGetInputIn6()[i] ); }
+ if (i < size7) { outputVector.push_back( bbGetInputIn7()[i] ); }
+ if (i < size8) { outputVector.push_back( bbGetInputIn8()[i] ); }
+ if (i < size9) { outputVector.push_back( bbGetInputIn9()[i] ); }
+ if (i < size10) { outputVector.push_back( bbGetInputIn10()[i] ); }
}
-
bbSetOutputOut(outputVector);
}
{
}
-}
-// EO namespace bbstd
+
+} // EO namespace bbstd
--- /dev/null
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ # pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ # This software is governed by the CeCILL-B license under French law and
+ # abiding by the rules of distribution of free software. You can use,
+ # modify and/ or redistribute the software under the terms of the CeCILL-B
+ # license as circulated by CEA, CNRS and INRIA at the following URL
+ # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ # or in the file LICENSE.txt.
+ #
+ # As a counterpart to the access to the source code and rights to copy,
+ # modify and redistribute granted by the license, users are provided only
+ # with a limited warranty and the software's author, the holder of the
+ # economic rights, and the successive licensors have only limited
+ # liability.
+ #
+ # The fact that you are presently reading this means that you have had
+ # knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+/*=========================================================================
+ Program: bbtk
+ Module: $RCSfile: bbstdGetVectorElement.cxx,v $
+ Language: C++
+ Date: $Date: 2012/11/16 08:51:32 $
+ Version: $Revision: 1.4 $
+=========================================================================*/
+
+
+#include "bbstdSetElementVector.h"
+#include "bbstdPackage.h"
+
+
+namespace bbstd
+{
+ //====================================================================
+ BBTK_BLACK_BOX_TEMPLATE_IMPLEMENTATION(SetElementVector,
+ bbtk::AtomicBlackBox);
+ //====================================================================
+
+//====================================================================
+// Add the specialized boxes to the package
+
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,SetElementVector,int8_t);
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,SetElementVector,uint8_t);
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,SetElementVector,int16_t);
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,SetElementVector,uint16_t);
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,SetElementVector,int32_t);
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,SetElementVector,uint32_t);
+///\todo : diff between uint32_t and long?
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,SetElementVector,long);
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,SetElementVector,float);
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,SetElementVector,double);
+typedef std::string string;
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,SetElementVector,string);
+//====================================================================
+
+} // namespace bbstd
--- /dev/null
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ # pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ # This software is governed by the CeCILL-B license under French law and
+ # abiding by the rules of distribution of free software. You can use,
+ # modify and/ or redistribute the software under the terms of the CeCILL-B
+ # license as circulated by CEA, CNRS and INRIA at the following URL
+ # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ # or in the file LICENSE.txt.
+ #
+ # As a counterpart to the access to the source code and rights to copy,
+ # modify and redistribute granted by the license, users are provided only
+ # with a limited warranty and the software's author, the holder of the
+ # economic rights, and the successive licensors have only limited
+ # liability.
+ #
+ # The fact that you are presently reading this means that you have had
+ # knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+/*=========================================================================
+ Program: bbtk
+ Module: $RCSfile: bbstdGetVectorElement.h,v $
+ Language: C++
+ Date: $Date: 2012/11/16 08:51:32 $
+ Version: $Revision: 1.9 $
+=========================================================================*/
+
+
+#ifndef __bbstdSetElementVector_INCLUDED_h__
+#define __bbstdSetElementVector_INCLUDED_h__
+
+#include "bbtkAtomicBlackBox.h"
+#include "bbstd_EXPORT.h"
+
+namespace bbstd
+{
+ //=================================================================
+ // BlackBox declaration
+ template <class T>
+ class bbstd_EXPORT SetElementVector : public bbtk::AtomicBlackBox
+ {
+ BBTK_TEMPLATE_BLACK_BOX_INTERFACE(SetElementVector,bbtk::AtomicBlackBox,T);
+ BBTK_DECLARE_INPUT(PVec,std::vector<T>*);
+ BBTK_DECLARE_INPUT(I,int);
+ BBTK_DECLARE_INPUT(Value,T);
+ BBTK_DECLARE_OUTPUT(Vec,std::vector<T>);
+ BBTK_PROCESS(DoIt);
+ void DoIt();
+ };
+ //=================================================================
+
+ //=================================================================
+ // BlackBox description
+ BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(SetElementVector,bbtk::AtomicBlackBox);
+ BBTK_NAME("SetElementVector"+bbtk::HumanTypeName<std::vector<T> >());
+ BBTK_AUTHOR("info-dev@creatis.insa-lyon.fr");
+ // BBTK_DEFAULT_ADAPTOR();
+ BBTK_DESCRIPTION("Sets the value of the i-element ("+bbtk::TypeName<std::vector<T> >());
+ typedef std::vector<T>* pTvector;
+ BBTK_TEMPLATE_INPUT(SetElementVector, PVec,"Pointer to Vector",pTvector);
+ BBTK_TEMPLATE_INPUT(SetElementVector, I, "id-element",int);
+ BBTK_TEMPLATE_INPUT(SetElementVector, Value, "Input Value",T);
+ BBTK_TEMPLATE_OUTPUT(SetElementVector,Vec,"Output Vector",std::vector<T>);
+ BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(SetElementVector);
+ //=================================================================
+
+ //=================================================================
+ template <class T>
+ void SetElementVector<T>::DoIt()
+ {
+ if ( (bbGetInputI()>=0) && (bbGetInputI()<bbGetInputPVec()->size()) )
+ {
+ (*( bbGetInputPVec() ))[ bbGetInputI() ] = bbGetInputValue();
+ }
+ bbSetOutputVec( *( bbGetInputPVec() ) );
+ bbSignalOutputModification(std::string("Vec"));
+ }
+ //=================================================================
+
+ //=================================================================
+ template <class T>
+ void SetElementVector<T>::bbUserSetDefaultValues()
+ {
+
+ }
+ //=================================================================
+ //=================================================================
+ template <class T>
+ void SetElementVector<T>::bbUserInitializeProcessing()
+ {
+
+ }
+ //=================================================================
+ //=================================================================
+ template <class T>
+ void SetElementVector<T>::bbUserFinalizeProcessing()
+ {
+
+ }
+ //=================================================================
+
+} // namespace bbstd
+
+#endif //__bbstdSetElementVector_INCLUDED_h__
+
template <class T>
void StringVectorToNumericalVector<T>::DoIt()
{
- std::cout << "StringVectorToNumericalVector<"<<bbtk::TypeName<T>()<<">::DoIt() start "<<std::endl;
-
typedef T type;
// \TODO :Affecter bbGetInputIn() à un std::vector<std::string> // recopie? // JPR
//std::vector<std::string> vect (bbGetInputIn() );
+ bbmOutputOut.clear();
+
// get a std::string, add it to the <std::vector< >>
int lgt=bbGetInputIn().size();
for (int i=0; i<lgt; i++)
//EED }
// end just to see // JPR
- std::cout << "StringVectorToNumericalVector<"<<bbtk::TypeName<T>()<<">::DoIt() end "<<std::endl;
-
}
//=================================================================