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