]> Creatis software - bbtkGEditor.git/blob - lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/ExecuterBBSG.h
4b0b018dc0bebd88364b8cd7ff302e02048499bf
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsWxGUIEditorGraphic / ExecuterBBSG.h
1 /*=========================================================================                                                                               
2 Program:   bbtk
3 Module:    $RCSfile$
4 Language:  C++
5 Date:      $Date$
6 Version:   $Revision$
7 =========================================================================*/
8
9 /* ---------------------------------------------------------------------
10
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
13 *
14 *  This software is governed by the CeCILL-B license under French law and 
15 *  abiding by the rules of distribution of free software. You can  use, 
16 *  modify and/ or redistribute the software under the terms of the CeCILL-B 
17 *  license as circulated by CEA, CNRS and INRIA at the following URL 
18 *  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
19 *  or in the file LICENSE.txt.
20 *
21 *  As a counterpart to the access to the source code and  rights to copy,
22 *  modify and redistribute granted by the license, users are provided only
23 *  with a limited warranty  and the software's author,  the holder of the
24 *  economic rights,  and the successive licensors  have only  limited
25 *  liability. 
26 *
27 *  The fact that you are presently reading this means that you have had
28 *  knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */                                                                         
30
31
32 /****
33 * Design and Developpement of BBTK GEditor
34 * Ricardo A Corredor J <eduardo.davila@creatis.insa-lyon.fr>
35 * RaC - 2010
36 ****/
37
38 #ifndef __ExecuterBBSG_h__
39 #define __ExecuterBBSG_h__
40
41 //Includes same project
42 //..
43
44 //Includes bbtk
45 #include "bbtkVirtualExec.h"
46
47 //Includes std
48 #include <iostream>
49
50
51 #include "bbtkSystem.h"
52 #include "bbtkComplexBlackBox.h"
53 #include "bbtkFactory.h"
54
55
56
57
58
59 /*
60 namespace bbtk
61 {
62         
63         class Interpreter;
64         
65         
66         class  Executer : public VirtualExec
67                 {
68                         BBTK_OBJECT_INTERFACE(Executer);
69                         typedef VirtualExec Superclass;
70                 public:
71                         static Pointer New();
72 */
73
74
75
76
77 namespace bbtk
78 {
79
80         class EExecuterBBSG : public VirtualExec 
81         {
82 //              BBTK_OBJECT_INTERFACE(EExecuterBBSG);
83 //              typedef VirtualExec Superclass;
84                 public:
85                 static Pointer New();
86 //                      Pointer New();
87                 EExecuterBBSG();
88                 ~EExecuterBBSG();
89                 
90                 //Public methods
91
92 //--EED
93                 
94                 /// Sets the inputs of the workspace : 
95                 virtual void SetInputs(const std::map<std::string,std::string>& m);
96                 
97                 /// Puts the executer in "no exec" mode, 
98                 /// which creates but does not execute pipelines 
99                 virtual void SetNoExecMode(bool b);
100                 
101                 virtual bool GetNoExecMode() const;
102                 
103                 /// Sets the mode of dialog of the executer for Root inputs 
104                 virtual void SetDialogMode(DialogModeType t);
105                 
106                 /// Puts the executer in "no error" mode, 
107                 /// Errors do not stop execution (but warnings are produced)
108                 virtual void SetNoErrorMode(bool b) ;
109                 virtual bool GetNoErrorMode() const ;
110                 //=================================================================
111                 /// Loads a package
112                 virtual void LoadPackage(const std::string &name ) ;
113                 
114                 /// Unloads a package
115                 virtual void UnLoadPackage(const std::string &name );
116                 
117                 /// Starts a package block      
118                 virtual void BeginPackage (const std::string &name );
119                 
120                 /// Ends a package block
121                 virtual void EndPackage ();
122                 
123                 /// Starts the definition of a new ComplexBlackBox in package pack
124                 /// scriptfilename is the file from which the def is read
125                 virtual void Define (const std::string &name,
126                                                          const std::string& pack,
127                                                          const std::string &scriptfilename);
128                 
129                 /// Sets the file name to use for the current definition
130                 /// (Used to set it after the Define command)
131                 virtual void SetCurrentFileName (const std::string &name );
132                 
133                 /// End the definition of a ComplexBlackBox
134                 virtual void EndDefine () ;
135                 
136                 /// Sets the kind of the currently defined ComplexBlackBox
137                 virtual void Kind(const std::string& kind);
138                 
139                 /// Creates a new black box in current complex box
140                 virtual void Create ( const std::string& boxType, const std::string&
141                                                          boxName);
142                 
143                 /// Destroys a black box
144                 virtual void Destroy (const std::string &boxName);
145                 
146                 /// Clears the currently defined ComplexBlackBox
147                 virtual void Clear() ;
148                 
149                 /// Connects the output boxOutput to the input boxInput
150                 virtual void Connect (const std::string &boxfrom,
151                                                           const std::string &output,
152                                                           const std::string &boxto,
153                                                           const std::string &input) ;
154                 
155                 /// Executes the box 
156                 virtual void Execute (const std::string &box) ;
157                 
158                 /// Defines an input of the current complex box
159                 virtual void DefineInput (const std::string &name,
160                                                                   const std::string &box,
161                                                                   const std::string &input,
162                                                                   const std::string &help) ;
163                 
164                 /// Defines an output of the current complex box
165                 virtual void DefineOutput (const std::string &name,
166                                                                    const std::string &box,
167                                                                    const std::string &output,
168                                                                    const std::string &help);
169                 
170                 /// sets the input of the box with the value
171                 virtual void Set (const std::string &box, 
172                                                   const std::string &input, 
173                                                   const std::string &value);
174                 
175                 /// gets the output of the box
176                 virtual std::string Get (const std::string &box, 
177                                                                  const std::string &output) ;
178                 
179                 /// changes the workspace name
180                 virtual void SetWorkspaceName( const std::string& n );
181                 
182                 ///Adds the authorName to the Box author list
183                 virtual void Author(const std::string &authorName);
184                 
185                 ///Adds the categories to the Box categoris list
186                 virtual void Category(const std::string &categories);
187                 
188                 /// The description string which explains what does the ComplexBox
189                 virtual void Description(const std::string &d);
190                 
191                 /// prints the list of the boxes of the current box
192                 virtual void PrintHelpListBoxes();
193                 
194                 /// Generate a HTML file with a gif file with the actual pipeline (Graphviz-dot needed). Returns the file path
195                 virtual std::string ShowGraph(const std::string &nameblackbox, 
196                                                                           const std::string &detailStr, 
197                                                                           const std::string &levelStr,
198                                                                           const std::string &output_file,
199                                                                           const std::string &custom_header,
200                                                                           const std::string &custom_title,
201                                                                           bool system_display = true);
202                 
203                 /// Generate a HTML with a gif file with the actual pipeline (Graphviz-dot needed). Returns the file path
204                 virtual std::string ShowGraphInstances(const std::string &nameblackbox, int detail, int level, bool system_display=true) ;
205                 
206                 /// Prints help on a black box
207                 virtual void PrintHelpBlackBox(const std::string &nameblackbox, const std::string &detailStr, const std::string &levelStr);
208                 
209                 virtual void Reset();
210                 
211                 /// Sets the level of message for kind
212                 virtual void SetMessageLevel(const std::string &kind, int level);
213                 
214                 /// Prints help on the messages
215                 virtual void HelpMessages();
216                 
217                 /// Prints the string ... MORE : TO EXPLAIN 
218                 virtual void Print(const std::string & message);
219                 
220 //--EED         
221                 
222                 
223         private:
224
225                 //Private Attributes
226
227
228                 //Private Methods
229
230         protected:
231
232                 //Protected Attributes
233
234                 //Protected methods
235                 
236         };
237
238
239 }
240 // namespace bbtk
241 #endif
242