]> Creatis software - bbtk.git/blob - kernel/doc/bbtkUsersGuide/bbtkUsersGuide.tex
c55eb58222bbbe55257c1bea079edd33027859ce
[bbtk.git] / kernel / doc / bbtkUsersGuide / bbtkUsersGuide.tex
1 % ==========================================
2 \documentclass[11pt,final,a4paper]{article}
3 \input{config.tex}
4
5
6
7 \begin{document}
8
9 \begin{center}
10
11 {\Large \BBTK}
12 \vspace{1cm}
13
14 {\Huge User's Guide}
15 \vspace{1cm}
16
17 \bbtk version \bbtkVersion
18 \vspace{0.5cm}
19
20
21 Last modified on : October 12, 2008 \\
22 Generated on : \today 
23 \vspace{0.5cm}
24 \end{center}
25 \begin{center}
26 Eduardo Davila, Laurent Guigues, Jean-Pierre Roux 
27 \end{center}
28 \begin{center}
29 CREATIS-LRMN, Centre de Recherche en Imagerie Medicale \\ CNRS UMR 5220, INSERM U620\\
30 INSA Lyon\\
31 Universit\'e Claude-Bernard Lyon 1
32 \end{center}
33
34 % ==========================================
35 \tableofcontents
36 % ==========================================
37
38 \listoftables
39
40 \listoffigures
41
42
43
44 % ==========================================
45 %\section*{Abstract}
46 % ==========================================
47 \newpage
48 % ==========================================
49 \hrule
50 \section{What is bbtk ?}
51 % ==========================================
52 \BBTK(\bbtkns) is a set of tools 
53 (\CPP libraries and executables) 
54 providing a \CPP framework for the definition 
55 of elementary processing \emph{units}, called {\bf black boxes}, 
56 and the definition and execution of processing \emph{chains} 
57 made up of these black boxes. \\
58 It's a part of the \texttt{Creatools suite} composed mainly of :
59 \begin{verbatim}
60  bbtk
61  creaContours
62  creaImageIO
63  creaLib
64  
65 \end{verbatim}
66 which depend on the OpenSource libraries: 
67 \begin{verbatim}
68  gdcm 
69  itk
70  vtk
71  wxWidgets
72 \end{verbatim}
73
74 % ==========================================
75 \subsection{The black box philosophy}
76 % ==========================================
77
78 \href{http://www.answers.com/topic/black-box-theater}{The Answers Dictionary} defines a {\bf black box} as 
79 \emph{``A device or theoretical construct with known or specified performance characteristics 
80 but unknown or unspecified constituents and means of operation''} \\
81 \href{http://en.wikipedia.org/wiki/Black_box_\%28disambiguation\%29}{Wikipedia}
82 defines a {\bf black box} as 
83 \emph{``any component in a system in which only the input and output 
84 characteristics are of interest, without regard to its internal mechanism 
85 or structure''}. \\
86 We should merge theese definitions. : 
87 not only the inputs and outputs are of interest but also 
88 \emph{what the box does} !
89 Hence, I would say that a black box is any \emph{\bf documented} 
90 component of a system, letting the user know  
91 \emph{\bf what} the box is supposed to do and 
92 \emph{\bf how to use it}
93 but not \emph{\bf how it does it}. \\
94
95 \BBTK provides a systematic framework 
96 to encapsulate (or ``wrap'') any 
97 existing \texttt{C} or \CPP processing code into an object 
98 (a black box) having a {\bf generic symbolic interface}, where 
99
100 \begin{itemize}
101 \item{\bf generic} means that the interface is \emph{the same} 
102 for all boxes. Hence one does not need to know which particular 
103 method allows, say, to set a particular input or 
104 get a particular output of the box. 
105 One can use a black box in a purely abstract way. 
106 \item{\bf symbolic} means that a particular 
107 input or output is referenced by a 'name', that is by a symbol 
108 which identifies the input or output. 
109 It also means that symbolic information (text) is 
110 attached to a box: description of the box, author, 
111 description of its inputs and outputs, etc.
112 \end{itemize}
113
114 (Actually, genericity is achieved because the interface is symbolic. 
115 We let you think about this\dots)
116
117 Of course, symbolic data attached to a box may be 
118 {\bf queried} : what are the inputs/outputs of the box ? 
119 what are their type ? their description ? etc.
120 This allows {\bf automatic documentation} of boxes. 
121
122 The abstract definition of black boxes is the most basic 
123 aspect of \BBTK architecture. 
124 Another key aspect is the groupement of black boxes into 
125 so called {\bf packages}, 
126 which are \emph{dynamic libraries} which can also 
127 be queried, in particular about the boxes they provide. 
128 The package structure then offers a mechanism which 
129 is like a \emph{'plug-in'} mechanism.
130 \BBTK provides the methods to load a package at run-time, 
131 and create instances of the boxes it contains. 
132
133 These two mechanisms (black boxes and packages) 
134 then gives the way to:
135
136 \begin{itemize}
137 \item The definition of an {\bf interpreted script language}, 
138 which allows to manipulate packages and boxes very easily in symbolic way. 
139 \BBTK provides one : \bbi (the Black Box Interpreter). 
140 \item {\bf Automatic documentation} of existing packages. 
141 \texttt{html} documentation of packages is proposed by 
142 \bbStudions.
143 \end{itemize}
144
145 Finally, these different components allow {\bf efficient} :
146
147 \begin{itemize}
148 \item {\bf capitalization and reuse} of existing processing units, 
149 including {\bf documentation} 
150 \item {\bf testing, prototyping} in a very simple script language
151 \item {\bf inter-operability} between atomic processings which 
152 have been written by different persons, using different libraries, etc. 
153 \end{itemize}
154
155 % ==========================================
156 \subsection{\bbtk components}
157 % ==========================================
158 \BBTK includes :
159 \begin{itemize}
160   \item A \CPP {\bf\emph{library}} - called \bbtk - which defines a framework 
161     (abstract classes) to develop black boxes and store them into 
162     dynamic libraries, called black box \emph{packages}.
163   \item Different {\bf\emph{black box packages}} :
164     \begin{itemize}
165       \item {\bf\emph{std}} : the 'standard' package including basic useful boxes.
166       \item {\bf\emph{wx}} : basic graphical interface elements (widgets : sliders, buttons, etc. based on the \texttt{wxWidgets} library).  
167       \item {\bf\emph{itk}} : the basic image processing package, based on the \itk library.
168       \item {\bf\emph{vtk}} : the basic images and surfaces processing and visualization package, based on the \vtk library.
169       \item {\bf\emph{wxvtk}} : widget boxes based on the \vtk library (2D and 3D vizualization and
170       interaction).
171       %\item {\bf\emph{creaImageIO}} : Provides hight level widgets to read images, including DICOM.
172       \item {\bf\emph{toolsbbtk}} : Tools for bbtk administration and package development..      
173     \end{itemize}
174   \item A {\bf\emph{Developement environment}}, called \bbStudio, which provides
175     \begin{itemize}
176       \item An online {\bf\emph{script editor and interpretor}}
177       \item A powerful html {\bf\emph{Help environment}}, integrating :       
178         \begin{itemize}
179           \item Online documentation scaning
180           \item Retreiving boxes on various criterions
181           \item Checking Demo and examples
182         \end{itemize}
183       \end{itemize}
184       \item An standalone {\bf\emph{interpreter}}, called \bbins, which allows to 
185           load black box packages and to define and execute 
186           processing chains by connecting various black boxes.
187       \item {\bf\emph{Various Development Utilities}} :
188          \begin{itemize}
189             \item \bbfy generates the \CPP code of a black box from a 
190                description file written in \texttt{xml}.
191                 %\item \bbdoc generates the html documentation of a black box package 
192                 %(author, description, description of its black boxes : 
193                 %author, description, inputs, outputs, and so on).
194             \item \bbCreatePackage allows to create the basic file architecture 
195                to start the development of a new black box package.
196             \item \text{bbCreateBlackbox} allows to create the basic file architecture 
197                to start the development of a new black box, that will be included in an already existing package.              
198             \item \texttt{bbs2cpp} translates a \texttt{.bbs} script into a \CPP file.
199             \item \texttt{bbc} that interprets (i.e. : executes) a \texttt{.bbs} script.                  
200          \end{itemize}
201       \item A full {\bf\emph{documentation}} printable (pdf), browsable (html),
202       queryable throught keywords.        
203 \end{itemize}
204
205 The general architecture of \BBTK 
206 is shown in figure \ref{bb-architecture}.
207
208 \begin{figure}[!ht]
209 \caption{\label{bb-architecture}\BBTK architecture}
210 \begin{center}
211 \includegraphics[width=0.6\textwidth]{bb-architecture.png}
212 \end{center}
213 \end{figure}
214
215 \newpage
216
217 % ==========================================
218 \section{Getting started with bbStudio}
219 % ==========================================
220
221 % ==========================================
222 % ==========================================
223 % ==========================================
224 % ==========================================
225 % ==========================================
226 % ==========================================
227
228 % ==========================================
229 \subsection{The interface}
230 % ==========================================
231
232
233 %\vspace{0.5cm}\hrule
234 %\section{The Development environment (bbStudio)}
235 %\label{bbStudio}
236
237 Just run it, typing in a console \bbStudio 
238 or clicking on its icon or its menu entry.
239 At start, \bbStudio opens with a very minimal 'How to use' in the middle. \\
240 Don't forget to read it : it will vanish at the first mouse click. \\
241 \begin{verbatim}
242 1) Click on the 'Demo' or 'Examples' link.
243 2) Select a Demo or an Example
244 3) Click on the [Source] link : the source file is loaded in bbStudio
245 4) Click on the 'Run button' (the down arrow at the bottom right
246    of the source file).
247 \end{verbatim}
248
249 You'll get something like in figure 
250 \ref{bbi-fig-bbStudio-gui-start}
251 (the exact appearance of \bbStudio is Operating System and \bbtk version dependent)
252
253 \newpage
254
255
256 \begin{figure}[!ht]
257 \caption{\label{bbi-fig-bbStudio-gui-start}The bbStudio Development environment interface at start time}
258 \begin{center}
259 \includegraphics[width=0.7\textwidth]{bbStudioMainPageStart.png}
260 \end{center}
261 \end{figure}
262
263
264 Feel free to resize any part you want.
265 Your preferences will be kept next time you run again \bbStudio. \\
266
267 Let's have a look at the resized window :
268
269 \begin{figure}[!ht]
270 \caption{\label{bbi-fig-bbStudio-gui}The bbStudio Development environment interface}
271 \begin{center}
272 \includegraphics[width=0.7\textwidth]{bbStudioMainPage.png}
273 \end{center}
274 \end{figure}
275
276 You can see four parts : \texttt{Files}, \texttt{Messages},
277  \texttt{Command}, \texttt{Help}.\\
278
279 The stuff is written using the Advanced User Interface library of wxWidgets
280 (a.k.a. AUI),
281 whose 'docking manager' allows windows and toolbars to be floated/docked 
282 onto a frame.\\
283 Please don't use this feature at learning time (the snapshots of this document
284  wouldn't match with your screen ...)
285
286 \subsubsection{'Files' part}
287 \label{bbi-FilesPart}
288
289 It's the .bbs script editor.\\
290 If you load a file holding a script, it will be displayed here, and you'll be
291 able to modify it, to save it, to save-as it, to run it, using the
292 lower toolbar (see figure : \ref{lowertoolbar})
293
294 \begin{figure}[!ht]
295 \caption{\label{lowertoolbar}The lower tool bar}
296 \begin{center}
297 \includegraphics[width=0.7\textwidth]{lowertoolbar2.png}
298 \end{center}
299 \end{figure}
300
301
302 % \begin{itemize}
303 %   \item {\bf\emph{New file}} : Create a new file to hold a script
304 %   \item {\bf\emph{Open file}} : Open an already existing file holding a script 
305 %   \item {\bf\emph{Close file}} : Close a file holding a script
306 %   \item {\bf\emph{Save file}} : Save he current file (if modified)
307 %   \item {\bf\emph{Save file as}} : Save he current file under a different name
308 %   \item {\bf\emph{Run file}} : Execute the script you just loaded/modified/written
309 %   \item {\bf\emph{cursor position}} : column number : line number   
310 % \end{itemize}
311
312
313 \subsubsection{'Messages' part}
314 \label{bbi-MessagesPart}
315
316 Two kinds of messages will be output here:\\
317 System messages : produced by the kernel, in case of a user mistyping, or an execution error\\
318 Script messages : produced by the \bbtk equivalent of \texttt{printf} 
319 or \texttt{std::cout} in user programs
320
321 \subsubsection{'Command' part}
322 \label{bbi-CommandPart}
323
324 This is where user will type his requirements.
325
326 \subsubsection{'Help Contents' part}
327 \label{bbi-HelpContentsPart}
328
329 The 'Help Contents' part of \bbStudio is used to browse the html help of \BBTK.
330 All the entries of the starting page are self-explanatory :
331  \begin{itemize}
332    \item {\bf\emph{Help Contents}}
333    \begin{itemize}
334      %\item {\bf\emph{Wiki}} : Direct link to the bbtk Wiki (intranet only, right now, www
335      %later).
336      \item {\bf\emph{Demo}} : Link to some 'sophisticated' demonstrations.
337      \item {\bf\emph{Examples}} : Link to some detailed 'How to use' examples
338    \end{itemize}
339    
340    \item {\bf\emph{Guides}}   
341    \begin{itemize}      
342      \item {\bf\emph{User's Guide}} : Step to step How-to for user who wants to create his own
343      application, just using already existing boxes.
344      \item {\bf\emph{Package Developper's Guide}} : Step to step How-to for user who wants to create his own
345      black boxes.
346      \item {\bf\emph{Developper's Guide}} : For bbtk kernel developpers. .
347      \item {\bf\emph{Reference Manual}} : 
348      \item {\bf\emph{Booklet}} : Vade mecum.    
349      \item {\bf\emph{Doxygen Documentation}} : Doxygen source browser.
350    \end{itemize}
351         
352    \item {\bf\emph{Boxes}} : Box retrieving on various criterions :
353    \begin{itemize} 
354     \item {\bf\emph{ \texttt{By name}}} (Alphabetical list), 
355     \item {\bf\emph{    \texttt{By package}}}, 
356      \item {\bf\emph{   \texttt{By category}}}.
357    \end{itemize} 
358    
359         A special hidden Box category, called \texttt{{Adaptors}} exists. \\ 
360         They are used internaly to perform type conversions. Thought there are not end user intended, you may query them.     
361
362       
363  \end{itemize}
364
365
366 % ==========================================
367
368
369
370
371 % ==========================================
372 % ==========================================
373 % ==========================================
374 % ==========================================
375 % ==========================================
376
377
378
379
380 % ==========================================
381
382 \newpage
383
384 % ==============================================
385 \subsection{Running Demo and Examples}
386 % ==============================================
387
388 Run \bbStudio the way you need. \\
389 In the part 'Help contents' (See figure \ref{HelpContents}), select \texttt{Examples} link.
390
391 \begin{figure}[!ht]
392 \caption{\label{HelpContents}Help Contents}
393 \begin{center}
394 \includegraphics[width=0.7\textwidth]{HelpContents.png}
395 \end{center}
396 \end{figure}
397
398 \newpage
399
400 You will be asked to select a Box category (See figure \ref{BoxCategories}); \\ 
401 Select \texttt{example}.
402
403
404 \begin{figure}[!ht]
405 \caption{\label{BoxCategories}Box Categories}
406 \begin{center}
407 \includegraphics[width=0.7\textwidth]{BoxCategories.png}
408 \end{center}
409 \end{figure} 
410
411 You will be asked to choose a script (See figure \ref{example}).
412
413 \begin{figure}[!ht]
414 \caption{\label{example}example list}
415 \begin{center}
416 \includegraphics[width=0.7\textwidth]{example.png}
417 \end{center}
418 \end{figure}
419
420
421
422 Select \texttt{wx::exampleSlider} (See figure \ref{exampleSlider});
423  
424 \begin{figure}[!ht]
425 \caption{\label{exampleSlider}example 'exampleSlider'}
426 \begin{center}
427 \includegraphics[width=0.7\textwidth]{exampleSlider.png}
428 \end{center}
429 \end{figure}
430
431 You can see the graphical summary representation of the current script (the elementary boxes that compose it, and their
432 connections) \\
433 Click on \texttt{source}, and you'll be able to see the (very simple) script, 
434 in the 'Files' part, within the script editor (See figure \ref{exampleSliderSource});
435
436 \begin{figure}[!ht]
437 \caption{\label{exampleSliderSource}source code of 'exampleSlider'}
438 \begin{center}
439 \includegraphics[width=0.7\textwidth]{exampleSliderSource.png}
440 \end{center}
441 \end{figure}
442
443 Run it, using the lower toolbar  (see figure : \ref{lowertoolbar})
444
445 You'll get something like in figure \ref{execSliderSource}.
446
447 \begin{figure}[!ht]
448 \caption{\label{execSliderSource}execution of 'exampleSlider'}
449 \begin{center}
450 \includegraphics[width=0.7\textwidth]{execSliderSource.png}
451 \end{center}
452 \end{figure}
453
454 Feel free to move the slider, to check it actually works...
455
456 \newpage
457
458 Just a few words on what you saw :
459 \begin{itemize}
460 \item{in the File part} \\
461 The source code of the script
462 \begin{verbatim}
463    new Slider     slider
464      set slider.ReactiveOnTrack 1
465 \end{verbatim}
466 We create a \texttt{Slider} called \emph{slider}\\
467 We tell it to inform anybody that's interested in, that the cursor moved, each time it moved. \\
468 The standard behaviour is to inform, only when cursor is released.
469 \begin{verbatim}
470    new OutputText text
471 \end{verbatim}
472 We create a \texttt{OutputText} called \emph{text} 
473 (in which slider value will be displayed)
474
475 \begin{verbatim}
476 new LayoutLine layout
477 \end{verbatim}
478 We create a \texttt{LayoutLine} called \emph{layout},
479 a \emph{container} widget, designed to embed other wigets (say, a main window)
480 \begin{verbatim}
481 connect slider.Widget    layout.Widget1
482 connect text.Widget      layout.Widget2
483 \end{verbatim}
484 We embed \emph{slider} and \emph{text} into  \emph{layout}.
485 \begin{verbatim}
486 connect slider.BoxChange text.BoxExecute
487 connect slider.Out       text.In
488 \end{verbatim}
489 We tell  \emph{slider} to inform \emph{text} every time it's modified.\\
490 We tell  \emph{slider} to pass its output value (\texttt{Out} to \emph{text}  input value (\texttt{In})
491 \begin{verbatim}
492 exec layout
493 \end{verbatim}
494 We tell \emph{layout} to process itself (it will do it only if it's warned 
495 that one of its entries was modified since its (own) last processing.
496
497 \item{in the Help part}
498
499 You can see the graphical representation of the script, as in figure \ref{SmallGraph}.
500
501
502 \begin{figure}[!ht]
503 \caption{\label{SmallGraph}Graphical representation of a script}
504 \begin{center}
505 \includegraphics[width=0.7\textwidth]{SmallGraph.png}
506 \end{center}
507 \end{figure}
508
509 Both graphical pipe line (\emph{slider} and \emph{text} are embedded into \emph{layout})
510  and processing pipe line (\emph{slider} warns \emph{text} immedialtely when it's modified, \emph{slider} passed \emph{text} its new value).\\
511  Yes, we know : all the arrows (pipe line arrows and processing arrows) are blue; we are sorry about that...\\
512  
513  You could get a much more detailled graph, just clicking on the button \\ \texttt{graph (detailled)} in the toolbar of the \texttt{Command} part, like in
514  figure  \ref{LargeGraph}.
515  
516 \begin{figure}[!ht]
517 \caption{\label{LargeGraph}Detailled graphical representation of a script}
518 \begin{center}
519 \includegraphics[width=0.75\textwidth]{LargeGraph.png}
520 \end{center}
521 \end{figure} 
522
523 \end{itemize}
524 \newpage
525
526 % ==============================================
527 \subsection{Online Help}
528 % ==============================================
529
530 Various levels or help are suplied by \bbStudions.
531
532 % ==========================================
533 \subsubsection{Command line help}
534 % ==========================================
535
536
537 The 'working' area (the left one, as opposed to the 'help' area, on the right side) is composed of : 
538 one single line area (\texttt{Command}), at the bottom in which you can enter your commands and 
539 a multiple line zone in which the Command interpreter prints out the result of your commands.
540 The upper part contains the script editor; we shall not use it right now, you may reduce it
541
542 Try typing in the \texttt{Command} area (in this manual, 
543 the commands entered by the user will be preceded by a prompt \textgreater) :
544 \begin{verbatim}
545 > help 
546 \end{verbatim}
547
548 you get the list of the commands of the interpreter :
549 \begin{verbatim}
550 Available commands :
551  author
552  category
553  config
554  connect
555  debug
556  define
557  delete
558  description
559  endefine
560  endpackage
561  exec
562  graph
563  help
564  include
565  index
566  input
567  kind
568  load
569  message
570  new
571  newgui
572  output
573  package
574  print
575  quit
576  reset
577  set
578  unload
579 \end{verbatim}
580
581 To get help on a particular command type \texttt{help <command-name>},
582 for example :
583 \begin{verbatim}
584 > help author
585 \end{verbatim}
586
587 gives :
588 \begin{verbatim}
589  usage : author <string>
590   Adds the string <string> to the author information of the black box being defined
591 \end{verbatim}
592
593 The \texttt{help} command has multiple usages. 
594 It is used to get help about almost anything in the interpretor!
595 Type \texttt{'help help'} to get help on the \texttt{help} command itself :
596 \begin{verbatim}
597 > help help
598  usage : 
599          (1) help 
600          (2) help <command name> 
601          (3) help packages [all]
602          (4) help <package name> [all]
603          (5) help <black box type> 
604          (6) help <black box name>
605   Effect :
606          (1) Lists all available commands;
607          (2) Prints help on a particular command; 
608          (3) Lists the packages loaded and their black boxes.
609              Add 'all' to list adaptors; 
610          (4) Prints short help on the black boxes of a package.
611              Add 'all' to include adaptors; 
612          (5) Prints full help on a black box type; 
613          (6) Prints information on the inputs, outputs and connectionns
614              of a black box instance.
615 \end{verbatim}
616
617 At start the interpretor does not know any black box. 
618 If you type \texttt{'help packages'}, which is 
619 the third form of the \texttt{help} command, you get :
620 \begin{verbatim}
621 > help packages
622 user
623   workspace
624 \end{verbatim}
625
626 which means that the interpretor only knows one package 
627 (library of black boxes) called \texttt{user}
628 and which contains a black box called \texttt{workspace}.
629 The \texttt{user} package is an internal package of the interpreter, 
630 which stores user-defined black box types. 
631 At start, it already contains 
632 one box, called \texttt{workspace}.
633 \texttt{workspace} is a special type of black box, 
634 called complex black box, whose purpose is 
635 to store other black boxes. 
636 Any black box you create in \bbStudio is stored 
637 in \texttt{workspace}  
638 (this will be explained in details in sections 
639 \ref{bbi-writing-scripts} and 
640 \ref{bbi-more-on-complex-black-boxes}). 
641
642 If you type \texttt{'help workspace'}, you get :
643 \begin{verbatim}
644 > help workspace
645  Complex Black Box <user::workspace>
646   User's workspace
647   By : bbtk
648   Category(s) : complex box;
649   * No inputs
650   * No outputs
651   * No boxes
652 \end{verbatim}
653
654 In the text displayed, 
655 the \texttt{user::} prepended to the name \texttt{workspace} 
656 means that the box \texttt{workspace} 
657 belongs to the \texttt{user} package. 
658 Then comes a description and three lines which 
659 tell that \texttt{workspace} does not have any input 
660 nor output nor boxes yet.
661
662 In order to let the interpreter know of some black boxes, 
663 you must load another package. 
664 The \texttt{std} package is the ``standard'' package, 
665 which contains basic useful black boxes. 
666
667 To load it, type :
668 \begin{verbatim}
669 > include std
670 \end{verbatim}
671
672 Then if you type :
673 \begin{verbatim}
674 > help packages
675 \end{verbatim}
676
677 you get something like :
678
679 \begin{verbatim}
680
681  std
682    ASCII                   : ascii codes sequence to string - string to ascii...
683    Add                     : Adds its inputs
684    ConcatStrings           : String concatenation
685    Configuration           : Gets configuration informations
686    Div                     : Divides its inputs
687    ExecBbiCommand          : Executes bbi commands
688    ExecSystemCommand       : Executes system (O.S.) commands
689    GetVectorCharElement    : Gets the i-th element from the input vector (std...
690      ...
691    MagicBox                : Takes *any kind* of data and copies it to its ou...
692    MakeFileName            : Makes a kosher file name
693    Mul                     : Multiplies its inputs
694    MultipleInputs          : This box has multiple Void inputs and one Void o...
695    StringRelay             : Just copies the value of its input to its output...
696    StringSelect            : Outputs the string set to the ith input Ini (In0...
697  user
698    workspace 
699 \end{verbatim}
700
701 Now the interpreter knows the package \texttt{std} and the black boxes it provides,
702 such as the \texttt{'Add'} box, the \texttt{'ConcatStrings'} box, and so on. Remark that the 
703 content of \texttt{std} may vary from one version to another 
704 as new black boxes might be added to it. 
705 If you type :  
706 \begin{verbatim}
707 > help Add
708 \end{verbatim}
709
710 You'll get a text help, in the 'Message' part :
711 \begin{verbatim}
712 Black Box <std::Add>S
713   Adds its inputs
714   By : laurent.guigues@creatis.insa-lyon.fr
715   Categories : atomic box;math;
716   * Inputs : 
717      'BoxExecute'     <bbtk::Void> [signal] : Any signal received by this input 
718                                               executes the box
719      'BoxProcessMode' <String>     []       : Sets the processing mode of the box 
720                                               (Pipeline | Always | Reactive)
721      'In1'            <Double>     []       : First number to add
722      'In2'            <Double>     []       : Second number to add
723   * Outputs : 
724      'BoxChange'      <bbtk::VoidS> [signal] : Signals modifications of the box
725      'Out'            <Double>     []       : Result
726 \end{verbatim}
727
728 More information about what is a 'box' will be given in the 'Scripting' part of this manual.
729
730 % ==========================================
731 \subsubsection{Guides}
732 % ==========================================
733
734 An html version of all the guides is browsable in the \texttt{Help} part of \bbStudions.
735  \begin{itemize}      
736      \item {\bf\emph{User's Guide}} : Step to step How-to for user who wants to create his own
737      application, just using already existing boxes.
738      \item {\bf\emph{Package Developper's Guide}} : Step to step How-to for programmer who wants to create his own
739      black boxes/packages.
740      \item {\bf\emph{Developper's Guide}} : For bbtk kernel developpers only. (This one is probabely not very much
741      up-to-date, since we spend more time in developping than writing documentation that's not of user concern).
742      \item {\bf\emph{Reference Manual}} : Contains a exaustive description of all the features for all the commands.
743      \item {\bf\emph{Booklet}} : Vade mecum.     
744      \item {\bf\emph{Doxygen Documentation}} : Doxygen source browser.\\ Automatically generated from source file
745      headers. Should concern only the kernel developpers (i.e. : us).
746    \end{itemize}
747         
748
749    
750 % ==========================================
751 \subsubsection{Boxes Help}
752 % ==========================================
753  Box retrieving on various criteria :
754    \begin{itemize} 
755     \item {\bf\emph{Alphabetical list}} \\ This is the 'zero-level' of retrieving.
756     \item {\bf\emph{List by package}} \\ Several packages are supplied with bbtk :
757     \begin{itemize}
758       \item {\bf\emph{std}} : the 'standard' package including basic useful boxes.
759       \item {\bf\emph{wx}} : basic graphical interface elements (widgets : sliders, buttons, etc. based on the \texttt{wxWidgets} library).  
760       \item {\bf\emph{itk}} : the basic image processing package, based on the \itk library.
761       \item {\bf\emph{vtk}} : the basic images and surfaces processing and vizualization package, based on the \vtk library.
762       \item {\bf\emph{wxvtk}} : widget boxes based on the \vtk library (2D and 3D vizualization and
763       interaction).
764       %\item {\bf\emph{creaImageIO}} : Provides hight level widgets to read images, including DICOM.
765       \item {\bf\emph{toolsbbtk}} : Tools for bbtk administration and package development, such as :
766          \begin{itemize}
767          \item{\texttt{GUICreateBlackBox}} For creating the XML or C++ code for a new black box 
768          \item{\texttt{GUICreatePackage}} For creating a new bbtk package file structure on disk (Graphical user interface for the shell script bbCreatePackage)
769          \item{\texttt{MakePackageDoc}} For creating the html documentation of a package. The doc is generated at the 'canonical' location. Works both for a build tree or an installed toolkit.         
770          \end{itemize}               
771     \end{itemize}
772     \item {\bf\emph{List by category}}.
773     
774     
775     A given box may belong to more than one \texttt{category}.\\
776     You have to consider categories like keywords to index black boxes.\\
777     Some of them are mutually exclusive.
778     A black box may be :
779     \begin {itemize}
780        \item{atomic box / complex box}\\
781        Whether it's written is C++ or it's an assembly of several black boxes (atomic or complex).\\
782        Any box is either atomic ou complex.
783        \item{example / demo / application}\\
784            These ones are always complex black boxes. 
785           \begin {itemize}
786              \item{example}\\
787              It's just a (simple) example, for programmers, on how to use a given feature.
788              \item{demo}\\
789              It can be a 'good looking' (a.k.a 'sexy') example on some sophisticated work.       
790              \item{application}\\
791              It's a Final application, end user intended (e.g. Subscale a huge volume, Crop a DICOM image, etc)  
792           \end {itemize}
793         \item{widget}\\
794         Piece of graphical interface (based on \texttt{wxWidgets})
795         \item{Dicom}\\
796         Dicom medical image related box.
797         \item{viewer}\\
798         \item{read/write}
799         \item{mesh}
800         \item{3D Object creator}
801         \item{math}
802         \item{misc}              
803     \end {itemize}
804   \end {itemize}
805   
806 % ==========================================      
807 \subsubsection{The Package Browser}
808 \label{Package_Browser}
809 % ==========================================
810
811
812 You can run it using the tool bar of the 'Command' part. See figure \ref{imPackage_Browser}.
813
814 \begin{figure}[!ht]
815 \caption{\label{imPackage_Browser}The Package Browser}
816 \begin{center}
817 \includegraphics[width=0.6\textwidth]{Package_Browser.png}
818 \end{center}
819 \end{figure}
820
821 It allows you to query informations about what you can find in the packages (boxes and applications), using several criterions
822 (warning : it's case sensitive, i.e '\texttt{Button}' will give different results than '\texttt{button}' ...)
823 \begin {itemize}
824 \item Packages :\\
825 All the boxes and applications held in a given package (e.g. \texttt{wxvtk}, \texttt{std}, ...)
826 \item Name :\\
827 You can query on a subpart of the name of a box or an application (e.g. \texttt{DICOM})
828 \item Description :\\
829 You can query on a substring of the description of a box or an application (e.g. \texttt{utton} : user wants to get all
830 the\texttt{Button} as well as the \texttt{button} )
831 \item Category :\\
832 You can query on a sub part of the category name of a box or an application (e.g. \texttt{3D})
833 \item Input Type :\\
834 You can query all the boxes or applications that have at least one Input entry of the given type (e.g. \texttt{int})
835 \item Output Type :\\
836 You can query all the boxes or applications that have at least one Output entry of the given type (e.g. \texttt{int})
837 \item Input Nature :\\
838 You can query all the boxes or applications that have at least one Input entry of the given nature (e.g. \texttt{signal})
839 \item Output Nature :\\
840 You can query all the boxes or applications that have at least one Output entry of the given nature (e.g.
841 \texttt{signal},\texttt{file name})
842 \end {itemize}
843
844
845 All these criterions are \emph{AND}ed while the query process.\\
846 You can get the whole description of a given box or application clicking on its name.
847
848 \newpage 
849
850 % ==============================================
851 \subsection{The Menu}
852 % ==============================================
853
854 At last, let's have a look at \bbStudio menu.(See figure \ref{themenu})
855
856 \begin{figure}[!ht]
857 \caption{\label{themenu}The bbStudio menu}
858 \begin{center}
859 \includegraphics[width=0.7\textwidth]{themenu.png}
860 \end{center}
861 \end{figure}
862
863 \begin {itemize}
864   \item{File}
865      \begin {itemize}
866         \item{Open the bbtk configuration file}
867         \item{Quit}
868      \end {itemize}       
869   \item{Tools}
870      \begin {itemize}
871         \item{Create package} :
872         Provides a graphical interface to help Package developper to create a new empty package.
873         \item{Create black box}
874         Provides a graphical interface to help Package developper to create a new empty black box, and add it to an already existing package.   
875         \item{Show last image graph}
876         \item{Regenerate package doc} :
877         if user was supplied new black boxes, and added them to an already existing package, he can update the package documentation, in order to benefit all the features of the Help mechanisms.      
878         \item{Regenerate boxes list} :
879         if user wants to update only boxes list (quicker)
880         \item{Regenerate all}
881         User wants to rebuild the whole documentation.     
882      \end {itemize}     
883   \item{Options}
884      \begin {itemize}
885         \item{Reset before running} Before running, all the already boxes are destroyed, all the already loaded packages are unloaded (this is the recomended option).   
886      \end {itemize}     
887   \item{Windows}
888   User may decide, for any reason of his own, to hide one or more pannels:
889      \begin {itemize}
890         \item{Show 'Files' panel}
891         \item{Show 'Help' panel}
892         \item{Show 'Command' panel}
893         \item{Show 'Messages' panel}
894         \item{Launch Package browser} The package browser is a stand alone application. This can be achieved, too, using the lower tool bar, button 'Start Package Browser'     
895         \item{}     
896      \end {itemize}     
897   \item{About}
898      \begin {itemize}
899         \item{About} Info about \texttt{bbStudio}.       
900      \end {itemize}     
901 \end {itemize}
902 % ==========================================
903 \section{bbs scripting}
904 % ==========================================
905
906 % ==========================================
907 \subsection{Using an already existing script}
908 % ==========================================
909
910 Using the lower toolbar (see figure : \ref{lowertoolbarsmall}), open the file
911 holding the script.
912
913 \begin{figure}[!ht]
914 \caption{\label{lowertoolbarsmall}The lower tool bar}
915 \begin{center}
916 \includegraphics[width=0.7\textwidth]{lowertoolbar.png}
917 \end{center}
918 \end{figure}
919
920  You'll see it, in the '\texttt{Files}' part.\\ \\
921  You may run it, using the lower toolbar. \\ 
922  \texttt{WARNING :} if the script contains one or more \texttt{LayoutSplit}
923  object, you will have to resize the sub windows. \\ \\
924  You may modify, save or save-as the current script, using the lower toolbar.\\ \\
925  You may have a look at the graphical representation of the pipeline (sorry,
926  right now, to modify the pipeline, you have to modify the script; 
927  you cannot modify grapically the pipeline; Work in progress...)
928   
929
930 % ==========================================
931 \subsection{Inside black boxes}
932 % ==========================================
933
934 After loading the package it belongs to, you can You can create an \emph{instance} of an \texttt{Add} box by 
935 the command \texttt{new} :
936
937 \begin{verbatim}
938 > new Add a
939 \end{verbatim}
940
941 The \texttt{'a'} at the end is the \emph{name} of the instance, 
942 which will be used to reference it later. 
943 It is important to distinguish a box \emph{type} 
944 and an \emph{instance} of a box type. 
945 The \texttt{Add} box of the package \texttt{std} is actually 
946 a \emph{box type} , like \texttt{int} is a data type 
947 in \texttt{C} langage. The \texttt{new} command allows to create 
948 an instance of a box type, exactly like \texttt{int i;} in 
949 a \texttt{C} code, it declares a variable of type \texttt{int} whose 
950 name is \texttt{i}. 
951 Of course, like in \texttt{C} Language, you can declare multiple boxes of the 
952 same type in \bbi. \\
953
954 You can ask information about a given black box :\\
955 In the \texttt{Command part}, type \texttt{help} + black box name, e.g. \\
956
957 \begin{verbatim}
958 > help Add a
959 \end{verbatim}
960 Have a look to the 'Help' Part (see figure : \ref{HelpAdd}) :
961
962 \begin{figure}[!ht]
963 \caption{\label{HelpAdd}The html Help}
964 \begin{center}
965 \includegraphics[width=0.7\textwidth]{HelpAdd.png}
966 \end{center}
967 \end{figure}
968
969 The \texttt{std::} prepended to the name \texttt{Add} 
970 means that the box \texttt{Add} 
971 belongs to the \texttt{std} package. 
972 Then comes a description 
973 (the one which was provided by the author of the box), 
974 the author(s) of the box (usually e-mail adress(es)) and 
975 the categories to which the box belongs. 
976 Finally comes the lists of inputs and outputs of the box.
977 For each input or output, \bbi provides 
978 its \emph{name} (between quotes, e.g. \texttt{'ProcessMode'}), 
979 its \emph{type} (between \texttt{<} and  \texttt{>}, e.g. \texttt{<Int>})
980 and a description.    
981 Remark that the box \texttt{Add} is not a 'complex' black box 
982 but an 'atomic' box, hence its help does not 
983 mention any information concerning possible internal boxes. 
984
985 After the creation of the box \texttt{a}, type :
986 \begin{verbatim}
987 > help workspace
988 \end{verbatim}
989
990 you get :
991 \begin{verbatim}
992 Complex Black Box <user::workspace>
993  User's workspace
994  By : bbtk
995  Category(s) : complex box;
996  * No inputs
997  * No outputs
998  * Boxes : 
999     'a' <std::Add>
1000 \end{verbatim}
1001
1002 which means that \bbi workspace now contains a black box named \texttt{a},
1003 of type \texttt{std::Add}.
1004
1005 Now look back at the help on \texttt{Add} boxes : 
1006 you can see that this type of box has two inputs, 
1007 with name \texttt{In1} and \texttt{In2},
1008 and an output, with name \texttt{Out}.
1009
1010 You can set the input \texttt{In1} 
1011 of the \texttt{Add} box \texttt{a} to the value $1$ 
1012 by the command :
1013 \begin{verbatim}
1014 > set a.In1 1 
1015 \end{verbatim}
1016
1017 Similarly, setting the input \texttt{In2} of \texttt{a} to the value $2$
1018 is done with :
1019 \begin{verbatim}
1020 > set a.In2 2
1021 \end{verbatim}
1022  
1023 And you print the output \texttt{Out} of the box \texttt{a} with :
1024 \begin{verbatim}
1025 > print "result=$a.Out$"
1026 result=3
1027 \end{verbatim}
1028
1029 In the string passed to the \texttt{print} command, 
1030 each substring enclosed between a couple of \$ is considered 
1031 as the name of an output of a box. 
1032 To process this special substrings, the interpretor :
1033 \begin{enumerate}
1034 \item Processes the box if needed (see below)
1035 \item Converts the output of the box to a string if possible 
1036 (see below)
1037 \item Substitutes the result in the string to print
1038 \item Postpones an implicit 'new line' character to the string
1039 \end{enumerate}
1040
1041 %\paragraph
1042
1043 Box processing is needed if :
1044
1045 \begin{itemize}
1046 \item either at least input has changed since last processing 
1047 \item or the input \texttt{'BoxProcessMode'} of the box is set to 
1048 \texttt{'Always'}, which forces box reprocessing. 
1049 \end{itemize}
1050
1051 Note that all boxes have an input named \texttt{'BoxProcessMode'}.
1052
1053 Another way to process the box \texttt{a} is to issue the command :
1054 \begin{verbatim}
1055 > exec a
1056 \end{verbatim}
1057
1058 however this command does not display anything (except if the 
1059 box itself displays something in its processing).
1060 It just processes the box if needed. 
1061 This command is used to execute boxes that do not have any output,  
1062 such as boxes that write something to a file or, display a 
1063 graphical interface, and so on. 
1064
1065 %To exit \bbi, type :
1066 %\begin{verbatim}
1067 %> quit
1068 %Good bye !
1069 %\end{verbatim}
1070
1071 % ==========================================
1072 \hrule
1073
1074 \paragraph{Summary}
1075 %\hrule
1076 \begin{itemize}
1077 \item The \texttt{include} command allows to load a package, and the complex black boxes that come with it..
1078 \item \texttt{help} gives help on :
1079 \begin{itemize} 
1080 \item Available commands if you just type \texttt{help}.
1081 \item A particular command if you type \texttt{help <command-name>}.
1082 \item All available packages and their boxes (without description) if you type \texttt{help packages}.
1083 \item A particular package and its boxes (with brief description) if you type \texttt{help <package-name>}.
1084 \item A particular black box type (with full description) if you type \texttt{help <box-type-name>}. In particular, \texttt{help workspace} displays information on the content of the \texttt{'workspace'} black box, which stores the boxes created by the user (by \texttt{new}).
1085 \end{itemize}
1086 %\item \texttt{list} displays the list of black box instances created so far (by \texttt{new}).
1087 \item \texttt{new} : creates an instance of a black box. 
1088 \item \texttt{set} : sets the value of an input of a black box. 
1089 \item Under any component of  \bbStudions, to reference the input called \texttt{i} 
1090 of a black box called \texttt{b} you must type \texttt{'b.i'}. 
1091 The same syntax holds for outputs.
1092 \item \texttt{print} : prints a string, substituting each substring of the form \$b.o\$ by the value of the output \texttt{o} of the black box \texttt{b}. Note that an
1093 implicit trailing 'new line character' is added at the final string.
1094 \item \texttt{exec} : runs, if needed, the process of a box. 
1095 %\item \texttt{quit} : quits \bbi.
1096 \end{itemize}
1097 \hrule
1098
1099 %\paragraph{Note :}
1100 %A more 'modern' way to proceed is to run \texttt{bbStudio}, drag and drop the  \texttt{Command} bookmark to the lower \texttt{Welcome to bbStudio!} bar.
1101 %Wou'll get something like in figure \ref{bbCommandPlusHelp} :
1102
1103 %\begin{figure}[!ht]
1104 %\caption{\label{bbCommandPlusHelp}
1105 %An other way to run the command interpreter}
1106 %\begin{center}
1107 %\includegraphics[width=0.5\textwidth]{bbCommandPlusHelp.png}
1108 %\end{center}
1109 %\end{figure}
1110
1111 % ==========================================
1112
1113 % ==========================================
1114 \subsubsection{Connecting black boxes}
1115 \label{bbi-connecting-black-boxes}
1116 % ==========================================
1117
1118 \BBTK allows to create 
1119 and execute processing chains, 
1120 also called \emph{pipelines}, 
1121 by connecting black boxes.
1122 This section explains how to do it with examples. 
1123 Read section \ref{bbi-more-on-pipeline-processing} to get 
1124 more information on pipeline processing.
1125
1126 First start \bbStudio and load the package \texttt{std}, typing :
1127 \begin{verbatim}
1128 > include std
1129 \end{verbatim}
1130 in the 'Command' part.
1131
1132 Assume you want to compute $1+2+3$. You can do it by 
1133 chaining two \texttt{Add} boxes, as shown in figure 
1134 \ref{bbi-fig-connecting-black-boxes-1}. 
1135
1136 \begin{figure}[!ht]
1137 \caption{\label{bbi-fig-connecting-black-boxes-1} A simple pipeline which adds 3 numbers}
1138 \begin{center}
1139 \includegraphics[width=0.5\textwidth]{1plus2plus3.png}
1140 \end{center}
1141 \end{figure}
1142
1143
1144 The \bbi instructions to create and execute this pipeline are :
1145 \begin{verbatim}
1146 > new Add a
1147 > new Add b
1148 > connect a.Out b.In1
1149 > set a.In1 1
1150 > set a.In2 2
1151 > set b.In2 3
1152 > print $b.Out$
1153 \end{verbatim}
1154
1155 You will see the (very expected) result :
1156 \begin{verbatim}
1157 6
1158 \end{verbatim}
1159
1160 The first three commands build the pipeline, 
1161 the next three set \texttt{a} and \texttt{b} black boxes inputs and the last one 
1162 prints \texttt{b} black box output (the pipeline is executed before printing, because the interpretor 'knows' the box  \texttt{b}, 
1163 whose output is requested, is not up to date.
1164  
1165 The command \texttt{'connect a.Out b.In1'} ``plugs'' the output 
1166 \texttt{Out} of the box \texttt{a} into the input \texttt{In1} of the 
1167 box \texttt{b}. 
1168 Once the boxes are connected, the processing of the two boxes are chained :
1169 getting the output of \texttt{b} requires getting its inputs, 
1170 hence getting the output of \texttt{a} which is connected to it. 
1171 This pipeline mechanism can recurse into arbitrary long 
1172 chains of boxes (see \ref{bbi-more-on-pipeline-processing} 
1173 for details).
1174
1175
1176 Lets' consider an other, more image oriented, example :
1177
1178 \begin{verbatim}
1179 > include vtk
1180 > include wx
1181 > include itk
1182 > include wxvtk
1183
1184 > new FileSelector fileDialog
1185 > new ImageReader  reader 
1186 > new Slider       slider
1187 > new Viewer2D     viewer
1188
1189 > connect fileDialog.Out   reader.In 
1190 > connect reader.Out       viewer.In
1191 > connect slider.Out       viewer.Slice
1192 > connect slider.BoxChange viewer.BoxExecute
1193
1194 > exec viewer
1195 \end{verbatim}
1196
1197 Some explainations : the \texttt{include} instructions load the necessary packages. \\
1198
1199 \texttt{new FileSelector} will pop a File Selector, at run time, that will out the user chosen file name. \\
1200 \texttt{new Slider} will pop a Slider, at run time, that will out an integer, used later as a slice number.\\ 
1201 \texttt{new ImageReader} will read any itk readable file, whose name is passed as a std::string, and return a itk::ImagePointer.\\
1202 \texttt{new Viewer2D} display a plane, whose number id specified by an integer.\\
1203 \\
1204 \texttt{connect fileDialog.Out   reader.In} plugs the output of the File Selector (a std::string) to the input of the reader (a std::string, too).\\
1205 \texttt{connect reader.Out       viewer.In} plugs the output of the reader (an itk::ImagePointer) to the input of the Viewer (a vtkImageData *)\\
1206 \texttt{connect slider.Out       viewer.Slice} plugs the output of the slider (an int) to an other output (named Slide) of the viewer.\\
1207 \texttt{connect slider.BoxChange viewer.BoxExecute} says the viewer that it must re process itself any time the slider is modified.\\
1208 \\
1209 \texttt{exec viewer} processes the viewer.
1210
1211
1212 This would correspond to the graph in figure \ref{bbi-simplegraph}
1213
1214
1215 \begin{figure}[!ht]
1216 \caption{\label{bbi-simplegraph}(Very) simple Graph of a (very) simple pipeline}
1217 \begin{center}
1218 \includegraphics[width=0.8\textwidth]{bbi-simplegraph.png}
1219 \end{center}
1220 \end{figure}
1221    
1222 Of course, to be able to connect two boxes, 
1223 the output and the input must be compatibles. 
1224 You can always connect an output to an input of the \emph{same} type, 
1225 but you can do more, thanks to particular (hidden) black boxes called {\bf adaptors}.
1226
1227 An adaptor is a black box which has at least one input, called \texttt{In}, 
1228 and at least one ouput called \texttt{Out} and whose role is to convert 
1229 a data of the type of \texttt{In} 
1230 into a data of the type of \texttt{Out} (other inputs or outputs may serve 
1231 to parameter the adaptor or retreive other useful information).
1232
1233 Under \bbStudions, if you type :
1234 \begin{verbatim}
1235 > load std
1236 > help std all
1237 \end{verbatim}
1238 you get :
1239 \begin{verbatim}
1240  Package std v1.0.0 - laurent.guigues@creatis.insa-lyon.fr
1241  Basic useful black boxes
1242  Black boxes : 
1243       ...
1244    BoolToString        [DA]  : Converts a Bool (bool) into a string
1245    CastBoolToChar      [DA]  : Static cast from Bool (bool) to Char (signed c...
1246    CastBoolToDouble    [DA]  : Static cast from Bool (bool) to Double (double...
1247       ...
1248    CastBoolToUChar     [DA]  : Static cast from Bool (bool) to UChar (unsigne...
1249    CastBoolToUInt      [DA]  : Static cast from Bool (bool) to UInt (unsigned...
1250       ...
1251    CastUIntToBool      [DA]  : Static cast from UInt (unsigned int) to Bool (...
1252    CastUIntToChar      [DA]  : Static cast from UInt (unsigned int) to Char (...
1253    CastUIntToDouble    [DA]  : Static cast from UInt (unsigned int) to Double...
1254       ...      
1255
1256 \end{verbatim}
1257
1258 \texttt{[DA]}  stands for \emph{default adaptor}.
1259
1260 Once you have loaded the package \texttt{std}, you can 
1261 plug an output of type \texttt{char} into an input of type \texttt{double}. 
1262 When the interpreter encounters the \texttt{connect} command, 
1263 it looks for an adequate \emph{adaptor} in the  loaded packages. 
1264 In our case, as the package \texttt{std} provides the 
1265 \texttt{CastUCharToDouble} adaptor, the interpreter automatically creates an 
1266 instance of this adaptor and place it \emph{between} 
1267 the output and the input you want to connect 
1268 (however this adaptor is hidden to you, 
1269 it is embedded into the created connection and does not appear 
1270 as an existing black box). 
1271 When the pipeline is processed the 
1272 adaptor converts the output data into the required input type, 
1273 in a totally transparent way.
1274 In our example, the \texttt{CastUCharToDouble} adaptor 
1275 would simply cast the value of the \texttt{char} into a \texttt{double}, 
1276 however arbitrarily complex type conversion may be done.\\
1277 \texttt{WARNING} : these adaptors are \texttt{C++ static cast}, i.e., there is, right now',
1278  no 'intelligent' conversion (only truncation) e.g. think to \texttt{CastDoubleToUChar}!
1279
1280 %\begin{verbatim}
1281 %Question (for info-dev): 
1282 %if two adaptors with the same input and output types exist 
1283 %in two different packages, currenly loaded, 
1284 %which one is chosen by the interpreter at connection time?
1285 %A feature is missing to specify explicitely which one user wants to choose 
1286 %(use a namespace notation ?)
1287
1288 %-> Role of default adaptors
1289 %\end{verbatim}
1290
1291 Note that the \texttt{set} and \texttt{print} commands of interpreter 
1292 work with adaptors from \texttt{string} to the type of the input to set 
1293 or from the type of the output to print to \texttt{string}. 
1294 Hence in order to \texttt{set} or \texttt{print} values the adequate 
1295 adaptors must be available in the packages currently loaded. \\
1296
1297
1298 % ==========================================
1299 \hrule
1300 \paragraph{Summary}
1301 %\hrule
1302 \begin{itemize}
1303 \item The \texttt{connect} command allows to connect two black boxes
1304 \item You can connect two black boxes if (and only if) : 
1305 \begin{itemize}
1306 \item The output and the input are of the same type, or
1307 \item There is an adaptor black box in the packages loaded which 
1308 converts data of the output type into data of the input type
1309 \end{itemize}
1310 \item \texttt{help <package name>} does not display the adaptors of the package. To see them use : \texttt{help <package name> all}.
1311 including adaptors
1312 \end{itemize}
1313 \hrule
1314 % ==========================================
1315
1316 % ==========================================
1317 \subsubsection{Creating complex black boxes}
1318 \label{bbi-complex-black-boxes}
1319 % ==========================================
1320
1321 Remember the pipeline of figure 
1322 \ref{bbi-fig-connecting-black-boxes-1}, which 
1323 computed the sum of three doubles.
1324 You can consider it as a whole and define 
1325 a new black box type, which will be a \emph{complex black box}, 
1326 having three inputs and one output, 
1327 as shown in figure \ref{bbi-fig-complex-black-box-1}.
1328
1329 \begin{figure}[!ht]
1330 \caption{\label{bbi-fig-complex-black-box-1} Creating the complex black box \texttt{Add3}}
1331 \begin{center}
1332 \includegraphics[width=0.5\textwidth]{Add3.png}
1333 \end{center}
1334 \end{figure}
1335
1336 The \bbi commands to define this complex black box are 
1337 the following :
1338
1339 \begin{verbatim}
1340 > load std
1341 >
1342 > define Add3
1343 >
1344 > new Add a
1345 > new Add b
1346 > connect a.Out b.In1
1347 >
1348 > author "myself"
1349 > description "adds 3 doubles"
1350 > input x a.In1 "first double to add"
1351 > input y a.In2 "second double to add"
1352 > input z b.In2 "third double to add"
1353 > output result b.Out "output"
1354 >
1355 > endefine
1356 \end{verbatim}
1357
1358 Explainations :
1359
1360 As we will use \texttt{Add} boxes, we need to load the package \texttt{std}, which is done in first line.
1361
1362 The command \texttt{define} then starts the definition 
1363 of the complex box type, which will be called \texttt{Add3}. 
1364
1365 The next three lines define the pipeline, 
1366 exactly in the same way than outside a complex box definition. 
1367
1368 The commands \texttt{author}, \texttt{description}, \texttt{input} 
1369 and \texttt{output} are commands specific to complex boxes definition :
1370
1371 \texttt{author} and \texttt{description} are used for the documentation 
1372 of the new box. You can provide multiple \texttt{author} or 
1373 \texttt{description} commands, the arguments of the commands will 
1374 be concatenated to produce the final author and description strings.
1375
1376 \texttt{input} and \texttt{output} are used to define the inputs and outputs 
1377 of the new complex box. 
1378 Their syntax is the same : for each new input/output you need to say 
1379 to which internal input/output it corresponds and to provide 
1380 a help string documenting the input/output.
1381 In our example, we define that the box \texttt{Add3} has 
1382 three inputs : \texttt{x}, \texttt{y} and \texttt{z}. 
1383 The input \texttt{x} corresponds to the input \texttt{In1} of the 
1384 internal box \texttt{a}. 
1385 In the same way, the external input \texttt{y} 
1386 corresponds to the internal input \texttt{a.In2}, and 
1387 the external input \texttt{In3} to \texttt{b.In2}. 
1388 The only output of the new box is called \texttt{result}
1389 and corresponds to \texttt{b.Out}. 
1390 The figure \ref{bbi-fig-complex-black-box-1} 
1391 illustrates the external to internal 
1392 input/output correspondence.
1393
1394 Finally, the \texttt{endefine} command ends the definition of the 
1395 new box type.
1396
1397 After this definition, if you ask for help 
1398 on packages, you get :
1399 \begin{verbatim}
1400 > help packages
1401 std
1402   Add
1403   ...
1404 user
1405   Add3
1406   workspace
1407 \end{verbatim}
1408
1409 The \texttt{user} package now contains a new black box type, called 
1410 \texttt{Add3}. If you ask for help on this type of box, you get :
1411 \begin{verbatim}
1412 > help Add3
1413 Complex Black Box <user::Add3>
1414  adds 3 doubles
1415  By : myself
1416  * Inputs : 
1417     'x'      <double> : first double to add
1418     'y'      <double> : second double to add
1419     'z'      <double> : third double to add
1420  * Outputs : 
1421     'result' <double> : output
1422  * Boxes : 
1423     'a' <std::Add>
1424     'b' <std::Add>
1425 \end{verbatim}
1426
1427 and you can use it like any other box, for example type :
1428
1429 \begin{verbatim}
1430 > new Add3 a
1431 > set a.x 1
1432 > set a.y 2
1433 > set a.z 3
1434 > print $a.result$
1435 6
1436 \end{verbatim}
1437
1438
1439 As a side note, we can say that, for consistency reasons, it would have been better to name  
1440 \texttt{In1}, \texttt{In2} and \texttt{In3} the inputs of the black box \texttt{Add3}, 
1441 since all the 'natural entry' of a box is named \texttt{In}, or \texttt{In}\emph{x} if there are more than one  'natural
1442 entry'.
1443
1444 % ==========================================
1445 \hrule
1446 \paragraph{Summary}
1447 %\hrule
1448 \begin{itemize}
1449 \item The \texttt{define/endefine} commands allows to define complex black box types, i.e. types of black boxes made up of other black boxes. 
1450 Inside a \texttt{define/endefine} block :
1451 \begin{itemize}
1452 \item The \texttt{author} and \texttt{description} commands allow to document the new type of box
1453 \item The \texttt{input} and \texttt{output} commands allow to define the inputs and outputs of the new type of box, that is to which inputs and outputs 
1454 of internal boxes they correspond.  
1455 \end{itemize}
1456 \end{itemize}
1457 \hrule
1458 % ==========================================
1459
1460 % ==========================================
1461 \subsubsection{Writing scripts}
1462 \label{bbi-writing-scripts}
1463 % ==========================================
1464
1465 Once you have defined a new type of complex box, you 
1466 may like to reuse it. To do this, you can simply 
1467 write the \bbi commands defining the new box 
1468 into a text file and afterwards include that file in \bbins. 
1469 Doing this, you start writing \bbi scripts.
1470 The conventionnal (and mandatory) extension for such scripts is \texttt{bbs} 
1471 (black box script).
1472 For consistency reasons, you are requested to prepend \texttt{bb} to the name.
1473
1474 For example, the \texttt{Add3} complex box we previously worked on 
1475 can be defined in the \texttt{bbAdd3.bbs} file :
1476
1477 \begin{file}{bbAdd3.bbs}
1478 \begin{verbatim}
1479 # Defines the Add3 black box which adds 3 doubles 
1480 load std
1481
1482 define Add3
1483   # I am the author 
1484   author "myself"
1485   description "adds 3 doubles"
1486   # Pipeline creation
1487   new Add a
1488   new Add b
1489   connect a.Out b.In1
1490   # Inputs definition
1491   input x a.In1 "first double to add
1492   input y a.In2 "second double to add
1493   input z b.In2 "third double to add"
1494   # Output definition
1495   output result b.Out "output"
1496 endefine
1497 \end{verbatim}
1498 \end{file}
1499
1500 Lines starting with a \texttt{\#} character or a \texttt{\//\//} character are ignored, they 
1501 are considered as comments by the interpreter.
1502 To use this file in \bbStudions, click on the \texttt{include} button, and browse your filestore to find the file.
1503
1504 \begin{verbatim}
1505 > include bbAdd3.bbs
1506 > help Add3
1507 Complex Black Box <user::Add3>
1508  adds 3 doubles
1509  By : myself
1510  * Inputs : 
1511     'x'      <double> : first double to add
1512     'y'      <double> : second double to add
1513     'z'      <double> : third double to add
1514  * Outputs : 
1515     'result' <double> : output
1516  * Boxes : 
1517     'a' <std::Add>
1518     'b' <std::Add>
1519 >
1520 and so on ...
1521 \end{verbatim}
1522
1523 If the file has the \texttt{bbs} extension, you can ommit it and just type :
1524 \begin{verbatim}
1525 > include Add3
1526 \end{verbatim}
1527
1528 \subsubsection{Creating complex black boxes that use complex black boxes}
1529 \label{bbi-complex-complex-black-boxes}
1530
1531
1532 Of course, you can include script files in other script files, 
1533 like in the following example :
1534
1535 \begin{file}{bbAdd4.bbs}
1536 \begin{verbatim}
1537 # Defines the Add4 black box which adds 4 doubles 
1538 include Add3
1539
1540 define Add4
1541   author "myself"
1542   description "adds 4 doubles"
1543   new Add3 a
1544   new Add b
1545   connect a.Out b.In1
1546   input In1 a.In1 "first double to add
1547   input In2 a.In2 "second double to add
1548   input In3 a.In3 "third double to add"
1549   input In4 b.In2 "fourth double to add"
1550   output Out b.Out "output"
1551 endefine
1552 \end{verbatim}
1553 \end{file}
1554
1555
1556
1557 \subsubsection{Naming Conventions}
1558 \label{bbi-Naming Conventions}
1559
1560
1561 % ==========================================
1562 %\hrule
1563 %\paragraph{Naming Conventions}
1564 %\hrule
1565
1566 %\hrule
1567 % ==========================================
1568 \begin{itemize}
1569 \item
1570 File names : 
1571 For consistency reasons, you are requested to prepend \texttt{bb}, and postpone an extention \texttt{.bbs},
1572 to the names of the files that hold a \texttt{complex black box} definition.
1573
1574 For example, the \texttt{Add3} complex box we previously worked on 
1575 can be defined in the \texttt{bbAdd3.bbs} file.
1576 \item
1577 Search Paths :
1578 For consistency reasons, the names of dynamic libraries holding the packages must start by \texttt{libbb}.
1579 For instance, the package \texttt{wx} will be in the library \texttt{libbbwx.dll} (Windows) or \texttt{libbbwx.so}
1580 (Linux).
1581
1582
1583 \end{itemize}
1584 % ==========================================
1585 \hrule
1586
1587 \paragraph{Summary}
1588 %\hrule
1589 \begin{itemize}
1590 \item The \texttt{include} command tells the interpreter to include a script file.
1591 \item Lines starting with a \texttt{\#} or with a \texttt{\//\//} are considered as comments by the interpreter.
1592 \item Lines between a line starting with a \texttt{\//*} an a line starting with a \texttt{*\//} are considered as comments by the interpreter.
1593 \end{itemize}
1594
1595 \hrule
1596 % ==========================================
1597
1598 % ==========================================
1599 \subsubsection{Creating command line applications}
1600 \label{bbi-command-line-app}
1601 % ==========================================
1602
1603 Now that you know how to create complex black boxes 
1604 (with \texttt{define/endefine}), think 
1605 back to the \texttt{workspace} object. 
1606 Remember that it is also 
1607 a \texttt{complex black box}. 
1608 Actually, when you type interpreter commands 
1609 outside a \texttt{define/endefine} block, 
1610 you progressively define the \texttt{workspace} 
1611 complex black box.
1612 You can think of it like if at start the interpreter
1613 was issuing a command \texttt{'define workspace'} 
1614 and then letting you define the interior of the box 
1615 \texttt{workspace}.
1616
1617 Remember that the command \texttt{inputs} 
1618 allows to define an input of a complex box. 
1619 Now, if you use the command \texttt{input} 
1620 outside a \texttt{define/endefine} block then 
1621 it defines an input of the \texttt{workspace} box, 
1622 that is an input of the \emph{main program}. 
1623 This input will then be connected to the 
1624 parameters that the user passes to the command line.
1625
1626 For example, consider the script : 
1627
1628 \begin{file}{add.bbs}
1629 \begin{verbatim}
1630 load std
1631 new Add a
1632 input x a.In1 "first number to add"
1633 input y a.In2 "second number to add"
1634 print "x+y=$a.Out$"
1635 \end{verbatim}
1636 \end{file}
1637
1638 The third and fourth lines define two inputs \texttt{x} 
1639 and \texttt{y}. When you execute this script, 
1640 you can pass these two arguments on the command line, 
1641 like this :
1642
1643 \begin{verbatim}
1644 > bbi add x=1 y=1
1645 x+y=2
1646 \end{verbatim}
1647
1648 You can also invoke \bbi the option \texttt{-h}, 
1649 which gives help on the \texttt{workspace} box :
1650
1651 \begin{verbatim}
1652 > bbi add -h
1653  User's workspace
1654  By : bbi (internal)
1655  * Inputs : 
1656     'x' <double> : first number to add
1657     'y' <double> : second number to add
1658 \end{verbatim}
1659
1660 To get a better help, use the \texttt{description} 
1661 and \texttt{author} commands :
1662
1663 \begin{file}{add.bbs}
1664 \begin{verbatim}
1665 description "Adds two numbers"
1666 author "foo@bar.com"
1667 load std
1668 new Add a
1669 input x a.In1 "first number to add"
1670 input y a.In2 "second number to add"
1671 print "x+y=$a.Out$"
1672 \end{verbatim}
1673 \end{file}
1674
1675 Now if you ask for help on the \texttt{add} script, you get :
1676
1677 \begin{verbatim}
1678 > bbi add -h
1679  Adds two numbers
1680  By : foo@bar.com
1681  * Inputs : 
1682     'x' <double> : first number to add
1683     'y' <double> : second number to add
1684 \end{verbatim}
1685
1686 Rather than getting the inputs of a script 
1687 from the command line, you can ask \bbi to 
1688 prompt the user for the values, using the \texttt{-t}
1689 commutator :
1690
1691 \begin{verbatim}
1692 > bbi add -t
1693 x=[the program waits for user answer]2
1694 y=[the program waits for user answer]5
1695 x+y=7
1696 \end{verbatim}
1697
1698 \bbStudio is always compiled in graphical mode (with \wx), therefore
1699 you can also use the \texttt{-g} commutator. 
1700 \bbi then prompts the user in graphical mode, 
1701 displaying a dialog box for each input,
1702 like in fig. \ref{bb-input-dialog-box}.
1703
1704 \begin{figure}[!ht]
1705 \caption{\label{bb-input-dialog-box}Input dialog box}
1706 \begin{center}
1707 \includegraphics[width=0.6\textwidth]{enter-the-value-of-x.png}
1708 \end{center}
1709 \end{figure}
1710
1711 % ==========================================
1712 \hrule
1713 \paragraph{Summary}
1714 %\hrule
1715 \begin{itemize}
1716 \item The \texttt{input}, \texttt{description} and \texttt{author} commands,
1717 when they are used outside a \texttt{define/endefine} block allow 
1718 to define the inputs, description and author of the main program.
1719 \item Inputs of the main program can be passed on the command line 
1720 using the syntax \texttt{<input-name>=<value>}. 
1721 No white space is allowed, if the value or the input name 
1722 contains white spaces, enclose them 
1723 between double quotes, e.g. \texttt{"parameter with white spaces = gnu's not unix"}.
1724 \item The \texttt{-h} option of \bbi prints help on the main program.
1725 \item The \texttt{-t} option of \bbi orders the program to prompt for its inputs in text mode.
1726 \item The \texttt{-g} option of \bbi orders the program to prompt for its inputs in graphical mode.
1727 \end{itemize}
1728 \hrule
1729 % ==========================================
1730
1731 % ==========================================
1732 \subsubsection{Using graphical interface boxes (widget boxes)}
1733 \label{bbi-widget}
1734 % ==========================================
1735
1736 % ==========================================
1737 \subsubsection{Overwiew}
1738 \label{bbi-overview}
1739 % ==========================================
1740
1741 \bbStudio is always compiled in graphical mode 
1742 (option \texttt{BUILD\_bbi\_GRAPHICAL} of \cmakens, requires \wxns),
1743 then you can use special black boxes which are 
1744 graphical interface components (widgets). 
1745 Basic components are provided in the package \texttt{wx}, 
1746 such as buttons, sliders, file open/save dialogs, etc.
1747
1748 As first example, type the following commands in \bbi :
1749 \begin{verbatim}
1750 > load wx 
1751 > new InputText t
1752 > print $t.Out$\n
1753 \end{verbatim}
1754
1755 When you type \texttt{enter} after the last line, 
1756 a window pops up in which you can entrer a text.
1757 When you close the window, the text you entered is printed by 
1758 the \texttt{print} command.
1759
1760 Type \texttt{help wx}, you get something like :
1761 \begin{verbatim}
1762  Package wx v1.0.0- info-dev@creatis.insa-lyon.fr
1763  Basic graphical interface elements (sliders, buttons ...) based on wxWidgets
1764  Black boxes : 
1765    ColourSelector        : Colour Selector dialog (bbfication of wxColourSele...
1766    ColourSelectorButton  : A button which displays a colour picker dialog whe...
1767    CommandButton         : Button which executes bbi commands
1768    DirectorySelector     : Pops up a directory selection dialog (wxDirDialog)
1769    FileSelector          : Pops up a file selection dialog for reading or sav...
1770    InputText             : A zone in which the user can enter a text (wxTextC...
1771    LayoutLine            : LayoutLine widget (wxBoxSizer)
1772    LayoutSplit           : Widget which splits a window in two fixed size par...
1773    LayoutTab             : LayoutTab widget (wxNotebook)
1774    OutputText            : Text zone to be inserted into a window (wxStaticTe...
1775    RadioButton           : RadioButton group widget 0-9 entries
1776    Slider                : Slider widget (wxSlider)
1777 \end{verbatim}
1778
1779 You can reproduce the same experiment as above using a 
1780 \texttt{Slider} or a \texttt{FileDialog} rather than a \texttt{InputText}.
1781 See the files \texttt{test*.bbs} in the \texttt{scripts/test} directory.
1782
1783
1784 %There are two kinds of widgets : ``terminal'' widgets and ``container'' widgets.
1785 %The \texttt{InputText}, \texttt{FileDialog} or \texttt{Slider} widgets 
1786 %are ``terminal'' widgets. 
1787 %``container'' widgets are of another kind : they are 
1788 There is a special kind of widget, called '\texttt{Layout}', designed to  
1789 contain other widgets in order to build larger dialog boxes. 
1790 For example, the \texttt{LayoutSplit} widget is a container which 
1791 ``splits'' horizontally a window into two parts, 
1792 each part including another widget. 
1793 The size of the two parts can be adjusted by the user thanks 
1794 to a ``handle''.
1795
1796 The script \texttt{scripts/test/testSplit.bbs} demonstrate its use. 
1797 Run it : it displays a window with two sliders. 
1798 Move the sliders and close the window. 
1799 The final positions of the sliders are printed out. 
1800 Now edit the file to see how this is done :
1801
1802 \begin{file}{scripts/test/testSplit.bbs}
1803 \begin{verbatim}
1804 load std
1805 load wx
1806
1807 new Slider s1
1808 new Slider s2
1809
1810 new LayoutSplit s
1811 connect  s1.Widget s.Widget1
1812 connect  s2.Widget s.Widget2
1813
1814 print s1=$s1.Out$\\n
1815 print s2=$s2.Out$\\n
1816 \end{verbatim}
1817 \end{file}
1818
1819 First, the two sliders \texttt{s1} and \texttt{s2} are created.
1820 A \texttt{LayoutSplit} box \texttt{s} is also created. 
1821 The \texttt{connect} commands then ``includes'' the sliders in the 
1822 split ``container''. 
1823 The input \texttt{Widget} is common to all widget boxes : 
1824 every widget can be inserted into another widget. 
1825 The outputs \texttt{Widget1},\texttt{Widget2}  are specific of \emph{container} 
1826 widgets 
1827 (in \bbi type \texttt{help Slider} : 
1828 you will see the output \texttt{Widget}; 
1829 type \texttt{help LayoutSplit} : 
1830 you will see the inputs \texttt{Widget1} and \texttt{Widget2} 
1831 and the output \texttt{Widget}). 
1832 When you connect the \texttt{Widget} output of a container 
1833 to the \texttt{Widget}i input of a widget, 
1834 you order to include the widget in the container.
1835 Of course, the order of connection is important. 
1836 In our case, the slider \texttt{s1} is included first, 
1837 then the slider \texttt{s2} : \texttt{s1} will be placed 
1838 on top of \texttt{s2} (the \texttt{LayoutSplit} box is 
1839 implemented that way, but this is arbitrary choice).
1840
1841 Right now, there are only \emph{three} container widgets in the \texttt{wx} package : 
1842 \begin{itemize} 
1843 \item {the \texttt{LayoutSplit} widget} we just described, the \texttt{LayoutLine} , and the \texttt{LayoutTab}
1844 widget. 
1845
1846 \item {the \texttt{LayoutLine} widget} can have multiple children and 
1847 divides its window into as much parts as children, 
1848 each part of equal size. 
1849 The orientation of the \texttt{LayoutSplit} or of the \texttt{LayoutLine}  can be changed by the input \texttt{Orientation}.
1850 See the example \texttt{test/testSizer.bbs}.
1851 With only those two containers you can already create 
1852 complex dialog boxes (of course containers can be nested, which leads to tree-like structures of widgets). \\
1853 See the script \texttt{bbtk/share/bbtk/bbs/wx/appli/ExampleLayoutSplit.bbs} for an example.
1854
1855 \item {The \texttt{LayoutTab}  widget} is based on the \texttt{wxNotebook.}\\
1856 The label of each 'note book' is the name of the object it contains.
1857 \end{itemize}
1858
1859
1860 %=====> TODO \\
1861
1862
1863 %One word about a special widget in the package \texttt{wx} : 
1864 %the \texttt{Button}... to be continued.
1865
1866 % ==========================================
1867 \subsubsection{Deeper in the boxes}
1868 \label{bbi-deep-box}
1869 % ==========================================
1870
1871 Any widget box has two mandatory Inputs :
1872 \begin{itemize}
1873   \item {\bf\emph{BoxExecute}}     : Any signal received by this input executes the box
1874   \item {\bf\emph{BoxProcessMode}} : Sets the processing mode of the box :
1875   \begin{itemize}
1876     \item {\bf\emph{Pipeline}} : bbBackwardUpdate() calls Process() only if Status == MODIFIED \\
1877                                  The box executes itself only when an entry was changed (normal pipeline processing).
1878     \item {\bf\emph{Reactive}} : bbSetModifiedStatus() calls bbUpdate() \\
1879                                  Warning : Re-processed immediately when \emph{any entry} changed.\\
1880                                  To be more selective, better use \texttt{connect A.BoxChange \emph{currentBox}.BoxExecute}.    
1881     \item {\bf\emph{Always}}   : bbUpdate() always calls Process. \\
1882                                  Usefull for 'sources', that must be processed, even when no entry changed (e.g. : FileSelector, ColorSelector)\\
1883                                  This one is not end user intended (for Package developer only)
1884   \end{itemize}   
1885 \end{itemize}
1886
1887 Any widget box has five Inputs, that will be dealt with only if the box is not connected to the \emph{Widget}i of any \emph{Layout box} :  
1888 \begin{itemize}
1889   \item {\bf\emph{WinHeight}} : Height of the window 
1890   \item {\bf\emph{WinWidth}}  : Width of the window  
1891   \item {\bf\emph{WinTitle}}  : Title of the window
1892   \item {\bf\emph{WinClose}}  : Any received signal closes the window
1893   \item {\bf\emph{WinHide}}   : Any received signal hides the window
1894   \item {\bf\emph{WinDialog}} : When set to 'true', creates a \emph{dialog window}, that blocks the pipeline until it is closed (\emph{modal})   
1895 \end{itemize}
1896
1897
1898 Any \emph{Layout box} (i.e. \emph{LayoutLine}, \emph{LayoutSplit} or \emph{LayoutTab}) has at one or more mandatory Inputs :
1899 \begin{itemize}
1900   \item {\bf\emph{Widget}}\texttt{i} : e.g. a \emph{LayoutSplit} box (Widget which splits a window in two resizeable parts) 
1901        has two Input parameters \emph{Widget1} and \emph{Widget2}, used to embed the child windows.\\
1902        e.g. a  \emph{LayoutLine} divides the window in up to 9 (depending on the number of inputs \emph{Widget}i) fixed size parts.  
1903 \end{itemize} 
1904
1905
1906 Any widget box has two mandatory Outputs  :
1907
1908 \begin{itemize}
1909   \item {\bf\emph{Widget}} : that is the \texttt{wxWindow} itself. If it's not connected to the \texttt{Widget}\emph{i} of any \emph{Layout box}, it
1910      will popup. If it's connected to the \texttt{Widget}\texttt{\emph{i}} of any \texttt{Layout box}, it will be embedded in its parent window.
1911   \item {\bf\emph{Boxchange}}  : Signals any modification of the box. This output may be connect if necessary to the \emph{BoxExecute} entry of an other box,
1912    further within the execution pipeline.
1913 \end{itemize}    
1914
1915
1916
1917 % ==========================================
1918 \subsection{More on ...}
1919 \label{bbi-more-on}
1920 % ==========================================
1921
1922 % ==========================================
1923 %\subsubsection{Black box packages}
1924 %\label{bbi-more-on-packages}
1925 % ==========================================
1926 %There are various others user-intended packages :
1927
1928 %\begin{verbatim}
1929 %---> Were moved in a 'Reference Manual' ?\\
1930 %---> Any suggestion welcome!
1931 %\end{verbatim}
1932
1933 %\begin{itemize}
1934 %\item{vtk} \\
1935 %\item{itk} \\
1936 %\item{...} \\
1937 %\end{itemize}
1938 % ==========================================
1939 \subsubsection{Pipeline processing}
1940 \label{bbi-more-on-pipeline-processing}
1941 % ==========================================
1942 \begin{itemize}
1943 \item the ``control'' mechanism in bbi.
1944
1945 When a box is requested to update itself, it asks (recursively) each one of its inputs if it was modified.\\
1946 In normal pipe-line mode, it will be re-processed if at least one of its imputs was actually modified, as the output of a previous box.
1947
1948 (switch exec commands, e.g. Button)
1949 \item the role of ProcessMode to update widgets.
1950 \end{itemize}
1951 % ==========================================
1952 \subsubsection{Complex black boxes}
1953 \label{bbi-more-on-complex-black-boxes}
1954 Creation of complex widgets (containers, contained...)
1955
1956 You can include script files in other script files, 
1957 like in the following example :
1958
1959
1960 \begin{verbatim}
1961 # Defines the Add4 black box which adds 4 doubles 
1962 include Add3
1963 define Add4
1964   author "myself"
1965   description "adds 4 doubles"
1966   new Add3 a
1967   new Add b
1968   connect a.Out b.In1
1969   input In1 a.In1 "first double to add"
1970   input In2 a.In2 "second double to add"
1971   input In3 a.In3 "third double to add"
1972   input In4 b.In2 "fourth double to add"
1973   output Out b.Out "output"
1974 endefine
1975 \end{verbatim}
1976
1977 The inner boxes have they own entries (In1, In2, In3 for box a, In1, In2 for box b )\\
1978 Only the inputs In1, In2, In3 of box a and the input In2 of box b is of interest for the end user, but he dosn't want to have to
1979 care neither about the inner boxes name, nor about the names of their Inputs.\\
1980 The writer of the complex box has the ability to give these inputs a meaningfull name !
1981 \begin{verbatim}
1982   input In3 a.In3 "third double to add"
1983   input In4 b.In2 "fourth double to add"
1984 \end{verbatim}
1985
1986 %\subsubsection{Advanced issues}
1987 %\paragraph{Reducing the number of inputs of a box}
1988
1989 % ==========================================
1990 %\subsubsection{Errors}
1991 %\label{bbi-more-on-errors}
1992
1993 % ==========================================
1994 \subsubsection{Creating and using your own uninstalled version of bbStudio}
1995 \label{bbi-more-on-your_own_version}
1996
1997 Suppose you want to run your own uninstalled version (say : you downloaded and compiled the
1998 cvs version in order to use a recently commited patch, but you want to be able
1999 to still use the standard version).
2000  
2001 You have to :
2002 \begin{itemize} 
2003 \item cvs checkout the sources :
2004 \begin{verbatim}
2005 cvs checkout bbtk
2006 \end{verbatim}
2007 \item 
2008 create a build directory
2009 \begin{verbatim}
2010 mkdir buildBBTK
2011 \end{verbatim}
2012 \item cd in the build directory:
2013 \begin{verbatim}
2014 cd buildBBTK
2015 \end{verbatim}
2016 \item run ccmake.
2017 \begin{verbatim}
2018 ccmake ../bbtk
2019 \end{verbatim}
2020
2021 Don't forget to switch ON the flag \texttt{BBTK\_COMPILE\_DEBUG\_MESSAGE} \\
2022 (see figure : \ref{bb-ccmake})
2023
2024 \begin{figure}[!ht]
2025 \caption{\label{bb-ccmake}Running ccmake}
2026 \begin{center}
2027 \includegraphics[width=0.6\textwidth]{ccmake.png}
2028 \end{center}
2029 \end{figure}
2030
2031 \item As usual, type \texttt{c} until there is no longer any area quoted with a * (or highlighted in red)\\
2032 Ask for generation (type \texttt{g} -once is always enough-)
2033
2034 \item Ask for compilation and link.
2035 \begin{verbatim}
2036 make
2037 \end{verbatim}
2038
2039
2040 The dynamic libraries (\texttt{.dll} or \texttt{.so} and the executable programs will be created in the \texttt{bin}
2041 directory of the built tree.
2042
2043 \item choose to install or not your own version.
2044 \begin{verbatim}
2045 make install
2046 \end{verbatim}
2047 Linux users : Don't forget to \texttt{sudo} before.
2048 \end{itemize}
2049 % ==========================================
2050 \subsubsection{\bbtk configuration file and search paths}
2051 \label{bbi-more-on-configuration}
2052
2053 At start, \bbi tries to open an \texttt{xml} 
2054 configuration file named \texttt{bbtk\_config.xml}. 
2055 The search order is 
2056 \begin{enumerate}
2057 \item The current directory
2058 \item The subdir \texttt{.bbtk} of the user's home directory. 
2059 \begin{itemize} 
2060 \item On \texttt{Unix}, the home directory is the
2061 one stored by the environnement variable \texttt{HOME}, 
2062 typically \texttt{/home/username}.
2063 \item On \texttt{Windows}, the home directory is 
2064 the user's profile directory stored by the environnement 
2065 variable \texttt{USERPROFILE}, 
2066 typically \texttt{C:\\...}.
2067 \end{itemize}
2068 \item If none of these two paths contains the file then it creates 
2069 a new one in the \texttt{.bbtk} directory. 
2070 \end{enumerate}
2071
2072 Once created, you can edit the \texttt{bbtk\_config.xml} file located 
2073 in your \texttt{.bbtk} directory. It contains :
2074
2075 \begin{file}{bbtk\_config.xml}
2076 \begin{verbatim}
2077 <?xml version="1.0" encoding="iso-8859-1"?>
2078 <config>
2079    <description>  </description>
2080    <bbs_path>     </bbs_path>
2081    <package_path> 
2082       /usr/local/lib
2083    </package_path>
2084    <data_path> </data_path>
2085    <default_temp_dir>$</default_temp_dir>
2086 </config>
2087 \end{verbatim}
2088 \end{file}
2089
2090 You can add pathes to 
2091 \begin{itemize}
2092 \item A custom folder in which to search for \texttt{.bbs} scripts (\texttt{include} command of \bbi) by adding an \texttt{xml} tag : 
2093 \texttt{<bbs\_path>complete\_path\_to\_folder<\/bbs\_path>}.
2094 \item A custom folder in which to search for packages (\texttt{load} command of \bbi) by adding an \texttt{xml} tag : 
2095 \texttt{<package\_path>complete\_path\_to\_folder<\/package\_path>}.
2096 \end{itemize}
2097
2098
2099 \newpage
2100
2101 % ==========================================
2102 \subsection{Language reference}
2103 \label{bbi-reference}
2104 % ==========================================
2105
2106
2107 % ==========================================
2108 \subsubsection{Pipeline creation and execution related commands}
2109 \label{bbi-reference-creation-execution}
2110 % ==========================================
2111  See table \ref{bbi-reference-box}
2112
2113 % ==========================================
2114 \begin{table}[!ht]
2115 \caption{\label{bbi-reference-box} \bbi pipeline creation and execution related commands.}
2116 \small
2117 \begin{tabular}{|lcm{6cm}|}
2118 \hline
2119 Command & Parameters & Effect \\ \hline
2120
2121 \texttt{new} & \texttt{<boxtype>} \texttt{<box-name>}& 
2122 Creates a box of type \texttt{boxtype} and name  
2123 \texttt{box-name}.\\ \hline
2124
2125 \texttt{delete} & \texttt{<box-name>} & 
2126 Destroys the box named \texttt{box-name}.\\ \hline 
2127
2128 \texttt{connect} & \texttt{<box1.output>} \texttt{<box2.input>} & 
2129 Connects the output 
2130 \texttt{output} of the box named \texttt{box1} 
2131 to the input \texttt{input} of the box named \texttt{box2} \\ \hline 
2132
2133 \texttt{set} & \texttt{<box.input>} \texttt{<value>} &
2134 Sets the input \texttt{input} of 
2135 the box named \texttt{box} to the value \texttt{value}.
2136 An \texttt{adaptor} must exist
2137 in the packages loaded which converts a \texttt{std::string} 
2138 to the type of the input \texttt{input}. \\ \hline 
2139
2140 \texttt{print} & \texttt{<string>} & 
2141 Prints the string after substituting each token of the form \texttt{\$box.output\$} by the adaptation to string of the value of the 
2142 output \texttt{output} of the box named \texttt{box}. 
2143 An \texttt{adaptor} must exist
2144 in the packages loaded which converts 
2145 the type of the output \texttt{output}
2146 to a \texttt{std::string}.
2147 \\ \hline 
2148
2149 \texttt{exec} & \texttt{<box-name>} & 
2150 Executes the box named \texttt{box-name}.
2151 If needed the boxes 
2152 connected to its inputs 
2153 are also processed recursively (pipeline processing).\\ \hline 
2154 \texttt{exec} & \texttt{freeze} & 
2155  Allows to block execution commands while keeping definition commands active.(This one is not for end user)\\ \hline 
2156 \texttt{exec} & \texttt{unfreeze} & 
2157  Turns back to 'normal' mode (This one is not for end user).\\ \hline 
2158 \end{tabular}
2159 \end{table}
2160 % ==========================================
2161
2162 \newpage
2163
2164 % ==========================================
2165 \subsubsection{Interpreter related commands}
2166 \label{bbi-reference-interpreter}
2167 % ==========================================
2168 See table \ref{tabbbi-reference-interpreter_1} and \ref{tabbbi-reference-interpreter_2}
2169 % ==========================================
2170 \begin{table}[!ht]
2171 \caption{\label{tabbbi-reference-interpreter_1}\bbi intepreter related commands (part 1).}
2172 \small
2173 \begin{tabular}{|lcm{6cm}|}
2174 \hline
2175 Command & Parameters & Effect \\ \hline
2176
2177 \texttt{author} &  \texttt{<author-name>} & 
2178 Adds the string \texttt{<author-name>} to the author information of the black box being defined \\ \hline 
2179
2180 \texttt{category} & \texttt{<category-name>} & 
2181   Adds the string \texttt{<category-name>} to the category information of the black box being defined \\ \hline 
2182
2183 \texttt{help} & - & 
2184 Prints help on available commands \\ \hline 
2185
2186 & \texttt{<command-name>} & 
2187 Prints help on the command \texttt{command-name} \\ \hline 
2188
2189 & \texttt{packages} & 
2190 Prints help on available packages and their box types 
2191 (without description)\\ \hline 
2192
2193 & \texttt{<package-name>} & 
2194 Prints help on the package \texttt{package-name} and its boxes 
2195 (with brief description). 
2196 The package must have been previously loaded \\ \hline 
2197
2198 & \texttt{<box-type>} & 
2199 Prints help (with full description) on the type of box 
2200 \texttt{box-type}. 
2201 The box type must belong to a package which has been previously loaded \\ \hline 
2202
2203 & \texttt{<debug-directive>} & 
2204 [expr|-C|-D] 
2205   Prints debug info on living bbtk objects containing the string \texttt{expr} (default expr=''). 
2206          \texttt{-C} checks the factory integrity.
2207          \texttt{-D} turns on objects debug info after main ends\\ \hline 
2208
2209 \texttt{include} & \texttt{<file-name>} & 
2210 Includes and executes the content of the file named \texttt{file-name} 
2211 exactly like if you were typing its content at the place were the 
2212 \texttt{include} command is. \\ \hline 
2213
2214 \texttt{load} & \texttt{<package-name>} & 
2215 Loads the package \texttt{package-name} (use it only if you know that you won't work with complex black boxes) \\ \hline 
2216
2217 \texttt{include} & \texttt{<package-name>} & 
2218 Loads the package \texttt{package-name} and includes all the complex black boxes that comes with it \\ \hline 
2219
2220 \texttt{kind} & \texttt{<box kind>} & 
2221 Specifies the \texttt{kind} of the complex black boxes you are describing \\ \hline 
2222 \end{tabular}
2223 \end{table}
2224
2225 %
2226 % This arbitrary part1/part2 is to avoid to have all the tables at the end of the docoment ...
2227 %
2228
2229 \begin{table}[!ht]
2230 \caption{\label{tabbbi-reference-interpreter_2}\bbi intepreter related commands (part 2).}
2231 \small
2232 \begin{tabular}{|lcm{6cm}|}
2233 \hline
2234 Command & Parameters & Effect \\ \hline
2235 \texttt{unload} & \texttt{<package-name>}& 
2236 Unloads the package \texttt{package-name}. 
2237 The package must have been previously loaded. 
2238 No box of a type defined in this package must still exist.\\ \hline 
2239
2240 \texttt{message} & \texttt{<category>} \texttt{<level>} & 
2241 Sets the level of verbosity of \bbi for the category of messages 
2242 \texttt{category} to \texttt{level}.\\ \hline 
2243 %See \ref{verbosity}.
2244
2245 \texttt{config} & - & Displays the Configuration parameters\\ \hline 
2246
2247 \texttt{reset} & - & Deletes all boxes and unloads all packages so 
2248 that \bbi gets back to its initial state \\ \hline 
2249
2250 \texttt{quit} & - & Exits the interpreter (Don't use it under \bbStudions)\\ \hline 
2251
2252 \end{tabular}
2253 \end{table}
2254 % ==========================================
2255
2256 \newpage
2257
2258 % ==========================================
2259 \subsubsection{Complex black box definition related commands}
2260 \label{bbi-reference-black-box-definition}
2261 % ==========================================
2262
2263 See table \ref{bbi-reference-complex-box} 
2264 % ==========================================
2265 \begin{table}[!ht]
2266 \caption{\label{bbi-reference-complex-box} \bbi complex black box definition related commands.}
2267 \small
2268 \begin{tabular}{|lcm{6cm}|}
2269 \hline
2270 Command & Parameters & Effect \\ \hline
2271
2272
2273 \texttt{define} & \texttt{<box-type>} & 
2274 Starts the definition of a complex black box of type  
2275 \texttt{box-type}\\ \hline 
2276
2277 \texttt{endefine} & - & 
2278 Ends the definition of a complex black box type\\ \hline 
2279
2280 \texttt{author} & \texttt{<string>} & 
2281 Sets the author(s) of the complex black box currently being defined \\ \hline 
2282
2283 \texttt{description} & \texttt{<string>} & 
2284 Sets the description of the complex black box currently being defined \\ \hline 
2285
2286 \texttt{input} & \texttt{<name>} \texttt{<box.input>} \texttt{<help>} & 
2287 Defines a new input for the current complex black box, 
2288 named \texttt{name}. 
2289 It is defined as corresponding to 
2290 the input \texttt{input} of the box \texttt{box}.
2291  
2292 \texttt{<help>} is the help string for the new input.
2293 The box \texttt{box} must already have been created in the complex box 
2294 and of course have an input named \texttt{input}.\\ \hline 
2295
2296 \texttt{output} & \texttt{<name>} \texttt{<box.output>} \texttt{<help>} & 
2297 Defines a new output for the current complex black box, 
2298 named \texttt{name}. 
2299 It is defined as corresponding to 
2300 the output \texttt{output} of the box \texttt{box}. 
2301 \texttt{<help>} is the help string for the new output.
2302 The box \texttt{box} must already have been created in the complex box and of course have an output named \texttt{output}. \\ \hline 
2303
2304
2305 \end{tabular}
2306 \end{table}
2307 % ==========================================
2308
2309 \newpage
2310
2311 % ==========================================
2312 %\vspace{0.5cm}\hrule \\
2313
2314
2315
2316 % ==========================================
2317 %\vspace{0.5cm}\hrule \\
2318
2319 \section{Using third party Package}
2320 \label{Third_Party_Package}
2321 % ==========================================
2322
2323 % ==========================================
2324 \subsection{The configuration file}
2325 \label{The_configuration_file}
2326 % ==========================================
2327
2328 First, have a glance at the Configuration,  just clicking on \texttt{Config} button of the \texttt{Command} part toolbar.
2329
2330 You'll get something like :
2331
2332 \begin{verbatim}
2333 =============
2334  Configuration
2335  =============
2336  bbtk_config.xml    : [/home/jpr/Creatis/bbtk/binLIN/bin/bbtk_config.xml]
2337  Documentation Path : [/home/jpr/Creatis/bbtk/binLIN/bin/../share/bbtk/doc]
2338  Data Path          : [/home/jpr/Creatis/bbtk/binLIN/bin/../share/bbtk/data]
2339  Temp Directory     : [/home/jpr/Creatis/bbtk/binLIN]
2340  File Separator     : [/]
2341  BBS Paths   
2342  --- [.]
2343  --- [/home/jpr/Creatis/bbtk/binLIN/bin/../share/bbtk/bbs]
2344  --- [/home/jpr/Creatis/bbtk/binLIN/share/bbtk/bbs]
2345  PACKAGE Paths : 
2346  --- [.]
2347  --- [/home/jpr/Creatis/bbtk/binLIN/bin]
2348  --- [/home/jpr/Creatis/bbtk/binLIN/bin/../lib]
2349  --- [/home/jpr/Creatis/bbtk/binLIN/bin]
2350  --- [/home/jpr/Creatis/bbtk/binLIN/bin\Debug]
2351  --- [/home/jpr/Creatis/bbtk/binLIN/bin\Release] 
2352 \end{verbatim}
2353
2354 (depending on who you are, and whether \texttt{bbStudio} is installed or not.)\\
2355
2356 Note the two main parts : \texttt{BBS Paths} and \texttt{PACKAGE Paths}
2357
2358 To use a third party Package, you will have to update the \emph{bbtk\_config.xml} file.\\
2359
2360 Just use the \texttt{Open bbtk Config file} option of the \texttt{Files} of the \bbStudio menu.
2361
2362 You will get something like :
2363 \begin{verbatim}
2364 <config>
2365   <description> Sets the search directories in the build tree </description>
2366   <url> </url>
2367   <bbs_path> /home/jpr/Creatis/bbtk/binLIN/share/bbtk/bbs </bbs_path>
2368   <package_path> /home/jpr/Creatis/bbtk/binLIN/bin </package_path> 
2369 # For windows
2370   <package_path> /home/jpr/Creatis/bbtk/binLIN/bin\Debug </package_path> 
2371   <package_path> /home/jpr/Creatis/bbtk/binLIN/bin\Release </package_path> 
2372 #
2373   <data_path> </data_path>
2374
2375   <default_temp_dir>  /home/jpr/Creatis/bbtk/binLIN </default_temp_dir>   
2376 </config>
2377 \end{verbatim}
2378
2379 %\begin{itemize}
2380 %\item {
2381 After the already existing tags 
2382 %bbs\_path
2383 \texttt{bbs\_path}
2384  (i.e. the lines begining by 
2385  \texttt{bbs\_path} 
2386  %bbs_path
2387 and ending by 
2388 \texttt{/bbs\_path})
2389
2390 %/bbs_path})
2391  add a new one with the name of the directory that contains the 
2392  \texttt{.bbs} scripts of the package you
2393 want to use.\\
2394 x
2395 %\item {
2396 After the already existing tags \texttt{package\_path} (i.e. the lines begining by \texttt{package\_path}
2397  and ending by \texttt{/package\_path})
2398  add a new one with the name of the directory that contains the the dynamic libraries
2399  (\texttt{.dll} or \texttt{.so}) of the package you want to use.
2400
2401 %\end{itemize}
2402 % ==========================================
2403 \subsection{Updating the documentation}
2404 \label{Updating_the_documentation}
2405 % ==========================================
2406 If you want (and sure you will) to be able to use the Help tools as well as the features provided by this package,
2407  you must use the
2408 option \texttt{Regenerate package doc}  in the menu \texttt{Tools} of \texttt{bbStudio}.\\
2409 You'll be prompted for the Package name. Avoid using the \texttt{-a} option (Regenerate all), since it's time consumming.
2410
2411 If you want (and sure you will) to benefit the features of Box indexing
2412  you must use the
2413 option \texttt{Regenerate Boxes Lists}  in the menu \texttt{Tools} of \texttt{bbStudio}.\\
2414
2415
2416 % ==========================================
2417 \subsection{Using the package}
2418 \label{Using_the_package}
2419 % ==========================================
2420
2421 The only thing you have to do is to \texttt{load} the package, within the script, or from the
2422 \texttt{Command} part, and enjoy the black boxes it contains.
2423
2424 % ==========================================
2425 \subsection{Packages you'll probably want to use }
2426 \label{Packages_you_ll_want_to_use}
2427 % ==========================================
2428 \begin {itemize}
2429
2430 \item{creaContours}\\
2431 Provides sophisticated widgets for managing 3D R.O.I. (Regions od interest)
2432 \item{creaImageIO}
2433 Allows browsing, selectionning, ordering directories containing images of almost any type
2434 (including DICOM)
2435  
2436 % ==========================================
2437 %\vspace{0.5cm}\hrule \\
2438 \section{Using black boxes in \CPP programs}
2439 \label{cpp}
2440 % ==========================================
2441
2442 A very useful feature is that you may use any black box within a \CPP program without worrying about \texttt{wxWigets} main window.\\
2443
2444 Let's look a the following bbs script :
2445
2446 \begin{verbatim}
2447 # Load the packages
2448 load std
2449 load wx
2450
2451 # Create the Objects
2452 new Slider     slider
2453 new OutputText text
2454 new LayoutLine layout
2455
2456 # Graphical pipeline
2457 connect slider.Widget    layout.Widget1
2458 connect text.Widget      layout.Widget2
2459
2460 # Execution pipeline
2461 connect slider.BoxChange text.BoxExecute
2462 connect slider.Out       text.In
2463
2464 # Go!
2465 exec layout
2466 \end{verbatim}
2467
2468 User wants to create a slider and an output text, within a LayoutLine, and display the slider value in the output text.\\ 
2469 Think about the (little!) nightmare to code the same, in 'raw C++', using wxWidgets.\\
2470
2471 Using the standalone application \text{bbc} you just 'convert' the script.
2472
2473 \begin{verbatim}
2474
2475 #include <bbwxSlider.h>
2476 #include <bbwxOutputText.h>
2477 #include <bbtkFactory.h>
2478 #include <bbwxLayoutLine.h>
2479
2480 int main(int argv, char* argc[])
2481 {
2482       // we need to intanciate a bbtk::Factory to be aware of the adaptors
2483       bbtk::Factory::Pointer factory = bbtk::Factory::New();
2484       
2485       // Load the packages
2486       // ----------------  
2487       factory->LoadPackage("std");
2488       factory->LoadPackage("wx");
2489       
2490       // Create the Objects
2491       // ------------------      
2492       bbwx::Slider::Pointer     slider   = bbwx::Slider::New("slider");
2493       bbwx::OutputText::Pointer text     = bbwx::OutputText::New("text");
2494       bbwx::LayoutLine::Pointer layout   = bbwx::LayoutLine::New("layout");
2495       
2496       // Graphical pipeline
2497       bbtk::Connection::Pointer c1       = bbtk::Connection::New(slider,"Widget",
2498                                                            layout,"Widget1");
2499                                                            
2500       bbtk::Connection::Pointer c2       = bbtk::Connection::New(text,"Widget",
2501                                                            layout,"Widget2");
2502                                                                                                                                                                            
2503       // Execution pipeline
2504       // ------------------
2505       
2506       // We have to pass the 'factory', in order to call automatically an adaptor,
2507       // if necessary.
2508       bbtk::Connection::Pointer s2t      = bbtk::Connection::New(slider,"Out",
2509                                                             text,"In",
2510                                                             factory);      
2511        bbtk::Connection::Pointer c3       = bbtk::Connection::New(slider,"BoxChange",
2512                                                             text,"BoxExecute");      
2513       layout->bbSetInputWinDialog(true);
2514       
2515       // Go!
2516       // ---     
2517       layout->bbExecute();
2518
2519     }
2520   catch (bbtk::Exception e)
2521     {
2522       bbtk::MessageManager::SetMessageLevel("Error",1);
2523       e.Print();
2524     }
2525 }
2526 \end{verbatim}
2527
2528 %\bibliography{all}
2529
2530 \section{Install and run time issues}
2531
2532 \begin {itemize}
2533 \item{make} \\
2534 For some strange reasons (?!?), at \texttt{cmake} time, you may be warned that an error occured while documentation generation.\\
2535 Take it easy, \texttt{make} again!\\
2536
2537 \item{\bbStudio} is written using the Advanced User Interface library of wxWidgets.
2538 If, after some hazardous floating/docking operations onto the frame, you feel
2539 very unhappy with the result, just remove from the hidden directory
2540 \texttt{.bbtk} the file named \texttt{bbStudio.aui}. \\ 
2541
2542  
2543 \end {itemize}
2544
2545 %\section{Conclusion}
2546
2547
2548 \end{document}
2549