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