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