]> Creatis software - bbtkGEditor.git/blob - lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/InterpreterBBS.h
no message
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsWxGUIEditorGraphic / InterpreterBBS.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 #include "wxVtkSceneManager.h"
43
44 //Includes bbtk
45 #include "bbtkInterpreter.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 namespace bbtk
58 {
59
60         class InterpreterBBS : public Interpreter 
61         {
62                 public:
63                 static Pointer New( wxVtkSceneManager* sceneManager, Factory::Pointer factory );
64                 InterpreterBBS( wxVtkSceneManager* sceneManager, Factory::Pointer factory );
65                 ~InterpreterBBS();
66                 
67                 //Public methods
68
69                 
70                 void InterpreterBBS::commandNew( const std::string& boxType, const std::string& boxName);
71                 void InterpreterBBS::commandConnect (const std::string &boxfrom,
72                                                                                          const std::string &output,
73                                                                                          const std::string &boxto,
74                                                                                          const std::string &input);
75                 void InterpreterBBS::commandSet (const std::string &box, 
76                                                                                  const std::string &input, 
77                                                                                  const std::string &value);
78                 void InterpreterBBS::commandLoad(const std::string &name );
79                 void InterpreterBBS::commandInclude(const std::string &name );
80                 
81                 
82                 
83                 /*
84 //--EED
85                 
86                 /// Sets the inputs of the workspace : 
87                 virtual void SetInputs(const std::map<std::string,std::string>& m);
88                 
89                 /// Puts the executer in "no exec" mode, 
90                 /// which creates but does not execute pipelines 
91                 virtual void SetNoExecMode(bool b);
92                 
93                 virtual bool GetNoExecMode() const;
94                 
95                 /// Sets the mode of dialog of the executer for Root inputs 
96                 virtual void SetDialogMode(DialogModeType t);
97                 
98                 /// Puts the executer in "no error" mode, 
99                 /// Errors do not stop execution (but warnings are produced)
100                 virtual void SetNoErrorMode(bool b) ;
101                 virtual bool GetNoErrorMode() const ;
102                 //=================================================================
103                 /// Loads a package
104                 virtual void LoadPackage(const std::string &name ) ;
105                 
106                 /// Unloads a package
107                 virtual void UnLoadPackage(const std::string &name );
108                 
109                 /// Starts a package block      
110                 virtual void BeginPackage (const std::string &name );
111                 
112                 /// Ends a package block
113                 virtual void EndPackage ();
114                 
115                 /// Starts the definition of a new ComplexBlackBox in package pack
116                 /// scriptfilename is the file from which the def is read
117                 virtual void Define (const std::string &name,
118                                                          const std::string& pack,
119                                                          const std::string &scriptfilename);
120                 
121                 /// Sets the file name to use for the current definition
122                 /// (Used to set it after the Define command)
123                 virtual void SetCurrentFileName (const std::string &name );
124                 
125                 /// End the definition of a ComplexBlackBox
126                 virtual void EndDefine () ;
127                 
128                 /// Sets the kind of the currently defined ComplexBlackBox
129                 virtual void Kind(const std::string& kind);
130                 
131                 /// Creates a new black box in current complex box
132                 virtual void Create ( const std::string& boxType, const std::string&
133                                                          boxName);
134                 
135                 /// Destroys a black box
136                 virtual void Destroy (const std::string &boxName);
137                 
138                 /// Clears the currently defined ComplexBlackBox
139                 virtual void Clear() ;
140                 
141                 /// Connects the output boxOutput to the input boxInput
142                 virtual void Connect (const std::string &boxfrom,
143                                                           const std::string &output,
144                                                           const std::string &boxto,
145                                                           const std::string &input) ;
146                 
147                 /// Executes the box 
148                 virtual void Execute (const std::string &box) ;
149                 
150                 /// Defines an input of the current complex box
151                 virtual void DefineInput (const std::string &name,
152                                                                   const std::string &box,
153                                                                   const std::string &input,
154                                                                   const std::string &help) ;
155                 
156                 /// Defines an output of the current complex box
157                 virtual void DefineOutput (const std::string &name,
158                                                                    const std::string &box,
159                                                                    const std::string &output,
160                                                                    const std::string &help);
161                 
162                 /// sets the input of the box with the value
163                 virtual void Set (const std::string &box, 
164                                                   const std::string &input, 
165                                                   const std::string &value);
166                 
167                 /// gets the output of the box
168                 virtual std::string Get (const std::string &box, 
169                                                                  const std::string &output) ;
170                 
171                 /// changes the workspace name
172                 virtual void SetWorkspaceName( const std::string& n );
173                 
174                 ///Adds the authorName to the Box author list
175                 virtual void Author(const std::string &authorName);
176                 
177                 ///Adds the categories to the Box categoris list
178                 virtual void Category(const std::string &categories);
179                 
180                 /// The description string which explains what does the ComplexBox
181                 virtual void Description(const std::string &d);
182                 
183                 /// prints the list of the boxes of the current box
184                 virtual void PrintHelpListBoxes();
185                 
186                 /// Generate a HTML file with a gif file with the actual pipeline (Graphviz-dot needed). Returns the file path
187                 virtual std::string ShowGraph(const std::string &nameblackbox, 
188                                                                           const std::string &detailStr, 
189                                                                           const std::string &levelStr,
190                                                                           const std::string &output_file,
191                                                                           const std::string &custom_header,
192                                                                           const std::string &custom_title,
193                                                                           bool system_display = true);
194                 
195                 /// Generate a HTML with a gif file with the actual pipeline (Graphviz-dot needed). Returns the file path
196                 virtual std::string ShowGraphInstances(const std::string &nameblackbox, int detail, int level, bool system_display=true) ;
197                 
198                 /// Prints help on a black box
199                 virtual void PrintHelpBlackBox(const std::string &nameblackbox, const std::string &detailStr, const std::string &levelStr);
200                 
201                 virtual void Reset();
202                 
203                 /// Sets the level of message for kind
204                 virtual void SetMessageLevel(const std::string &kind, int level);
205                 
206                 /// Prints help on the messages
207                 virtual void HelpMessages();
208                 
209                 /// Prints the string ... MORE : TO EXPLAIN 
210                 virtual void Print(const std::string & message);
211                 
212 //--EED         
213 */
214                 
215                 double                          _xGeneral;
216                 double                          _yGeneral;
217                 double                          _zGeneral;
218                 wxVtkSceneManager       *_sceneManager;
219                 Factory::Pointer        _factory;
220                 
221         private:
222
223                 //Private Attributes
224
225
226                 //Private Methods
227
228         protected:
229
230                 //Protected Attributes
231
232                 //Protected methods
233                 
234         };
235
236
237 }
238 // namespace bbtk
239 #endif
240