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