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