X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=kernel%2Fsrc%2FbbtkComplexBlackBox.cxx;h=f3531fc5b301539336b3539d80f6c324767b1eec;hb=8dd53a72bc1dd1ca2c6e2763c0aeb51c77ee352e;hp=d15a45cc726c94b137be1158e8c17c4a2b3d2dee;hpb=5934ccb7ca0fabdbe6c1907b2aea3696e19a0251;p=bbtk.git diff --git a/kernel/src/bbtkComplexBlackBox.cxx b/kernel/src/bbtkComplexBlackBox.cxx index d15a45c..f3531fc 100644 --- a/kernel/src/bbtkComplexBlackBox.cxx +++ b/kernel/src/bbtkComplexBlackBox.cxx @@ -1,27 +1,40 @@ -/*========================================================================= - -Program: bbtk -Module: $RCSfile: bbtkComplexBlackBox.cxx,v $ -Language: C++ -Date: $Date: 2008/04/22 14:30:25 $ -Version: $Revision: 1.15 $ - -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. - +/*========================================================================= + Program: bbtk + Module: $RCSfile: bbtkComplexBlackBox.cxx,v $ + Language: C++ + Date: $Date: 2009/03/30 15:22:51 $ + Version: $Revision: 1.25 $ =========================================================================*/ +/* --------------------------------------------------------------------- + +* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) +* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux +* +* 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. +* ------------------------------------------------------------------------ */ + /** * \file * \brief class bbtk::ComplexBlackBox : user defined complex black boxes */ #include "bbtkComplexBlackBox.h" +#include "bbtkWx.h" #include "bbtkBlackBoxDescriptor.h" #include "bbtkFactory.h" #include "bbtkConfigurationFile.h" @@ -79,13 +92,17 @@ namespace bbtk <first<<"\""<second->bbClone(i->second->bbGetName()); bbUnsafeAddBlackBox(B); - } bbtkDebugMessage("object",4," * Cloning Connections"< ComplexBlackBox::~ComplexBlackBox() [" <bbDesallocateConnectors(); + + bbtkDebugMessage("object",3, + "<== ComplexBlackBox::~ComplexBlackBox() [" + < ComplexBlackBox::Clear() [" + < Releasing connections"< Releasing boxes"<bbDesallocateConnectors(); - bbtkDebugMessage("object",3, - "<== ComplexBlackBox::~ComplexBlackBox() [" + "<== ComplexBlackBox::Clear() [" < ComplexBlackBox::bbExecute() [" < Executing '"<<*i<<"'"< Executing '"<<*i<<"'"<bbExecute(force); } } @@ -259,110 +290,20 @@ namespace bbtk } } - Wx::EndBusyCursor(); - - - bbtkDebugDecTab("Process",1); - - } - //================================================================== - - //================================================================== - void ComplexBlackBox::bbSetModifiedStatus(BlackBoxInputConnector* c) - { - bbtkDebugMessage("Process",3, - "ComplexBlackBox::bbSetModifiedStatus(" - <GetBlackBox()->bbSetModifiedStatus(c); - - bbtkDebugMessage("Process",3, - "EO ComplexBlackBox::bbSetModifiedStatus(" - <GetFullName():"0")<<") [" - <GetBlackBoxFrom()->bbGetFullName() - <<"."<GetBlackBoxFromOutput()<<"----" - <GetOriginalBlackBoxFrom()->bbGetFullName() - <<"."<GetOriginalBlackBoxFromOutput()<GetOutputDescriptorMap(); - BlackBoxDescriptor::OutputDescriptorMapType::const_iterator i - = omap.find(caller->GetBlackBoxFromOutput()); - if (i!=omap.end()) - { - // Cast the BBOutputDescriptor into a ComplexBBOutputDescriptor - ComplexBlackBoxOutputDescriptor* d = - (ComplexBlackBoxOutputDescriptor*)i->second; - // Get the internal box - BlackBox::Pointer b = bbUnsafeGetBlackBox ( d->GetTarget() ); - // Calls BackwardUpdate on it - bbtkDebugMessageInc("Process",2,"Internal box connected to output : "<GetTarget()<GetBlackBoxFromOutput(); - // std::cout << "oldout = "<GetFullName()<<"' does not point to a valid output of the complex box !"); - } - bbtkDebugDecTab("Process",1); - - return s; + mExecutionList.push_back( name ); + + bbtkDebugDecTab("Kernel",9); } //================================================================== @@ -739,7 +680,6 @@ namespace bbtk const std::string& output_dir, bool relative_link ) { - std::string directory(output_dir); if (output_dir.length() == 0) @@ -761,10 +701,10 @@ namespace bbtk std::string filename_dot2 ("\"" + filename_dot + "\""); - std::string command1 ("dot -T png -o " - + filename_png2 + " " + filename_dot2); + std::string command1 ("dot -Tpng:quartz -o " + + filename_png2 + " " + filename_dot2 ); std::string command1a("dot -T cmap -o " - + filename_cmap2 + " " + filename_dot2); + + filename_cmap2 + " " + filename_dot2 ); // 1. Generating .dot file FILE *ff; @@ -798,14 +738,16 @@ namespace bbtk FILE *ff2; char c; ff2=fopen(filename_cmap.c_str(),"r"); - while (!feof(ff2)) - { - c=fgetc(ff2); - if (c!=-1) - { - (s) << c; - } - } + if (ff2!=NULL){ + while (!feof(ff2)) + { + c=fgetc(ff2); + if (c!=-1) + { + (s) << c; + } // if + } // while + } // if ff2 (s) << "\n\n"; // End