- * \brief Class bbtk::BlackBoxInputOutputDescriptor : abstract descriptor of an input or an output of a black box (has a name, a description and type)
+ * \brief Class bbtk::BlackBoxInputOutputDescriptor : abstract descriptor of an input or an output of a black box (has a name, description, type and nature)
*/
/**
* \class bbtk::BlackBoxInputOutputDescriptor
- * \brief Abstract descriptor of an input or an output of a black box (has a name, a description and type)
+ * \brief Abstract descriptor of an input or an output of a black box (has a name, description, type and nature)
* Data is bbtk general type exchanged between black boxes (adapted from boost::any).
- * TypeInfo is the bbtk type of object storing informations on a data type (typedef on std::type_info).
+ * DataInfo is the bbtk type of object storing informations on a data type : includes C++ type info (std::type_info) and a string describing the "nature" of the data (what is the content of the structure).
*/
#ifndef __bbtkData_h__
#define __bbtkData_h__
-//#include "bbtkSystem.h"
-//#include "bbtkMessageManager.h"
-//#include <string>
-//#include <typeinfo>
-
-//#include "bbtkany.h"
-
-//#include "bbtkReferenceCountedObject.h"
#include "bbtkAny.h"
+#include "bbtkRTTI.h"
namespace bbtk
{
+ /// The generic type of "data" exchanged between black boxes
typedef any<thing> Data;
- /*
-
- /// Can transport any kind of data (adaptation of boost::any)
+ /// Object storing informations on a data type : includes C++ type info (std::type_info) and a string describing the "nature" of the data (what is the content of the structure)
info.help = "Connects the ouput <output> of black box <box1> to the input <input> of black box <box2>";
- mCommandDict[info.category] = info;
+ mCommandDict[info.keyword] = info;
- info.category = "print";
+ info.keyword = "print";
info.argmin = 1;
info.argmax = 1;
info.code = cPrint;
info.syntax = "print <string>";
info.help = "Prints the string. Substitutes any token of the form '$box.output$' by the string adaptation of the output of the box (requires the right adaptor). No carriage return is issued at the end, use '\\n' to add carriage returns. The level of 'Echo' messages must be greater than 1 (see the command 'message').";
- info.help = "Executes the black box of name <box> (and connected boxes if needed). If the special category 'freeze' is given then freezes any further execution command. 'unfreeze' reverts to normal execution mode.";
- mCommandDict[info.category] = info;
+ info.help = "Executes the black box of name <box> (and connected boxes if needed). If the special keyword 'freeze' is given then freezes any further execution command. 'unfreeze' reverts to normal execution mode.";
+ mCommandDict[info.keyword] = info;
- info.category = "package";
+ info.keyword = "package";
info.argmin = 1;
info.argmax = 1;
info.code = cPackage;
info.syntax = "package <name>";
info.help = "Begins the definition of a package.";
- mCommandDict[info.category] = info;
+ mCommandDict[info.keyword] = info;
- info.category = "endpackage";
+ info.keyword = "endpackage";
info.argmin = 0;
info.argmax = 0;
info.code = cEndPackage;
info.syntax = "endpackage";
info.help = "Ends the definition of a package.";
- mCommandDict[info.category] = info;
+ mCommandDict[info.keyword] = info;
- info.category = "define";
+ info.keyword = "define";
info.argmin = 1;
info.argmax = 2;
info.code = cDefine;
info.syntax = "define <type> [<package>]";
info.help = "Begins the definition of a new type of complex black box called <type>. If <package> if provided will create it in the given package.";
- mCommandDict[info.category] = info;
+ mCommandDict[info.keyword] = info;
- info.category = "endefine";
+ info.keyword = "endefine";
info.argmin = 0;
info.argmax = 0;
info.code = cEndDefine;
info.syntax = "endefine";
info.help = "Ends the definition of a new type of complex black box";
+ info.help = "Sets the kind of the currently defined complex black box";
+ mCommandDict[info.keyword] = info;
+
+ info.keyword = "input";
info.argmin = 3;
info.argmax = 3;
info.code = cInput;
info.syntax = "input <name> <box.input> <help>";
info.help = "Defines the input <name> of the current working black box as being an alias for the input <input> of the black box <box>. <help> defines the help string for the newly created input";
info.help = "Defines the output <name> of the current working black box as being an alias for the output <output> of the black box <box>. <help> defines the help string for the newly created output";
- mCommandDict[info.category] = info;
+ mCommandDict[info.keyword] = info;
- info.category = "set";
+ info.keyword = "set";
info.argmin = 2;
info.argmax = 2;
info.code = cSet;
info.syntax = "set <box.input> <value>";
info.help = "Sets the value of the input <input> of the black box <box> to <value>. There must exist a string to the value type adaptor";
- mCommandDict[info.category] = info;
+ mCommandDict[info.keyword] = info;
- info.category = "config"; // JPR
+ info.keyword = "config"; // JPR
info.argmin = 0;
info.argmax = 0;
info.code = cConfig;
info.syntax = "config";
info.help = "Prints the value of all configuration parameters";
info.help = "Creates an html index of known boxes. If filename is provided then save it to the file 'filename'. The default index entries are the initial letters of the names of the boxes. If 'Packages' or 'Categories' is provided then the entries are either the packages names or the categories. If 'Adaptors' is provided then an alphabetical index of all adaptors is created.";
- mCommandDict[info.category] = info;
+ mCommandDict[info.keyword] = info;
- info.category = "reset";
+ info.keyword = "reset";
info.argmin = 0;
info.argmax = 0;
info.code = cReset;
info.syntax = "reset";
info.help = "Deletes all boxes and unloads all packages (bbi is reset to its start state)";
- mCommandDict[info.category] = info;
+ mCommandDict[info.keyword] = info;
- info.category = "author";
+ info.keyword = "author";
info.argmin = 1;
info.argmax = 1;
info.code = cAuthor;
info.syntax = "author <string>";
info.help = "Adds the string <string> to the author information of the black box being defined";
- mCommandDict[info.category] = info;
+ mCommandDict[info.keyword] = info;
- info.category = "category"; //JP
+ info.keyword = "category"; //JP
info.argmin = 1;
info.argmax = 1;
info.code = cCategory;
info.syntax = "category <list of items, separated by ;>";
info.help = "Adds the string <string> to the category information of the black box being defined";
- mCommandDict[info.category] = info;
+ mCommandDict[info.keyword] = info;
- info.category = "description";
+ info.keyword = "description";
info.argmin = 1;
info.argmax = 1;
info.code = cDescription;
info.syntax = "description <string>";
info.help = "Adds the string <string> to the descriptive information of the black box being defined";
- mCommandDict[info.category] = info;
+ mCommandDict[info.keyword] = info;
- info.category = "help";
+ info.keyword = "help";
info.argmin = 0;
info.argmax = 2;
info.code = cHelp;
info.syntax = "help";
info.syntax = "\n (1) help \n (2) help <command name> \n (3) help packages [all]\n (4) help <package name> [all]\n (5) help <black box type> \n (6) help <black box name>";
info.help = "Effect :\n (1) Lists all available commands;\n (2) Prints help on a particular command; \n (3) Lists the packages loaded and their black boxes.\n Add 'all' to list adaptors; \n (4) Prints short help on the black boxes of a package.\n Add 'all' to include adaptors; \n (5) Prints full help on a black box type; \n (6) Prints information on the inputs, outputs and connections of a black box instance.";
- mCommandDict[info.category] = info;
+ mCommandDict[info.keyword] = info;
- info.category = "message";
+ info.keyword = "message";
info.argmin = 0;
info.argmax = 2;
info.code = cMessage;
info.syntax = "message <kind> <level>";
- info.help = "Sets the level of the kind of messages <kind> to <level>.\n If kind='All' then sets the level for all kinds. If no kind nor level is passed then prints info on available kinds of messages and their current level."; mCommandDict[info.category] = info;
+ info.help = "Sets the level of the kind of messages <kind> to <level>.\n If kind='All' then sets the level for all kinds. If no kind nor level is passed then prints info on available kinds of messages and their current level."; mCommandDict[info.keyword] = info;
- info.category = "include";
+ info.keyword = "include";
info.argmin = 1;
info.argmax = 2;
info.code = cInclude;
info.syntax = "include <filename> [source]";
info.help = "Includes the file <filename>.\n 'source' : If the keyword 'source' is provided then informs bbi that the included file is the source of the current box definition (Advanced; used to get the right 'Include' field in html doc of packages 'appli' scripts).";
- mCommandDict[info.category] = info;
+ mCommandDict[info.keyword] = info;
- info.category = "quit";
+ info.keyword = "quit";
info.argmin = 0;
info.argmax = 0;
info.code = cQuit;
info.syntax = "quit";
info.help = "Quits the program (during script execution it stops the complete execution)";
- mCommandDict[info.category] = info;
+ mCommandDict[info.keyword] = info;
- info.category = "load";
+ info.keyword = "load";
info.argmin = 1;
info.argmax = 1;
info.code = cLoad;
info.syntax = "load <packagename>";
info.help = "Loads the black box package <packagename>";
- mCommandDict[info.category] = info;
+ mCommandDict[info.keyword] = info;
- info.category = "unload";
+ info.keyword = "unload";
info.argmin = 1;
info.argmax = 1;
info.code = cUnload;
info.syntax = "unload <packagename>";
info.help = "Unloads the black box package <packagename>";
info.help = "Shows a graphical view of a bbtk pipeline.\n- BlackBoxName : name of the box to view. Default '.' : current box.\n- BlackBoxNameType : name of the type of box to view, ex : 'workspace')";
info.help = "Configures the workspace.\n 'freeze' allow to block execution commands while keeping definition commands active. 'unfreeze' turns back the worspace in 'normal' mode.\n 'rename' allow to set a new name to the workspace.";
+ bbtkDebugMessage("Kernel",8,"Package<"<<GetName()<<">::RegisterBlackBox(\""<<d->GetTypeName()<<"\") : The box is an adaptor, inserting it in adaptors map ..."<<std::endl);
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_DESCRIPTION("Creates three 3D planes with the input image mapped onto with which the user can interact. The output vtkImagePlaneWidget objects are to be inserted into a 3D scene (e.g. a Viewer3D)");
BBTK_DESCRIPTION("Creates a Maximum Intensity Projection (MIP) view of a 3D image. Creates a vtkProp3D object to insert into a 3D scene (e.g. a Viewer3D)");
- BBTK_INPUT(CommandButton,In,"Commands to be executed separated by commas (;). Each single quote (') is replaced by a double quote (\").",std::string);
- BBTK_INPUT(CommandButton,Label,"Label of the button",std::string);
- BBTK_INPUT(CommandButton,Colour,"Colour of the button (-1 -1 -1 Background)",vectorcolour);
+ BBTK_INPUT(CommandButton,In,"Commands to be executed separated by commas (;). Each single quote (') is replaced by a double quote (\").",std::string,"");
+ BBTK_INPUT(CommandButton,Label,"Label of the button",std::string,"");
+ BBTK_INPUT(CommandButton,Colour,"Colour of the button (-1 -1 -1 Background)",vectorcolour,"color");