]> Creatis software - bbtkGEditor.git/blob - lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/InterpreterBBS.cxx
no message
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsWxGUIEditorGraphic / InterpreterBBS.cxx
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 *  \file 
33 *  \brief Class bbtk::InterpreterBBS 
34 */
35
36
37 #include "InterpreterBBS.h"
38
39 #include "bbtkExecuter.h"
40 #include "bbtkMessageManager.h"
41 #include "bbtkFactory.h"
42 #include "bbtkUtilities.h"
43
44
45
46 namespace bbtk
47 {
48
49         
50
51         InterpreterBBS::Pointer InterpreterBBS::New( wxVtkSceneManager* sceneManager,  Factory::Pointer factory )
52         {
53                      return MakePointer( new InterpreterBBS( sceneManager, factory) );
54         }
55
56         
57         //=========================================================================
58
59         InterpreterBBS::InterpreterBBS( wxVtkSceneManager* sceneManager, Factory::Pointer factory )
60         {               
61                 _factory                = factory;
62                 _sceneManager   = sceneManager;
63                 
64                 _xGeneral               = 10;
65                 _yGeneral               = 10;
66                 _zGeneral               = 900;   //  ?????
67                 
68                 bbtk::InterpreterVirtual::Init();
69                 
70         }
71
72         //=========================================================================
73
74         InterpreterBBS::~InterpreterBBS()
75         {
76         }
77
78         //=========================================================================
79         
80         
81         /// Creates a new black box in current complex box
82     void InterpreterBBS::commandNew( const std::string& boxType, const std::string& boxName)
83         {
84                 std::string packagename = _factory->GetPackageNameOfaBlackBox(boxType);
85                 int idBox                               = _sceneManager->createGBlackBox( 0,0, packagename ,boxType);
86                 _sceneManager->configGBlackBox(idBox, _xGeneral,_yGeneral,_zGeneral,boxName, false , _xGeneral+100, _yGeneral-10 , _zGeneral );
87                 _yGeneral = _yGeneral + 30;
88                 printf("EED InterpreterBBS::Create  packagename=%s    boxtype=%s   boxname=%s \n", packagename.c_str(), boxType.c_str(), boxName.c_str() );     
89         }
90         
91         /// Connects the output boxOutput to the input boxInput
92     void InterpreterBBS::commandConnect (const std::string &boxfrom,
93                                                                   const std::string &output,
94                                                                   const std::string &boxto,
95                                                                   const std::string &input)
96         {
97                 printf("EED InterpreterBBS::Connect\n");
98         }
99         
100         
101         /// sets the input of the box with the value
102     void InterpreterBBS::commandSet (const std::string &box, 
103                                                           const std::string &input, 
104                                                           const std::string &value)
105         {
106                 printf("EED InterpreterBBS::Set\n");
107         }
108         
109
110         
111         /// Loads a package
112     void InterpreterBBS::commandLoad(const std::string &name )
113         {
114         }
115         
116     /// Unloads a package
117     void InterpreterBBS::commandInclude(const std::string &name )
118         {
119         }
120         
121         
122 /*      
123 //--EED
124     /// Sets the inputs of the workspace : 
125     void InterpreterBBS::SetInputs(const std::map<std::string,std::string>& m)
126         {
127         }
128         
129     /// Puts the executer in "no exec" mode, 
130     /// which creates but does not execute pipelines 
131     void InterpreterBBS::SetNoExecMode(bool b)
132         {
133         }
134         
135     bool InterpreterBBS::GetNoExecMode() const
136         {
137                 return true;
138         }
139         
140     /// Sets the mode of dialog of the executer for Root inputs 
141     void InterpreterBBS::SetDialogMode(DialogModeType t)
142         {
143         }
144         
145     /// Puts the executer in "no error" mode, 
146     /// Errors do not stop execution (but warnings are produced)
147     void InterpreterBBS::SetNoErrorMode(bool b)
148         {
149         }
150         
151     bool InterpreterBBS::GetNoErrorMode() const 
152         {
153                 return true;
154         }
155         
156         /// Loads a package
157     void InterpreterBBS::LoadPackage(const std::string &name )
158         {
159         }
160         
161     /// Unloads a package
162     void InterpreterBBS::UnLoadPackage(const std::string &name )
163         {
164         }
165         
166     /// Starts a package block  
167     void InterpreterBBS::BeginPackage (const std::string &name )
168         {
169         }
170         
171     /// Ends a package block
172     void InterpreterBBS::EndPackage ()
173         {
174         }
175         
176     /// Starts the definition of a new ComplexBlackBox in package pack
177     /// scriptfilename is the file from which the def is read
178     void InterpreterBBS::Define (const std::string &name,
179                                                  const std::string& pack,
180                                                  const std::string &scriptfilename)
181         {
182         }
183         
184     /// Sets the file name to use for the current definition
185     /// (Used to set it after the Define command)
186     void InterpreterBBS::SetCurrentFileName (const std::string &name )
187         {
188         }
189         
190     /// End the definition of a ComplexBlackBox
191     void InterpreterBBS::EndDefine ()
192         {
193         }
194         
195     /// Sets the kind of the currently defined ComplexBlackBox
196     void InterpreterBBS::Kind(const std::string& kind)
197         {
198         }
199         
200     /// Creates a new black box in current complex box
201     void InterpreterBBS::Create ( const std::string& boxType, const std::string& boxName)
202         {
203                 std::string packagename = _factory->GetPackageNameOfaBlackBox(boxType);
204 //              int idBox                               = _sceneManager->createGBlackBox( 0,0, packagename ,boxType);
205 //              _sceneManager->configGBlackBox(idBox, _xGeneral,_yGeneral,_zGeneral,boxName, false , _xGeneral+100, _yGeneral-10 , _zGeneral );
206                 _yGeneral = _yGeneral + 30;
207                 printf("EED InterpreterBBS::Create  packagename=%s    boxtype=%s   boxname=%s \n", packagename.c_str(), boxType.c_str(), boxName.c_str() );     
208         }
209         
210     /// Destroys a black box
211     void InterpreterBBS::Destroy (const std::string &boxName)
212         {
213         }
214         
215     /// Clears the currently defined ComplexBlackBox
216     void InterpreterBBS::Clear()
217         {
218         }
219         
220     /// Connects the output boxOutput to the input boxInput
221     void InterpreterBBS::Connect (const std::string &boxfrom,
222                                                   const std::string &output,
223                                                   const std::string &boxto,
224                                                   const std::string &input)
225         {
226                 printf("EED InterpreterBBS::Connect\n");
227         }
228         
229     /// Executes the box 
230     void InterpreterBBS::Execute (const std::string &box)
231         {
232         }
233         
234     /// Defines an input of the current complex box
235     void InterpreterBBS::DefineInput (const std::string &name,
236                                                           const std::string &box,
237                                                           const std::string &input,
238                                                           const std::string &help)
239         {
240         }
241         
242     /// Defines an output of the current complex box
243     void InterpreterBBS::DefineOutput (const std::string &name,
244                                                            const std::string &box,
245                                                            const std::string &output,
246                                                            const std::string &help)
247         {
248         }
249         
250     /// sets the input of the box with the value
251     void InterpreterBBS::Set (const std::string &box, 
252                                           const std::string &input, 
253                                           const std::string &value)
254         {
255                 printf("EED InterpreterBBS::Set\n");
256         }
257         
258     /// gets the output of the box
259     std::string InterpreterBBS::Get (const std::string &box, 
260                                                          const std::string &output)
261         {
262                 return "";
263         }
264         
265     /// changes the workspace name
266     void InterpreterBBS::SetWorkspaceName( const std::string& n )
267         {
268         }
269         
270     ///Adds the authorName to the Box author list
271     void InterpreterBBS::Author(const std::string &authorName)
272         {
273         }
274         
275     ///Adds the categories to the Box categoris list
276     void InterpreterBBS::Category(const std::string &categories)
277         {
278         }
279         
280     /// The description string which explains what does the ComplexBox
281     void InterpreterBBS::Description(const std::string &d)
282         {
283         }
284         
285     /// prints the list of the boxes of the current box
286     void InterpreterBBS::PrintHelpListBoxes()
287         {
288         }
289         
290         /// Generate a HTML file with a gif file with the actual pipeline (Graphviz-dot needed). Returns the file path
291     std::string InterpreterBBS::ShowGraph(const std::string &nameblackbox, 
292                                                                   const std::string &detailStr, 
293                                                                   const std::string &levelStr,
294                                                                   const std::string &output_file,
295                                                                   const std::string &custom_header,
296                                                                   const std::string &custom_title,
297                                                                   bool system_display)
298         {
299                 return "";
300         }
301         
302         /// Generate a HTML with a gif file with the actual pipeline (Graphviz-dot needed). Returns the file path
303     std::string InterpreterBBS::ShowGraphInstances(const std::string &nameblackbox, int detail, int level, bool system_display)
304         {
305                 return "";
306         }
307         
308     /// Prints help on a black box
309     void InterpreterBBS::PrintHelpBlackBox(const std::string &nameblackbox, const std::string &detailStr, const std::string &levelStr)
310         {
311         }
312         
313     void InterpreterBBS::Reset()
314         {
315         }
316         
317     /// Sets the level of message for kind
318     void InterpreterBBS::SetMessageLevel(const std::string &kind, int level)
319         {
320         }
321         
322     /// Prints help on the messages
323     void InterpreterBBS::HelpMessages()
324         {
325         }
326         
327     /// Prints the string ... MORE : TO EXPLAIN 
328     void InterpreterBBS::Print(const std::string & message)
329         {
330         }
331         
332 //--EED
333 */
334
335 }  // EO namespace bbtk
336
337 // EOF
338