1 /*=========================================================================
4 Module: $RCSfile: bbtkTranscriptor.h,v $ $
6 Date: $Date: 2008/04/08 06:59:30 $
7 Version: $Revision: 1.9 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
20 * \brief class Transcriptor: level 0 of script C++ translation (header)
23 * \class bbtk::Transcriptor
24 * \brief class Transcriptor: level 0 of script C++ translation
27 #ifndef __bbtkTranscriptor_h__
28 #define __bbtkTranscriptor_h__
30 #include "bbtkVirtualExec.h"
32 #include "bbtkSystem.h"
38 class /*BBTK_EXPORT*/ Transcriptor : public VirtualExec
44 Transcriptor(std::string filename);
49 /// Sets the inputs of the workspace :
50 void SetInputs(const std::map<std::string,std::string>& m) { mInputs = m; }
52 /// Puts the executer in "no exec" mode,
53 /// which creates but does not execute pipelines
55 //void SetNoExecMode(bool b) { mNoExecMode = b; }
56 void SetNoExecMode(bool b)
59 m_Fp << " e->SetNoExecMode(true);" << std::endl;
61 m_Fp << " e->SetNoExecMode(false);" << std::endl;
64 bool GetNoExecMode() const { return mNoExecMode; }
66 /// Sets the mode of dialog of the executer for Root inputs
67 void SetDialogMode(DialogModeType t) { mDialogMode = t; }
70 void LoadPackage(const std::string &name );
73 void UnLoadPackage(const std::string &name );
75 /// Starts a package block
76 void BeginPackage (const std::string &name );
78 /// Ends a package block
81 /// Starts the definition of a new ComplexBlackBox in package pack
82 /// scriptfilename is the file from which the def is read
83 void Define (const std::string &name,
84 const std::string& pack,
85 const std::string &scriptfilename);
87 /// Sets the file name to use for the current definition
88 /// (Used to set it after the Define command)
89 void SetCurrentFileName (const std::string &name );
91 /// End the definition of a ComplexBlackBox
94 /// Sets the kind of the currently defined ComplexBlackBox
95 void Kind(const std::string& kind);
97 /// Creates a new black box in current complex box
98 void Create ( const std::string& boxType, const std::string& boxName);
100 /// Destroys a black box
101 void Destroy (const std::string &boxName);
103 /// Connects the output boxOutput to the input boxInput
104 void Connect (const std::string &boxfrom,
105 const std::string &output,
106 const std::string &boxto,
107 const std::string &input);
110 void Execute(const std::string &box);
112 /// Defines an input of the current complex box
113 void DefineInput (const std::string &name,
114 const std::string &box,
115 const std::string &input,
116 const std::string &help);
118 /// Defines an output of the current complex box
119 void DefineOutput (const std::string &name,
120 const std::string &box,
121 const std::string &output,
122 const std::string &help);
124 /// sets the input of the box with the value
125 void Set (const std::string &box,
126 const std::string &input,
127 const std::string &value);
129 /// gets the output of the box
130 std::string Get (const std::string &box,
131 const std::string &output);
133 /// changes the workspace name
134 void SetWorkspaceName( const std::string& n );
136 ///Adds the authorName to the Box author list
137 void Author(const std::string &authorName);
139 ///Adds the Categories to the Box category list
140 void Category(const std::string &category);
142 /// The description string which explains what does the ComplexBox
143 void Description(const std::string & d);
145 /// prints the list off the boxes of the current box
148 /// Generate a HTML with a gif file with the actual pipeline (Graphviz-dot needed). Returns the file path
149 std::string ShowGraph(const std::string &nameblackbox,
150 const std::string &detailStr,
151 const std::string &levelStr,
152 const std::string &output_file,
153 const std::string &custom_header,
154 const std::string &custom_title,
155 bool system_display = true);
157 /// Generate a HTML with a gif file with the actual pipeline (Graphviz-dot needed). Returns the file path
158 std::string ShowGraphInstances(const std::string &nameblackbox, int detail, int level, bool system_display=true);
160 /// Description of the actual pipeline
161 void ShowRelations(const std::string &nameblackbox, const std::string &detailStr, const std::string &levelStr);
165 /// Sets the level of message for kind
166 void SetMessageLevel(const std::string &kind,
169 /// Prints help on the messages
172 /// Prints the string ... MORE : TO EXPLAIN
173 void Print(const std::string & message);
175 // static const std::string& GetObjectDescription()
176 // { static std::string s("Executer"); return s; }
182 /// The input values of the Root ComplexBlackBox
183 std::map<std::string,std::string> mInputs;
185 /// no exec mode flag
189 DialogModeType mDialogMode;
191 /// File Pointer, to hold generated C++ code.
192 // std::ofstream *m_Fp;