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 * \brief Class bbtk::GConnectorModel
37 #include "ExecuterBBSG.h"
39 #include "bbtkExecuter.h"
40 #include "bbtkMessageManager.h"
41 #include "bbtkFactory.h"
42 #include "bbtkUtilities.h"
51 EExecuterBBSG::Pointer EExecuterBBSG::New()
53 return MakePointer( new EExecuterBBSG() );
57 //=========================================================================
59 EExecuterBBSG::EExecuterBBSG()
63 //=========================================================================
65 EExecuterBBSG::~EExecuterBBSG()
69 //=========================================================================
72 /// Sets the inputs of the workspace :
73 void EExecuterBBSG::SetInputs(const std::map<std::string,std::string>& m)
77 /// Puts the executer in "no exec" mode,
78 /// which creates but does not execute pipelines
79 void EExecuterBBSG::SetNoExecMode(bool b)
83 bool EExecuterBBSG::GetNoExecMode() const
88 /// Sets the mode of dialog of the executer for Root inputs
89 void EExecuterBBSG::SetDialogMode(DialogModeType t)
93 /// Puts the executer in "no error" mode,
94 /// Errors do not stop execution (but warnings are produced)
95 void EExecuterBBSG::SetNoErrorMode(bool b)
99 bool EExecuterBBSG::GetNoErrorMode() const
104 //=================================================================
106 void EExecuterBBSG::LoadPackage(const std::string &name )
110 /// Unloads a package
111 void EExecuterBBSG::UnLoadPackage(const std::string &name )
115 /// Starts a package block
116 void EExecuterBBSG::BeginPackage (const std::string &name )
120 /// Ends a package block
121 void EExecuterBBSG::EndPackage ()
125 /// Starts the definition of a new ComplexBlackBox in package pack
126 /// scriptfilename is the file from which the def is read
127 void EExecuterBBSG::Define (const std::string &name,
128 const std::string& pack,
129 const std::string &scriptfilename)
133 /// Sets the file name to use for the current definition
134 /// (Used to set it after the Define command)
135 void EExecuterBBSG::SetCurrentFileName (const std::string &name )
139 /// End the definition of a ComplexBlackBox
140 void EExecuterBBSG::EndDefine ()
144 /// Sets the kind of the currently defined ComplexBlackBox
145 void EExecuterBBSG::Kind(const std::string& kind)
149 /// Creates a new black box in current complex box
150 void EExecuterBBSG::Create ( const std::string& boxType, const std::string&
153 printf("EED EExecuterBBSG::Create\n");
156 /// Destroys a black box
157 void EExecuterBBSG::Destroy (const std::string &boxName)
161 /// Clears the currently defined ComplexBlackBox
162 void EExecuterBBSG::Clear()
166 /// Connects the output boxOutput to the input boxInput
167 void EExecuterBBSG::Connect (const std::string &boxfrom,
168 const std::string &output,
169 const std::string &boxto,
170 const std::string &input)
172 printf("EED EExecuterBBSG::Connect\n");
176 void EExecuterBBSG::Execute (const std::string &box)
180 /// Defines an input of the current complex box
181 void EExecuterBBSG::DefineInput (const std::string &name,
182 const std::string &box,
183 const std::string &input,
184 const std::string &help)
188 /// Defines an output of the current complex box
189 void EExecuterBBSG::DefineOutput (const std::string &name,
190 const std::string &box,
191 const std::string &output,
192 const std::string &help)
196 /// sets the input of the box with the value
197 void EExecuterBBSG::Set (const std::string &box,
198 const std::string &input,
199 const std::string &value)
201 printf("EED EExecuterBBSG::Set\n");
204 /// gets the output of the box
205 std::string EExecuterBBSG::Get (const std::string &box,
206 const std::string &output)
211 /// changes the workspace name
212 void EExecuterBBSG::SetWorkspaceName( const std::string& n )
216 ///Adds the authorName to the Box author list
217 void EExecuterBBSG::Author(const std::string &authorName)
221 ///Adds the categories to the Box categoris list
222 void EExecuterBBSG::Category(const std::string &categories)
226 /// The description string which explains what does the ComplexBox
227 void EExecuterBBSG::Description(const std::string &d)
231 /// prints the list of the boxes of the current box
232 void EExecuterBBSG::PrintHelpListBoxes()
236 /// Generate a HTML file with a gif file with the actual pipeline (Graphviz-dot needed). Returns the file path
237 std::string EExecuterBBSG::ShowGraph(const std::string &nameblackbox,
238 const std::string &detailStr,
239 const std::string &levelStr,
240 const std::string &output_file,
241 const std::string &custom_header,
242 const std::string &custom_title,
248 /// Generate a HTML with a gif file with the actual pipeline (Graphviz-dot needed). Returns the file path
249 std::string EExecuterBBSG::ShowGraphInstances(const std::string &nameblackbox, int detail, int level, bool system_display)
254 /// Prints help on a black box
255 void EExecuterBBSG::PrintHelpBlackBox(const std::string &nameblackbox, const std::string &detailStr, const std::string &levelStr)
259 void EExecuterBBSG::Reset()
263 /// Sets the level of message for kind
264 void EExecuterBBSG::SetMessageLevel(const std::string &kind, int level)
268 /// Prints help on the messages
269 void EExecuterBBSG::HelpMessages()
273 /// Prints the string ... MORE : TO EXPLAIN
274 void EExecuterBBSG::Print(const std::string & message)
281 } // EO namespace bbtk