1 /*=========================================================================
7 =========================================================================*/
9 /* ---------------------------------------------------------------------
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
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.
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
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 * ------------------------------------------------------------------------ */
33 * Design and Developpement of BBTK GEditor
34 * Ricardo A Corredor J <eduardo.davila@creatis.insa-lyon.fr>
38 #ifndef __ExecuterBBSG_h__
39 #define __ExecuterBBSG_h__
41 //Includes same project
42 #include "wxVtkSceneManager.h"
45 #include "bbtkVirtualExec.h"
51 #include "bbtkSystem.h"
52 #include "bbtkComplexBlackBox.h"
53 #include "bbtkFactory.h"
60 class EExecuterBBSG : public VirtualExec
63 static Pointer New( wxVtkSceneManager* sceneManager, Factory::Pointer factory );
64 EExecuterBBSG( wxVtkSceneManager* sceneManager, Factory::Pointer factory );
71 /// Sets the inputs of the workspace :
72 virtual void SetInputs(const std::map<std::string,std::string>& m);
74 /// Puts the executer in "no exec" mode,
75 /// which creates but does not execute pipelines
76 virtual void SetNoExecMode(bool b);
78 virtual bool GetNoExecMode() const;
80 /// Sets the mode of dialog of the executer for Root inputs
81 virtual void SetDialogMode(DialogModeType t);
83 /// Puts the executer in "no error" mode,
84 /// Errors do not stop execution (but warnings are produced)
85 virtual void SetNoErrorMode(bool b) ;
86 virtual bool GetNoErrorMode() const ;
87 //=================================================================
89 virtual void LoadPackage(const std::string &name ) ;
92 virtual void UnLoadPackage(const std::string &name );
94 /// Starts a package block
95 virtual void BeginPackage (const std::string &name );
97 /// Ends a package block
98 virtual void EndPackage ();
100 /// Starts the definition of a new ComplexBlackBox in package pack
101 /// scriptfilename is the file from which the def is read
102 virtual void Define (const std::string &name,
103 const std::string& pack,
104 const std::string &scriptfilename);
106 /// Sets the file name to use for the current definition
107 /// (Used to set it after the Define command)
108 virtual void SetCurrentFileName (const std::string &name );
110 /// End the definition of a ComplexBlackBox
111 virtual void EndDefine () ;
113 /// Sets the kind of the currently defined ComplexBlackBox
114 virtual void Kind(const std::string& kind);
116 /// Creates a new black box in current complex box
117 virtual void Create ( const std::string& boxType, const std::string&
120 /// Destroys a black box
121 virtual void Destroy (const std::string &boxName);
123 /// Clears the currently defined ComplexBlackBox
124 virtual void Clear() ;
126 /// Connects the output boxOutput to the input boxInput
127 virtual void Connect (const std::string &boxfrom,
128 const std::string &output,
129 const std::string &boxto,
130 const std::string &input) ;
133 virtual void Execute (const std::string &box) ;
135 /// Defines an input of the current complex box
136 virtual void DefineInput (const std::string &name,
137 const std::string &box,
138 const std::string &input,
139 const std::string &help) ;
141 /// Defines an output of the current complex box
142 virtual void DefineOutput (const std::string &name,
143 const std::string &box,
144 const std::string &output,
145 const std::string &help);
147 /// sets the input of the box with the value
148 virtual void Set (const std::string &box,
149 const std::string &input,
150 const std::string &value);
152 /// gets the output of the box
153 virtual std::string Get (const std::string &box,
154 const std::string &output) ;
156 /// changes the workspace name
157 virtual void SetWorkspaceName( const std::string& n );
159 ///Adds the authorName to the Box author list
160 virtual void Author(const std::string &authorName);
162 ///Adds the categories to the Box categoris list
163 virtual void Category(const std::string &categories);
165 /// The description string which explains what does the ComplexBox
166 virtual void Description(const std::string &d);
168 /// prints the list of the boxes of the current box
169 virtual void PrintHelpListBoxes();
171 /// Generate a HTML file with a gif file with the actual pipeline (Graphviz-dot needed). Returns the file path
172 virtual std::string ShowGraph(const std::string &nameblackbox,
173 const std::string &detailStr,
174 const std::string &levelStr,
175 const std::string &output_file,
176 const std::string &custom_header,
177 const std::string &custom_title,
178 bool system_display = true);
180 /// Generate a HTML with a gif file with the actual pipeline (Graphviz-dot needed). Returns the file path
181 virtual std::string ShowGraphInstances(const std::string &nameblackbox, int detail, int level, bool system_display=true) ;
183 /// Prints help on a black box
184 virtual void PrintHelpBlackBox(const std::string &nameblackbox, const std::string &detailStr, const std::string &levelStr);
186 virtual void Reset();
188 /// Sets the level of message for kind
189 virtual void SetMessageLevel(const std::string &kind, int level);
191 /// Prints help on the messages
192 virtual void HelpMessages();
194 /// Prints the string ... MORE : TO EXPLAIN
195 virtual void Print(const std::string & message);
201 wxVtkSceneManager *_sceneManager;
202 Factory::Pointer _factory;
213 //Protected Attributes