X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkTranscriptor.cxx;h=f425a0eb07be0e22eaebdaa1307fd29fbcec167f;hb=3f3122bf224c4c9bc3bed303fb3e5218764f9317;hp=ff0785b392013d6ce23a9ee1ebc91e20167cba8a;hpb=4a17a289103f77885e288aaae250e57c91ae3424;p=bbtk.git diff --git a/kernel/src/bbtkTranscriptor.cxx b/kernel/src/bbtkTranscriptor.cxx index ff0785b..f425a0e 100644 --- a/kernel/src/bbtkTranscriptor.cxx +++ b/kernel/src/bbtkTranscriptor.cxx @@ -1,20 +1,40 @@ +/* + # --------------------------------------------------------------------- + # + # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image + # pour la SantÈ) + # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton + # Previous Authors : Laurent Guigues, Jean-Pierre Roux + # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil + # + # This software is governed by the CeCILL-B license under French law and + # abiding by the rules of distribution of free software. You can use, + # modify and/ or redistribute the software under the terms of the CeCILL-B + # license as circulated by CEA, CNRS and INRIA at the following URL + # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html + # or in the file LICENSE.txt. + # + # As a counterpart to the access to the source code and rights to copy, + # modify and redistribute granted by the license, users are provided only + # with a limited warranty and the software's author, the holder of the + # economic rights, and the successive licensors have only limited + # liability. + # + # The fact that you are presently reading this means that you have had + # knowledge of the CeCILL-B license and that you accept its terms. + # ------------------------------------------------------------------------ */ + + /*========================================================================= - Program: bbtk - Module: $RCSfile: bbtkTranscriptor.cxx,v $ $ + Module: $RCSfile: bbtkTranscriptor.cxx,v $ Language: C++ - Date: $Date: 2008/03/26 08:27:19 $ - Version: $Revision: 1.8 $ - - Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de - l'Image). All rights reserved. See Doc/License.txt or - http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - + Date: $Date: 2012/11/16 08:49:01 $ + Version: $Revision: 1.19 $ =========================================================================*/ + + + /** * \file * \brief class Transcriptor: level 0 of script execution (code) @@ -36,27 +56,61 @@ namespace bbtk { + Transcriptor::Pointer Transcriptor::New(const std::string& filename) + { + return MakePointer(new Transcriptor(filename)); + } + /** * */ - Transcriptor::Transcriptor(std::string filename) - : mPackage(0), - mRoot(0), - mNoExecMode(false), + Transcriptor::Transcriptor(const std::string& filename) + : mDialogMode(NoDialog) { //VirtualExec(); - bbtkDebugMessageInc("Kernel",9,"Transcriptor::Transcriptor()" <UnRegisterBlackBox("workspace"); - delete mRoot; - } - if (mPackage) - { - //GetGlobalFactory()->UnLoadPackage("user"); - } - - if(m_Fp) - { - bbtkDebugDecTab("Kernel",9); - m_Fp << " }" << std::endl; - m_Fp.close(); - // delete m_Fp; - } - } - - - // ================= Begin of Battlefield ============================= + bbtkDebugMessageInc("kernel",9,"~Transcriptor()" <Reset( );" << std::endl; } + void Transcriptor::Clear() + { + m_Fp << " e->Clear( );" << std::endl; + } + void Transcriptor::SetWorkspaceName( const std::string& name ) { @@ -126,11 +184,16 @@ std::cout << "====================================================== delete Tran m_Fp << " e->EndDefine( );" << std::endl; } + void Transcriptor::Kind(const std::string& kind) + { + m_Fp << " e->Kind( \""<Add(\"" << nodeType << "\", \"" + m_Fp << " e->Create(\"" << nodeType << "\", \"" << nodeName << "\");" << std::endl; } @@ -162,8 +225,8 @@ std::cout << "====================================================== delete Tran const std::string& help) { - m_Fp << " e->DefineInput(\""<< name << "\", " << box << ", " - << input << ", \"" << help << "\");" << std::endl; + m_Fp << " e->DefineInput(\""<< name << "\", \"" << box << "\", \"" + << input << "\", \"" << help << "\");" << std::endl; } @@ -199,27 +262,25 @@ std::cout << "====================================================== delete Tran void Transcriptor::Author(const std::string &authorName) { - m_Fp << " e->AddToAuthor(\"" << authorName << "\")" << std::endl; + m_Fp << " e->Author(\"" << authorName << "\");" << std::endl; } void Transcriptor::Category(const std::string &category) { - m_Fp << " e->AddToCategory(\"" << category << "\")" << std::endl; + m_Fp << " e->Category(\"" << category << "\");" << std::endl; } void Transcriptor::Description(const std::string &d) { - m_Fp << " e->AddToDescription(\"" << d << "\")" << std::endl; + m_Fp << " e->Description(\"" << d << "\");" << std::endl; } /// prints the list of the boxes of the current descriptor - void Transcriptor::PrintBoxes() + void Transcriptor::PrintHelpListBoxes() { - m_Fp << " e->PrintBoxes( )" << std::endl; + m_Fp << " e->PrintBoxes( );" << std::endl; } -// =========================End of Battlefield ======================================================================== - std::string Transcriptor::ShowGraph(const std::string &nameblackbox, const std::string &detailStr, const std::string &levelStr, @@ -247,14 +308,14 @@ std::cout << "====================================================== delete Tran } -void Transcriptor::ShowRelations(const std::string &nameblackbox, const std::string &detailStr, const std::string &levelStr) +void Transcriptor::PrintHelpBlackBox(const std::string &nameblackbox, const std::string &detailStr, const std::string &levelStr) { } void Transcriptor::Print(const std::string & message) { - m_Fp << " e->Print(\"" <Print(\"" <SetMessageLevel(\"" <SetMessageLevel(\"" <HelpMessages()"<HelpMessages();"<LoadPackage(\"" <LoadPackage(\"" <UnLoadPackage(\"" <UnLoadPackage(\"" <